summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfsd.h
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2016-10-18 14:18:40 -0400
committerJ. Bruce Fields <bfields@redhat.com>2016-11-01 15:47:52 -0400
commit916d2d844afd09dc8cf144e0e9dc98daa9dfc34a (patch)
tree0a0a7c9d29d99e7c2595c7b89aaa697263592daa /fs/nfsd/nfsd.h
parent851238a22f3be7323feed6a62a6882c284b2f0a5 (diff)
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.h21
1 files changed, 7 insertions, 14 deletions
diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h
index 9446849888d5..a72d4163273a 100644
--- a/fs/nfsd/nfsd.h
+++ b/fs/nfsd/nfsd.h
@@ -361,25 +361,18 @@ void nfsd_lockd_shutdown(void);
361 (NFSD4_1_SUPPORTED_ATTRS_WORD2 | \ 361 (NFSD4_1_SUPPORTED_ATTRS_WORD2 | \
362 NFSD4_2_SECURITY_ATTRS) 362 NFSD4_2_SECURITY_ATTRS)
363 363
364static inline u32 nfsd_suppattrs0(u32 minorversion) 364extern u32 nfsd_suppattrs[3][3];
365{
366 return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD0
367 : NFSD4_SUPPORTED_ATTRS_WORD0;
368}
369 365
370static inline u32 nfsd_suppattrs1(u32 minorversion) 366static inline bool bmval_is_subset(u32 *bm1, u32 *bm2)
371{ 367{
372 return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD1 368 return !((bm1[0] & ~bm2[0]) ||
373 : NFSD4_SUPPORTED_ATTRS_WORD1; 369 (bm1[1] & ~bm2[1]) ||
370 (bm1[2] & ~bm2[2]));
374} 371}
375 372
376static inline u32 nfsd_suppattrs2(u32 minorversion) 373static inline bool nfsd_attrs_supported(u32 minorversion, u32 *bmval)
377{ 374{
378 switch (minorversion) { 375 return bmval_is_subset(bmval, nfsd_suppattrs[minorversion]);
379 default: return NFSD4_2_SUPPORTED_ATTRS_WORD2;
380 case 1: return NFSD4_1_SUPPORTED_ATTRS_WORD2;
381 case 0: return NFSD4_SUPPORTED_ATTRS_WORD2;
382 }
383} 376}
384 377
385/* These will return ERR_INVAL if specified in GETATTR or READDIR. */ 378/* These will return ERR_INVAL if specified in GETATTR or READDIR. */