+/* add NFSv4 attr bitmap masked with the supported attributes for this mount/node */
+#define nfsm_chain_add_bitmap_supported(E, NMC, B, NMP, NP) \
+ do { \
+ uint32_t __bitmap[NFS_ATTR_BITMAP_LEN], *__bmp = (B); \
+ int __nonamedattr = 0, __noacl = 0, __nomode = 0; \
+ if (!((NMP)->nm_fsattr.nfsa_flags & NFS_FSFLAG_NAMED_ATTR) || \
+ ((NP) && (((nfsnode_t)(NP))->n_flag & (NISDOTZFS|NISDOTZFSCHILD)))) \
+ __nonamedattr = 1; \
+ if (!((NMP)->nm_fsattr.nfsa_flags & NFS_FSFLAG_ACL)) \
+ __noacl = 1; \
+ if (NMFLAG((NMP), ACLONLY)) \
+ __nomode = 1; \
+ if (__nonamedattr || __noacl || __nomode) { \
+ /* don't ask for attrs we're not supporting */ \
+ /* some ".zfs" directories can't handle being asked for some attributes */ \
+ int __ii; \
+ NFS_CLEAR_ATTRIBUTES(__bitmap); \
+ for (__ii=0; __ii < NFS_ATTR_BITMAP_LEN; __ii++) \
+ __bitmap[__ii] = (B)[__ii]; \
+ if (__nonamedattr) \
+ NFS_BITMAP_CLR(__bitmap, NFS_FATTR_NAMED_ATTR); \
+ if (__noacl) \
+ NFS_BITMAP_CLR(__bitmap, NFS_FATTR_ACL); \
+ if (__nomode) \
+ NFS_BITMAP_CLR(__bitmap, NFS_FATTR_MODE); \
+ __bmp = __bitmap; \
+ } \
+ nfsm_chain_add_bitmap_masked((E), (NMC), __bmp, NFS_ATTR_BITMAP_LEN, (NMP)->nm_fsattr.nfsa_supp_attr); \
+ } while (0)
+