registerized vnodeop ops after vnode interface conversion
[unix-history] / usr / src / sys / ufs / ffs / ffs_balloc.c
index 7b65df7..aba8f81 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)ffs_balloc.c        7.20 (Berkeley) %G%
+ *     @(#)ffs_balloc.c        7.21 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -32,6 +32,7 @@ int
 ffs_bmap (ap)
        struct vop_bmap_args *ap;
 {
 ffs_bmap (ap)
        struct vop_bmap_args *ap;
 {
+       register daddr_t bn = ap->a_bn;
        register struct inode *ip;
        register struct fs *fs;
        register daddr_t nb;
        register struct inode *ip;
        register struct fs *fs;
        register daddr_t nb;
@@ -49,15 +50,15 @@ ffs_bmap (ap)
                *ap->a_vpp = ip->i_devvp;
        if (ap->a_bnp == NULL)
                return (0);
                *ap->a_vpp = ip->i_devvp;
        if (ap->a_bnp == NULL)
                return (0);
-       if (ap->a_bn < 0)
+       if (bn < 0)
                return (EFBIG);
        fs = ip->i_fs;
 
        /*
         * The first NDADDR blocks are direct blocks
         */
                return (EFBIG);
        fs = ip->i_fs;
 
        /*
         * The first NDADDR blocks are direct blocks
         */
-       if (ap->a_bn < NDADDR) {
-               nb = ip->i_db[ap->a_bn];
+       if (bn < NDADDR) {
+               nb = ip->i_db[bn];
                if (nb == 0) {
                        *ap->a_bnp = (daddr_t)-1;
                        return (0);
                if (nb == 0) {
                        *ap->a_bnp = (daddr_t)-1;
                        return (0);
@@ -69,12 +70,12 @@ ffs_bmap (ap)
         * Determine the number of levels of indirection.
         */
        sh = 1;
         * Determine the number of levels of indirection.
         */
        sh = 1;
-       ap->a_bn -= NDADDR;
+       bn -= NDADDR;
        for (j = NIADDR; j > 0; j--) {
                sh *= NINDIR(fs);
        for (j = NIADDR; j > 0; j--) {
                sh *= NINDIR(fs);
-               if (ap->a_bn < sh)
+               if (bn < sh)
                        break;
                        break;
-               ap->a_bn -= sh;
+               bn -= sh;
        }
        if (j == 0)
                return (EFBIG);
        }
        if (j == 0)
                return (EFBIG);
@@ -94,7 +95,7 @@ ffs_bmap (ap)
                }
                bap = bp->b_un.b_daddr;
                sh /= NINDIR(fs);
                }
                bap = bp->b_un.b_daddr;
                sh /= NINDIR(fs);
-               i = (ap->a_bn / sh) % NINDIR(fs);
+               i = (bn / sh) % NINDIR(fs);
                nb = bap[i];
                if (nb == 0) {
                        *ap->a_bnp = (daddr_t)-1;
                nb = bap[i];
                if (nb == 0) {
                        *ap->a_bnp = (daddr_t)-1;