Diff for /xfs-linux/xfs_vnodeops.c between versions 1.694 and 1.695

version 1.694, 2007/04/03 03:54:05 version 1.695, 2007/04/27 15:48:42
Line 1947  xfs_create( Line 1947  xfs_create(
                 goto error_return;                  goto error_return;
         }          }
   
         xfs_ilock(dp, XFS_ILOCK_EXCL);          xfs_ilock(dp, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT);
   
         XFS_BMAP_INIT(&free_list, &first_block);          XFS_BMAP_INIT(&free_list, &first_block);
   
Line 2141  xfs_lock_dir_and_entry( Line 2141  xfs_lock_dir_and_entry(
         attempts = 0;          attempts = 0;
   
 again:  again:
         xfs_ilock(dp, XFS_ILOCK_EXCL);          xfs_ilock(dp, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT);
   
         e_inum = ip->i_ino;          e_inum = ip->i_ino;
   
Line 2210  int xfs_lock_delays; Line 2210  int xfs_lock_delays;
 #endif  #endif
   
 /*  /*
    * Bump the subclass so xfs_lock_inodes() acquires each lock with
    * a different value
    */
   static inline int
   xfs_lock_inumorder(int lock_mode, int subclass)
   {
           if (lock_mode & (XFS_IOLOCK_SHARED|XFS_IOLOCK_EXCL))
                   lock_mode |= (subclass + XFS_IOLOCK_INUMORDER) << XFS_IOLOCK_SHIFT;
           if (lock_mode & (XFS_ILOCK_SHARED|XFS_ILOCK_EXCL))
                   lock_mode |= (subclass + XFS_ILOCK_INUMORDER) << XFS_ILOCK_SHIFT;
   
           return lock_mode;
   }
   
   /*
  * The following routine will lock n inodes in exclusive mode.   * The following routine will lock n inodes in exclusive mode.
  * We assume the caller calls us with the inodes in i_ino order.   * We assume the caller calls us with the inodes in i_ino order.
  *   *
Line 2276  again: Line 2291  again:
                          * that is in the AIL.                           * that is in the AIL.
                          */                           */
                         ASSERT(i != 0);                          ASSERT(i != 0);
                         if (!xfs_ilock_nowait(ips[i], lock_mode)) {                          if (!xfs_ilock_nowait(ips[i], xfs_lock_inumorder(lock_mode, i))) {
                                 attempts++;                                  attempts++;
   
                                 /*                                  /*
Line 2311  again: Line 2326  again:
                                 goto again;                                  goto again;
                         }                          }
                 } else {                  } else {
                         xfs_ilock(ips[i], lock_mode);                          xfs_ilock(ips[i], xfs_lock_inumorder(lock_mode, i));
                 }                  }
         }          }
   
Line 2845  xfs_mkdir( Line 2860  xfs_mkdir(
                 goto error_return;                  goto error_return;
         }          }
   
         xfs_ilock(dp, XFS_ILOCK_EXCL);          xfs_ilock(dp, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT);
   
         /*          /*
          * Check for directory link count overflow.           * Check for directory link count overflow.
Line 3399  xfs_symlink( Line 3414  xfs_symlink(
                 goto error_return;                  goto error_return;
         }          }
   
         xfs_ilock(dp, XFS_ILOCK_EXCL);          xfs_ilock(dp, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT);
   
         /*          /*
          * Check whether the directory allows new symlinks or not.           * Check whether the directory allows new symlinks or not.

Removed from v.1.694  
changed lines
  Added in v.1.695


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>