diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1997-05-30 08:35:23 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1997-05-30 08:35:23 +0000 |
commit | abede2744bbad7139d9bd3435f5f7ca1d4e85e51 (patch) | |
tree | 8db1f2051b877c6f22dc49bb6d13be81d4235ec4 /sys/ufs/ffs/ffs_balloc.c | |
parent | ec6ef49763f047e88c3866301e0e71dc29900b97 (diff) |
Integrate new ext2fs, reverting ufs support for the old one.
Diffstat (limited to 'sys/ufs/ffs/ffs_balloc.c')
-rw-r--r-- | sys/ufs/ffs/ffs_balloc.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sys/ufs/ffs/ffs_balloc.c b/sys/ufs/ffs/ffs_balloc.c index dfd6468d8e7..5a7dc3afcc2 100644 --- a/sys/ufs/ffs/ffs_balloc.c +++ b/sys/ufs/ffs/ffs_balloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_balloc.c,v 1.2 1996/02/27 07:27:35 niklas Exp $ */ +/* $OpenBSD: ffs_balloc.c,v 1.3 1997/05/30 08:34:19 downsj Exp $ */ /* $NetBSD: ffs_balloc.c,v 1.3 1996/02/09 22:22:21 christos Exp $ */ /* @@ -85,18 +85,18 @@ ffs_balloc(ip, bn, size, cred, bpp, flags) * and the file is currently composed of a fragment * this fragment has to be extended to be a full block. */ - nb = lblkno(fs, ip->i_size); + nb = lblkno(fs, ip->i_ffs_size); if (nb < NDADDR && nb < bn) { osize = blksize(fs, ip, nb); if (osize < fs->fs_bsize && osize > 0) { error = ffs_realloccg(ip, nb, - ffs_blkpref(ip, nb, (int)nb, &ip->i_db[0]), + ffs_blkpref(ip, nb, (int)nb, &ip->i_ffs_db[0]), osize, (int)fs->fs_bsize, cred, &bp); if (error) return (error); - ip->i_size = (nb + 1) * fs->fs_bsize; - vnode_pager_setsize(vp, (u_long)ip->i_size); - ip->i_db[nb] = dbtofsb(fs, bp->b_blkno); + ip->i_ffs_size = (nb + 1) * fs->fs_bsize; + vnode_pager_setsize(vp, (u_long)ip->i_ffs_size); + ip->i_ffs_db[nb] = dbtofsb(fs, bp->b_blkno); ip->i_flag |= IN_CHANGE | IN_UPDATE; if (flags & B_SYNC) bwrite(bp); @@ -108,8 +108,8 @@ ffs_balloc(ip, bn, size, cred, bpp, flags) * The first NDADDR blocks are direct blocks */ if (bn < NDADDR) { - nb = ip->i_db[bn]; - if (nb != 0 && ip->i_size >= (bn + 1) * fs->fs_bsize) { + nb = ip->i_ffs_db[bn]; + if (nb != 0 && ip->i_ffs_size >= (bn + 1) * fs->fs_bsize) { error = bread(vp, bn, fs->fs_bsize, NOCRED, &bp); if (error) { brelse(bp); @@ -122,7 +122,7 @@ ffs_balloc(ip, bn, size, cred, bpp, flags) /* * Consider need to reallocate a fragment. */ - osize = fragroundup(fs, blkoff(fs, ip->i_size)); + osize = fragroundup(fs, blkoff(fs, ip->i_ffs_size)); nsize = fragroundup(fs, size); if (nsize <= osize) { error = bread(vp, bn, osize, NOCRED, &bp); @@ -132,18 +132,18 @@ ffs_balloc(ip, bn, size, cred, bpp, flags) } } else { error = ffs_realloccg(ip, bn, - ffs_blkpref(ip, bn, (int)bn, &ip->i_db[0]), + ffs_blkpref(ip, bn, (int)bn, &ip->i_ffs_db[0]), osize, nsize, cred, &bp); if (error) return (error); } } else { - if (ip->i_size < (bn + 1) * fs->fs_bsize) + if (ip->i_ffs_size < (bn + 1) * fs->fs_bsize) nsize = fragroundup(fs, size); else nsize = fs->fs_bsize; error = ffs_alloc(ip, bn, - ffs_blkpref(ip, bn, (int)bn, &ip->i_db[0]), + ffs_blkpref(ip, bn, (int)bn, &ip->i_ffs_db[0]), nsize, cred, &newb); if (error) return (error); @@ -152,7 +152,7 @@ ffs_balloc(ip, bn, size, cred, bpp, flags) if (flags & B_CLRBUF) clrbuf(bp); } - ip->i_db[bn] = dbtofsb(fs, bp->b_blkno); + ip->i_ffs_db[bn] = dbtofsb(fs, bp->b_blkno); ip->i_flag |= IN_CHANGE | IN_UPDATE; *bpp = bp; return (0); @@ -171,7 +171,7 @@ ffs_balloc(ip, bn, size, cred, bpp, flags) * Fetch the first indirect block allocating if necessary. */ --num; - nb = ip->i_ib[indirs[0].in_off]; + nb = ip->i_ffs_ib[indirs[0].in_off]; if (nb == 0) { pref = ffs_blkpref(ip, lbn, 0, (daddr_t *)0); error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, @@ -190,7 +190,7 @@ ffs_balloc(ip, bn, size, cred, bpp, flags) ffs_blkfree(ip, nb, fs->fs_bsize); return (error); } - ip->i_ib[indirs[0].in_off] = newb; + ip->i_ffs_ib[indirs[0].in_off] = newb; ip->i_flag |= IN_CHANGE | IN_UPDATE; } /* |