* 2) quadradically rehash into other cylinder groups, until an
* available block is located.
*/
* 2) quadradically rehash into other cylinder groups, until an
* available block is located.
*/
-ffs_alloc(ip, lbn, bpref, size, bnp)
+ffs_alloc(ip, lbn, bpref, size, cred, bnp)
if ((unsigned)size > fs->fs_bsize || fragoff(fs, size) != 0) {
printf("dev = 0x%x, bsize = %d, size = %d, fs = %s\n",
ip->i_dev, fs->fs_bsize, size, fs->fs_fsmnt);
panic("ffs_alloc: bad size");
}
if ((unsigned)size > fs->fs_bsize || fragoff(fs, size) != 0) {
printf("dev = 0x%x, bsize = %d, size = %d, fs = %s\n",
ip->i_dev, fs->fs_bsize, size, fs->fs_fsmnt);
panic("ffs_alloc: bad size");
}
if (size == fs->fs_bsize && fs->fs_cstotal.cs_nbfree == 0)
goto nospace;
if (cred->cr_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
if (size == fs->fs_bsize && fs->fs_cstotal.cs_nbfree == 0)
goto nospace;
if (cred->cr_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
* the original block. Failing that, the regular block allocator is
* invoked to get an appropriate block.
*/
* the original block. Failing that, the regular block allocator is
* invoked to get an appropriate block.
*/
-ffs_realloccg(ip, lbprev, bpref, osize, nsize, bpp)
+ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
if ((unsigned)osize > fs->fs_bsize || fragoff(fs, osize) != 0 ||
(unsigned)nsize > fs->fs_bsize || fragoff(fs, nsize) != 0) {
printf(
if ((unsigned)osize > fs->fs_bsize || fragoff(fs, osize) != 0 ||
(unsigned)nsize > fs->fs_bsize || fragoff(fs, nsize) != 0) {
printf(
ip->i_dev, fs->fs_bsize, osize, nsize, fs->fs_fsmnt);
panic("ffs_realloccg: bad size");
}
ip->i_dev, fs->fs_bsize, osize, nsize, fs->fs_fsmnt);
panic("ffs_realloccg: bad size");
}
if (cred->cr_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
goto nospace;
if ((bprev = ip->i_db[lbprev]) == 0) {
if (cred->cr_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
goto nospace;
if ((bprev = ip->i_db[lbprev]) == 0) {
if (nsize < request)
ffs_blkfree(ip, bno + numfrags(fs, nsize),
if (nsize < request)
ffs_blkfree(ip, bno + numfrags(fs, nsize),
* 2) quadradically rehash into other cylinder groups, until an
* available inode is located.
*/
* 2) quadradically rehash into other cylinder groups, until an
* available inode is located.
*/
-ffs_ialloc(pip, mode, cred, ipp)
- register struct inode *pip;
+ffs_valloc(pvp, mode, cred, vpp)
+ register struct vnode *pvp;
ino = (ino_t)ffs_hashalloc(pip, cg, (long)ipref, mode, ffs_ialloccg);
if (ino == 0)
goto noinodes;
ino = (ino_t)ffs_hashalloc(pip, cg, (long)ipref, mode, ffs_ialloccg);
if (ino == 0)
goto noinodes;
if (ip->i_mode) {
printf("mode = 0%o, inum = %d, fs = %s\n",
ip->i_mode, ip->i_number, fs->fs_fsmnt);
if (ip->i_mode) {
printf("mode = 0%o, inum = %d, fs = %s\n",
ip->i_mode, ip->i_number, fs->fs_fsmnt);
}
if (ip->i_blocks) { /* XXX */
printf("free inode %s/%d had %d blocks\n",
}
if (ip->i_blocks) { /* XXX */
printf("free inode %s/%d had %d blocks\n",
* Check to see if a block of the apprpriate size is available,
* and if it is, allocate it.
*/
* Check to see if a block of the apprpriate size is available,
* and if it is, allocate it.
*/
ffs_alloccg(ip, cg, bpref, size)
struct inode *ip;
int cg;
ffs_alloccg(ip, cg, bpref, size)
struct inode *ip;
int cg;
ffs_blkfree(ip, bno, size)
register struct inode *ip;
daddr_t bno;
ffs_blkfree(ip, bno, size)
register struct inode *ip;
daddr_t bno;
{
register struct fs *fs;
register struct cg *cgp;
struct buf *bp;
int error, cg, blk, frags, bbase;
register int i;
{
register struct fs *fs;
register struct cg *cgp;
struct buf *bp;
int error, cg, blk, frags, bbase;
register int i;
cg = dtog(fs, bno);
if ((unsigned)bno >= fs->fs_size) {
printf("bad block %d, ino %d\n", bno, ip->i_number);
cg = dtog(fs, bno);
if ((unsigned)bno >= fs->fs_size) {
printf("bad block %d, ino %d\n", bno, ip->i_number);
fs = pip->i_fs;
if ((u_int)ino >= fs->fs_ipg * fs->fs_ncg)
panic("ifree: range: dev = 0x%x, ino = %d, fs = %s\n",
fs = pip->i_fs;
if ((u_int)ino >= fs->fs_ipg * fs->fs_ncg)
panic("ifree: range: dev = 0x%x, ino = %d, fs = %s\n",