diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-10-01 17:41:11 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2007-10-09 18:32:46 -0400 |
commit | a16877ca9cec211708a161057a7cbfbf2cbc3a53 (patch) | |
tree | a114bfe588af58047b1eb2aa1f57ac4b890c01a6 /fs/nfsd | |
parent | 98257af5a2ad0c5b502ebd07094d9fd8ce87acef (diff) |
Cleanup macros for distinguishing mandatory locks
The combination of S_ISGID bit set and S_IXGRP bit unset is used to mark the
inode as "mandatory lockable" and there's a macro for this check called
MANDATORY_LOCK(inode). However, fs/locks.c and some filesystems still perform
the explicit i_mode checking. Besides, Andrew pointed out, that this macro is
buggy itself, as it dereferences the inode arg twice.
Convert this macro into static inline function and switch its users to it,
making the code shorter and more readable.
The __mandatory_lock() helper is to be used in places where the IS_MANDLOCK()
for superblock is already known to be true.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Ron Minnich <rminnich@sandia.gov>
Cc: Latchesar Ionkov <lucho@ionkov.net>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4state.c | 2 | ||||
-rw-r--r-- | fs/nfsd/vfs.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 3f559700788f..3c028b9c6e0e 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -2044,7 +2044,7 @@ static inline int | |||
2044 | io_during_grace_disallowed(struct inode *inode, int flags) | 2044 | io_during_grace_disallowed(struct inode *inode, int flags) |
2045 | { | 2045 | { |
2046 | return nfs4_in_grace() && (flags & (RD_STATE | WR_STATE)) | 2046 | return nfs4_in_grace() && (flags & (RD_STATE | WR_STATE)) |
2047 | && MANDATORY_LOCK(inode); | 2047 | && mandatory_lock(inode); |
2048 | } | 2048 | } |
2049 | 2049 | ||
2050 | /* | 2050 | /* |
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 7867151ebb83..9152f87eea18 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -65,7 +65,7 @@ | |||
65 | * locks on them because there is no way to know if the accesser has | 65 | * locks on them because there is no way to know if the accesser has |
66 | * the lock. | 66 | * the lock. |
67 | */ | 67 | */ |
68 | #define IS_ISMNDLK(i) (S_ISREG((i)->i_mode) && MANDATORY_LOCK(i)) | 68 | #define IS_ISMNDLK(i) (S_ISREG((i)->i_mode) && mandatory_lock(i)) |
69 | 69 | ||
70 | /* | 70 | /* |
71 | * This is a cache of readahead params that help us choose the proper | 71 | * This is a cache of readahead params that help us choose the proper |