summaryrefslogtreecommitdiff
path: root/sys/ufs/ffs/ffs_alloc.c
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1997-05-30 08:35:23 +0000
committerJason Downs <downsj@cvs.openbsd.org>1997-05-30 08:35:23 +0000
commitabede2744bbad7139d9bd3435f5f7ca1d4e85e51 (patch)
tree8db1f2051b877c6f22dc49bb6d13be81d4235ec4 /sys/ufs/ffs/ffs_alloc.c
parentec6ef49763f047e88c3866301e0e71dc29900b97 (diff)
Integrate new ext2fs, reverting ufs support for the old one.
Diffstat (limited to 'sys/ufs/ffs/ffs_alloc.c')
-rw-r--r--sys/ufs/ffs/ffs_alloc.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c
index cd81395a3e3..a98f12f7460 100644
--- a/sys/ufs/ffs/ffs_alloc.c
+++ b/sys/ufs/ffs/ffs_alloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_alloc.c,v 1.5 1997/02/11 06:59:27 millert Exp $ */
+/* $OpenBSD: ffs_alloc.c,v 1.6 1997/05/30 08:34:15 downsj Exp $ */
/* $NetBSD: ffs_alloc.c,v 1.11 1996/05/11 18:27:09 mycroft Exp $ */
/*
@@ -132,7 +132,7 @@ ffs_alloc(ip, lbn, bpref, size, cred, bnp)
bno = (daddr_t)ffs_hashalloc(ip, cg, (long)bpref, size,
ffs_alloccg);
if (bno > 0) {
- ip->i_blocks += btodb(size);
+ ip->i_ffs_blocks += btodb(size);
ip->i_flag |= IN_CHANGE | IN_UPDATE;
*bnp = bno;
return (0);
@@ -186,7 +186,7 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
#endif /* DIAGNOSTIC */
if (cred->cr_uid != 0 && freespace(fs, fs->fs_minfree) <= 0)
goto nospace;
- if ((bprev = ip->i_db[lbprev]) == 0) {
+ if ((bprev = ip->i_ffs_db[lbprev]) == 0) {
printf("dev = 0x%x, bsize = %d, bprev = %d, fs = %s\n",
ip->i_dev, fs->fs_bsize, bprev, fs->fs_fsmnt);
panic("ffs_realloccg: bad bprev");
@@ -211,7 +211,7 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
if ((bno = ffs_fragextend(ip, cg, (long)bprev, osize, nsize)) != 0) {
if (bp->b_blkno != fsbtodb(fs, bno))
panic("bad blockno");
- ip->i_blocks += btodb(nsize - osize);
+ ip->i_ffs_blocks += btodb(nsize - osize);
ip->i_flag |= IN_CHANGE | IN_UPDATE;
allocbuf(bp, nsize);
bp->b_flags |= B_DONE;
@@ -276,7 +276,7 @@ ffs_realloccg(ip, lbprev, bpref, osize, nsize, cred, bpp)
if (nsize < request)
ffs_blkfree(ip, bno + numfrags(fs, nsize),
(long)(request - nsize));
- ip->i_blocks += btodb(nsize - osize);
+ ip->i_ffs_blocks += btodb(nsize - osize);
ip->i_flag |= IN_CHANGE | IN_UPDATE;
allocbuf(bp, nsize);
bp->b_flags |= B_DONE;
@@ -372,7 +372,7 @@ ffs_reallocblks(v)
* Get the starting offset and block map for the first block.
*/
if (start_lvl == 0) {
- sbap = &ip->i_db[0];
+ sbap = &ip->i_ffs_db[0];
soff = start_lbn;
} else {
idp = &start_ap[start_lvl - 1];
@@ -448,7 +448,7 @@ ffs_reallocblks(v)
* We can then check below to see if it is set, and do the
* synchronous write only when it has been cleared.
*/
- if (sbap != &ip->i_db[0]) {
+ if (sbap != &ip->i_ffs_db[0]) {
if (doasyncfree)
bdwrite(sbp);
else
@@ -492,7 +492,7 @@ ffs_reallocblks(v)
fail:
if (ssize < len)
brelse(ebp);
- if (sbap != &ip->i_db[0])
+ if (sbap != &ip->i_ffs_db[0])
brelse(sbp);
return (ENOSPC);
}
@@ -552,26 +552,26 @@ ffs_valloc(v)
return (error);
}
ip = VTOI(*ap->a_vpp);
- if (ip->i_mode) {
+ if (ip->i_ffs_mode) {
printf("mode = 0%o, inum = %d, fs = %s\n",
- ip->i_mode, ip->i_number, fs->fs_fsmnt);
+ ip->i_ffs_mode, ip->i_number, fs->fs_fsmnt);
panic("ffs_valloc: dup alloc");
}
- if (ip->i_blocks) { /* XXX */
+ if (ip->i_ffs_blocks) { /* XXX */
printf("free inode %s/%d had %d blocks\n",
- fs->fs_fsmnt, ino, ip->i_blocks);
- ip->i_blocks = 0;
+ fs->fs_fsmnt, ino, ip->i_ffs_blocks);
+ ip->i_ffs_blocks = 0;
}
- ip->i_flags = 0;
+ ip->i_ffs_flags = 0;
/*
* Set up a new generation number for this inode.
* XXX - just increment for now, this is wrong! (millert)
* Need a way to preserve randomization.
*/
- if (ip->i_gen == 0 || ++(ip->i_gen) == 0)
- ip->i_gen = arc4random();
- if (ip->i_gen == 0 || ip->i_gen == -1)
- ip->i_gen = 1; /* shouldn't happen */
+ if (ip->i_ffs_gen == 0 || ++(ip->i_ffs_gen) == 0)
+ ip->i_ffs_gen = arc4random();
+ if (ip->i_ffs_gen == 0 || ip->i_ffs_gen == -1)
+ ip->i_ffs_gen = 1; /* shouldn't happen */
return (0);
noinodes:
ffs_fserr(fs, ap->a_cred->cr_uid, "out of inodes");
@@ -1237,7 +1237,7 @@ ffs_blkfree(ip, bno, size)
cg = dtog(fs, bno);
if ((u_int)bno >= fs->fs_size) {
printf("bad block %d, ino %d\n", bno, ip->i_number);
- ffs_fserr(fs, ip->i_uid, "bad block");
+ ffs_fserr(fs, ip->i_ffs_uid, "bad block");
return;
}
error = bread(ip->i_devvp, fsbtodb(fs, cgtod(fs, cg)),