diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-04-25 07:19:52 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-11-09 00:16:39 -0500 |
commit | 275555163e3ac09c016c964a10e0f389cf152c4c (patch) | |
tree | 184c807a11d1c171d41f46964ae0c09ff8ed4733 /fs/inode.c | |
parent | 375e289ea85166c5241c570940e7e7e966c63a9f (diff) |
vfs: don't use PARENT/CHILD lock classes for non-directories
Reserve I_MUTEX_PARENT and I_MUTEX_CHILD for locking of actual
directories.
(Also I_MUTEX_QUOTA isn't really a meaningful name for this locking
class any more; fixed in a later patch.)
Acked-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/inode.c')
-rw-r--r-- | fs/inode.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/inode.c b/fs/inode.c index ef25afdf3906..51f329b98aa4 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -951,16 +951,16 @@ void lock_two_nondirectories(struct inode *inode1, struct inode *inode2) | |||
951 | { | 951 | { |
952 | WARN_ON_ONCE(S_ISDIR(inode1->i_mode)); | 952 | WARN_ON_ONCE(S_ISDIR(inode1->i_mode)); |
953 | if (inode1 == inode2 || !inode2) { | 953 | if (inode1 == inode2 || !inode2) { |
954 | mutex_lock_nested(&inode1->i_mutex, I_MUTEX_PARENT); | 954 | mutex_lock(&inode1->i_mutex); |
955 | return; | 955 | return; |
956 | } | 956 | } |
957 | WARN_ON_ONCE(S_ISDIR(inode2->i_mode)); | 957 | WARN_ON_ONCE(S_ISDIR(inode2->i_mode)); |
958 | if (inode1 < inode2) { | 958 | if (inode1 < inode2) { |
959 | mutex_lock_nested(&inode1->i_mutex, I_MUTEX_PARENT); | 959 | mutex_lock(&inode1->i_mutex); |
960 | mutex_lock_nested(&inode2->i_mutex, I_MUTEX_CHILD); | 960 | mutex_lock_nested(&inode2->i_mutex, I_MUTEX_QUOTA); |
961 | } else { | 961 | } else { |
962 | mutex_lock_nested(&inode2->i_mutex, I_MUTEX_PARENT); | 962 | mutex_lock(&inode2->i_mutex); |
963 | mutex_lock_nested(&inode1->i_mutex, I_MUTEX_CHILD); | 963 | mutex_lock_nested(&inode1->i_mutex, I_MUTEX_QUOTA); |
964 | } | 964 | } |
965 | } | 965 | } |
966 | EXPORT_SYMBOL(lock_two_nondirectories); | 966 | EXPORT_SYMBOL(lock_two_nondirectories); |