diff options
author | J. Bruce Fields <bfields@redhat.com> | 2016-10-18 14:18:40 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2016-11-01 15:47:52 -0400 |
commit | 916d2d844afd09dc8cf144e0e9dc98daa9dfc34a (patch) | |
tree | 0a0a7c9d29d99e7c2595c7b89aaa697263592daa /fs/nfsd/nfsd.h | |
parent | 851238a22f3be7323feed6a62a6882c284b2f0a5 (diff) | |
download | op-kernel-dev-916d2d844afd09dc8cf144e0e9dc98daa9dfc34a.zip op-kernel-dev-916d2d844afd09dc8cf144e0e9dc98daa9dfc34a.tar.gz |
nfsd: clean up supported attribute handling
Minor cleanup, no change in behavior.
Provide helpers for some common attribute bitmap operations. Drop some
comments that just echo the code.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfsd.h')
-rw-r--r-- | fs/nfsd/nfsd.h | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h index 9446849..a72d416 100644 --- a/fs/nfsd/nfsd.h +++ b/fs/nfsd/nfsd.h @@ -361,25 +361,18 @@ void nfsd_lockd_shutdown(void); (NFSD4_1_SUPPORTED_ATTRS_WORD2 | \ NFSD4_2_SECURITY_ATTRS) -static inline u32 nfsd_suppattrs0(u32 minorversion) -{ - return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD0 - : NFSD4_SUPPORTED_ATTRS_WORD0; -} +extern u32 nfsd_suppattrs[3][3]; -static inline u32 nfsd_suppattrs1(u32 minorversion) +static inline bool bmval_is_subset(u32 *bm1, u32 *bm2) { - return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD1 - : NFSD4_SUPPORTED_ATTRS_WORD1; + return !((bm1[0] & ~bm2[0]) || + (bm1[1] & ~bm2[1]) || + (bm1[2] & ~bm2[2])); } -static inline u32 nfsd_suppattrs2(u32 minorversion) +static inline bool nfsd_attrs_supported(u32 minorversion, u32 *bmval) { - switch (minorversion) { - default: return NFSD4_2_SUPPORTED_ATTRS_WORD2; - case 1: return NFSD4_1_SUPPORTED_ATTRS_WORD2; - case 0: return NFSD4_SUPPORTED_ATTRS_WORD2; - } + return bmval_is_subset(bmval, nfsd_suppattrs[minorversion]); } /* These will return ERR_INVAL if specified in GETATTR or READDIR. */ |