diff options
author | David Chinner <dgc@sgi.com> | 2007-06-29 03:26:09 -0400 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-07-14 04:09:42 -0400 |
commit | 0f1145cc18e970ebe37da114fc34c297f135e062 (patch) | |
tree | eb6c8b1b1a53d24eed981910422f0ec3066333fe | |
parent | d7f0923d83dcabfc063257a281529cdbcd5eedb5 (diff) |
[XFS] Fix lockdep annotations for xfs_lock_inodes
SGI-PV: 967035
SGI-Modid: xfs-linux-melb:xfs-kern:29026a
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
-rw-r--r-- | fs/xfs/xfs_inode.h | 15 | ||||
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 4 |
2 files changed, 11 insertions, 8 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index d418eeed4ebd..012dfd4a958c 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h | |||
@@ -415,19 +415,22 @@ xfs_iflags_test(xfs_inode_t *ip, unsigned short flags) | |||
415 | * gets a lockdep subclass of 1 and the second lock will have a lockdep | 415 | * gets a lockdep subclass of 1 and the second lock will have a lockdep |
416 | * subclass of 0. | 416 | * subclass of 0. |
417 | * | 417 | * |
418 | * XFS_I[O]LOCK_INUMORDER - for locking several inodes at the some time | 418 | * XFS_LOCK_INUMORDER - for locking several inodes at the some time |
419 | * with xfs_lock_inodes(). This flag is used as the starting subclass | 419 | * with xfs_lock_inodes(). This flag is used as the starting subclass |
420 | * and each subsequent lock acquired will increment the subclass by one. | 420 | * and each subsequent lock acquired will increment the subclass by one. |
421 | * So the first lock acquired will have a lockdep subclass of 2, the | 421 | * So the first lock acquired will have a lockdep subclass of 2, the |
422 | * second lock will have a lockdep subclass of 3, and so on. | 422 | * second lock will have a lockdep subclass of 3, and so on. It is |
423 | * the responsibility of the class builder to shift this to the correct | ||
424 | * portion of the lock_mode lockdep mask. | ||
423 | */ | 425 | */ |
426 | #define XFS_LOCK_PARENT 1 | ||
427 | #define XFS_LOCK_INUMORDER 2 | ||
428 | |||
424 | #define XFS_IOLOCK_SHIFT 16 | 429 | #define XFS_IOLOCK_SHIFT 16 |
425 | #define XFS_IOLOCK_PARENT (1 << XFS_IOLOCK_SHIFT) | 430 | #define XFS_IOLOCK_PARENT (XFS_LOCK_PARENT << XFS_IOLOCK_SHIFT) |
426 | #define XFS_IOLOCK_INUMORDER (2 << XFS_IOLOCK_SHIFT) | ||
427 | 431 | ||
428 | #define XFS_ILOCK_SHIFT 24 | 432 | #define XFS_ILOCK_SHIFT 24 |
429 | #define XFS_ILOCK_PARENT (1 << XFS_ILOCK_SHIFT) | 433 | #define XFS_ILOCK_PARENT (XFS_LOCK_PARENT << XFS_ILOCK_SHIFT) |
430 | #define XFS_ILOCK_INUMORDER (2 << XFS_ILOCK_SHIFT) | ||
431 | 434 | ||
432 | #define XFS_IOLOCK_DEP_MASK 0x00ff0000 | 435 | #define XFS_IOLOCK_DEP_MASK 0x00ff0000 |
433 | #define XFS_ILOCK_DEP_MASK 0xff000000 | 436 | #define XFS_ILOCK_DEP_MASK 0xff000000 |
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 60fd0be90a16..79b522779aa4 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -2224,9 +2224,9 @@ static inline int | |||
2224 | xfs_lock_inumorder(int lock_mode, int subclass) | 2224 | xfs_lock_inumorder(int lock_mode, int subclass) |
2225 | { | 2225 | { |
2226 | if (lock_mode & (XFS_IOLOCK_SHARED|XFS_IOLOCK_EXCL)) | 2226 | if (lock_mode & (XFS_IOLOCK_SHARED|XFS_IOLOCK_EXCL)) |
2227 | lock_mode |= (subclass + XFS_IOLOCK_INUMORDER) << XFS_IOLOCK_SHIFT; | 2227 | lock_mode |= (subclass + XFS_LOCK_INUMORDER) << XFS_IOLOCK_SHIFT; |
2228 | if (lock_mode & (XFS_ILOCK_SHARED|XFS_ILOCK_EXCL)) | 2228 | if (lock_mode & (XFS_ILOCK_SHARED|XFS_ILOCK_EXCL)) |
2229 | lock_mode |= (subclass + XFS_ILOCK_INUMORDER) << XFS_ILOCK_SHIFT; | 2229 | lock_mode |= (subclass + XFS_LOCK_INUMORDER) << XFS_ILOCK_SHIFT; |
2230 | 2230 | ||
2231 | return lock_mode; | 2231 | return lock_mode; |
2232 | } | 2232 | } |