Cleanups for 4.4BSD-Lite
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 6 Sep 1993 00:41:50 +0000 (16:41 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Mon, 6 Sep 1993 00:41:50 +0000 (16:41 -0800)
SCCS-vsn: sys/ufs/lfs/lfs_inode.c 8.2
SCCS-vsn: sys/ufs/ffs/ffs_inode.c 8.2
SCCS-vsn: sys/ufs/ffs/ffs_balloc.c 8.2

usr/src/sys/ufs/ffs/ffs_balloc.c
usr/src/sys/ufs/ffs/ffs_inode.c
usr/src/sys/ufs/lfs/lfs_inode.c

index 3084bde..26d032d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ffs_balloc.c        8.1 (Berkeley) %G%
+ *     @(#)ffs_balloc.c        8.2 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -41,10 +41,10 @@ ffs_balloc(ip, bn, size, cred, bpp, flags)
        struct buf *bp, *nbp;
        struct vnode *vp = ITOV(ip);
        struct indir indirs[NIADDR + 2];
        struct buf *bp, *nbp;
        struct vnode *vp = ITOV(ip);
        struct indir indirs[NIADDR + 2];
-       int osize, nsize, num, j, error;
        daddr_t newb, lbn, *bap, pref;
        daddr_t newb, lbn, *bap, pref;
+       int osize, nsize, num, i, error;
 
 
-       *bpp = (struct buf *)0;
+       *bpp = NULL;
        if (bn < 0)
                return (EFBIG);
        fs = ip->i_fs;
        if (bn < 0)
                return (EFBIG);
        fs = ip->i_fs;
@@ -165,18 +165,18 @@ ffs_balloc(ip, bn, size, cred, bpp, flags)
        /*
         * Fetch through the indirect blocks, allocating as necessary.
         */
        /*
         * Fetch through the indirect blocks, allocating as necessary.
         */
-       for (j = 1; ; ) {
-               error = bread(vp, indirs[j].in_lbn, (int)fs->fs_bsize, NOCRED,
-                   &bp);
+       for (i = 1;;) {
+               error = bread(vp,
+                   indirs[i].in_lbn, (int)fs->fs_bsize, NOCRED, &bp);
                if (error) {
                        brelse(bp);
                        return (error);
                }
                bap = bp->b_un.b_daddr;
                if (error) {
                        brelse(bp);
                        return (error);
                }
                bap = bp->b_un.b_daddr;
-               nb = bap[indirs[j].in_off];
-               if (j == num)
+               nb = bap[indirs[i].in_off];
+               if (i == num)
                        break;
                        break;
-               j += 1;
+               i += 1;
                if (nb != 0) {
                        brelse(bp);
                        continue;
                if (nb != 0) {
                        brelse(bp);
                        continue;
@@ -189,7 +189,7 @@ ffs_balloc(ip, bn, size, cred, bpp, flags)
                        return (error);
                }
                nb = newb;
                        return (error);
                }
                nb = newb;
-               nbp = getblk(vp, indirs[j].in_lbn, fs->fs_bsize, 0, 0);
+               nbp = getblk(vp, indirs[i].in_lbn, fs->fs_bsize, 0, 0);
                nbp->b_blkno = fsbtodb(fs, nb);
                clrbuf(nbp);
                /*
                nbp->b_blkno = fsbtodb(fs, nb);
                clrbuf(nbp);
                /*
@@ -201,7 +201,7 @@ ffs_balloc(ip, bn, size, cred, bpp, flags)
                        brelse(bp);
                        return (error);
                }
                        brelse(bp);
                        return (error);
                }
-               bap[indirs[j - 1].in_off] = nb;
+               bap[indirs[i - 1].in_off] = nb;
                /*
                 * If required, write synchronously, otherwise use
                 * delayed write.
                /*
                 * If required, write synchronously, otherwise use
                 * delayed write.
@@ -216,9 +216,9 @@ ffs_balloc(ip, bn, size, cred, bpp, flags)
         * Get the data block, allocating if necessary.
         */
        if (nb == 0) {
         * Get the data block, allocating if necessary.
         */
        if (nb == 0) {
-               pref = ffs_blkpref(ip, lbn, indirs[j].in_off, &bap[0]);
-               if (error =
-                   ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, cred, &newb)) {
+               pref = ffs_blkpref(ip, lbn, indirs[i].in_off, &bap[0]);
+               if (error = ffs_alloc(ip,
+                   lbn, pref, (int)fs->fs_bsize, cred, &newb)) {
                        brelse(bp);
                        return (error);
                }
                        brelse(bp);
                        return (error);
                }
@@ -227,7 +227,7 @@ ffs_balloc(ip, bn, size, cred, bpp, flags)
                nbp->b_blkno = fsbtodb(fs, nb);
                if (flags & B_CLRBUF)
                        clrbuf(nbp);
                nbp->b_blkno = fsbtodb(fs, nb);
                if (flags & B_CLRBUF)
                        clrbuf(nbp);
-               bap[indirs[j].in_off] = nb;
+               bap[indirs[i].in_off] = nb;
                /*
                 * If required, write synchronously, otherwise use
                 * delayed write.
                /*
                 * If required, write synchronously, otherwise use
                 * delayed write.
index 7bd75ea..65cfd4c 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ffs_inode.c 8.1 (Berkeley) %G%
+ *     @(#)ffs_inode.c 8.2 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -51,11 +51,12 @@ int
 ffs_update(ap)
        struct vop_update_args /* {
                struct vnode *a_vp;
 ffs_update(ap)
        struct vop_update_args /* {
                struct vnode *a_vp;
-               struct timeval *a_ta;
-               struct timeval *a_tm;
+               struct timeval *a_access;
+               struct timeval *a_modify;
                int a_waitfor;
        } */ *ap;
 {
                int a_waitfor;
        } */ *ap;
 {
+       register struct fs *fs;
        struct buf *bp;
        struct inode *ip;
        struct dinode *dp;
        struct buf *bp;
        struct inode *ip;
        struct dinode *dp;
@@ -63,20 +64,20 @@ ffs_update(ap)
 
        ip = VTOI(ap->a_vp);
        if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) {
 
        ip = VTOI(ap->a_vp);
        if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) {
-               ip->i_flag &= ~(IUPD|IACC|ICHG|IMOD);
+               ip->i_flag &= ~(IUPD | IACC | ICHG | IMOD);
                return (0);
        }
        if ((ip->i_flag & (IUPD|IACC|ICHG|IMOD)) == 0)
                return (0);
                return (0);
        }
        if ((ip->i_flag & (IUPD|IACC|ICHG|IMOD)) == 0)
                return (0);
-       if (ip->i_flag&IACC)
-               ip->i_atime.ts_sec = ap->a_ta->tv_sec;
-       if (ip->i_flag&IUPD) {
-               ip->i_mtime.ts_sec = ap->a_tm->tv_sec;
+       if (ip->i_flag & IACC)
+               ip->i_atime.ts_sec = ap->a_access->tv_sec;
+       if (ip->i_flag & IUPD) {
+               ip->i_mtime.ts_sec = ap->a_modify->tv_sec;
                ip->i_modrev++;
        }
        if (ip->i_flag&ICHG)
                ip->i_ctime.ts_sec = time.tv_sec;
                ip->i_modrev++;
        }
        if (ip->i_flag&ICHG)
                ip->i_ctime.ts_sec = time.tv_sec;
-       ip->i_flag &= ~(IUPD|IACC|ICHG|IMOD);
+       ip->i_flag &= ~(IUPD | IACC | ICHG | IMOD);
        fs = ip->i_fs;
        /*
         * Ensure that uid and gid are correct. This is a temporary
        fs = ip->i_fs;
        /*
         * Ensure that uid and gid are correct. This is a temporary
index 36f39e7..741ef98 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)lfs_inode.c 8.1 (Berkeley) %G%
+ *     @(#)lfs_inode.c 8.2 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -55,8 +55,8 @@ int
 lfs_update(ap)
        struct vop_update_args /* {
                struct vnode *a_vp;
 lfs_update(ap)
        struct vop_update_args /* {
                struct vnode *a_vp;
-               struct timeval *a_ta;
-               struct timeval *a_tm;
+               struct timeval *a_access;
+               struct timeval *a_modify;
                int a_waitfor;
        } */ *ap;
 {
                int a_waitfor;
        } */ *ap;
 {
@@ -69,14 +69,14 @@ lfs_update(ap)
        if ((ip->i_flag & (IUPD | IACC | ICHG | IMOD)) == 0)
                return (0);
        if (ip->i_flag & IACC)
        if ((ip->i_flag & (IUPD | IACC | ICHG | IMOD)) == 0)
                return (0);
        if (ip->i_flag & IACC)
-               ip->i_atime.ts_sec = ap->a_ta->tv_sec;
+               ip->i_atime.ts_sec = ap->a_access->tv_sec;
        if (ip->i_flag & IUPD) {
        if (ip->i_flag & IUPD) {
-               ip->i_mtime.ts_sec = ap->a_tm->tv_sec;
+               ip->i_mtime.ts_sec = ap->a_modify->tv_sec;
                (ip)->i_modrev++;
        }
        if (ip->i_flag & ICHG)
                ip->i_ctime.ts_sec = time.tv_sec;
                (ip)->i_modrev++;
        }
        if (ip->i_flag & ICHG)
                ip->i_ctime.ts_sec = time.tv_sec;
-       ip->i_flag &= ~(IUPD|IACC|ICHG);
+       ip->i_flag &= ~(IUPD | IACC | ICHG);
 
        if (!(ip->i_flag & IMOD))
                ++(VFSTOUFS(vp->v_mount)->um_lfs->lfs_uinodes);
 
        if (!(ip->i_flag & IMOD))
                ++(VFSTOUFS(vp->v_mount)->um_lfs->lfs_uinodes);