nfs/nfsd: Move useful bitfield ops to a commonly accessible place
authorAndrew Elble <aweits@rit.edu>
Wed, 15 Jun 2016 16:52:07 +0000 (12:52 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 13 Jul 2016 19:32:47 +0000 (15:32 -0400)
So these may be used in nfsd as well

Signed-off-by: Andrew Elble <aweits@rit.edu>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
include/linux/nfs4.h
include/linux/nfs_xdr.h

index bfed6b367350cdd34fe4e87598ec5cb94aac60f8..c6564ada9bebb8ea0787e60fc8cea3b46d09433c 100644 (file)
@@ -643,4 +643,15 @@ enum pnfs_update_layout_reason {
        PNFS_UPDATE_LAYOUT_SEND_LAYOUTGET,
 };
 
+#define NFS4_OP_MAP_NUM_LONGS                                  \
+       DIV_ROUND_UP(LAST_NFS4_OP, 8 * sizeof(unsigned long))
+#define NFS4_OP_MAP_NUM_WORDS \
+       (NFS4_OP_MAP_NUM_LONGS * sizeof(unsigned long) / sizeof(u32))
+struct nfs4_op_map {
+       union {
+               unsigned long longs[NFS4_OP_MAP_NUM_LONGS];
+               u32 words[NFS4_OP_MAP_NUM_WORDS];
+       } u;
+};
+
 #endif
index c304a11b5b1aae93d5bb5a18ad995534f157b028..e66abc2d1f88bb1dab1e9b80db98097da90c8302 100644 (file)
@@ -1185,17 +1185,6 @@ struct pnfs_ds_commit_info {
        struct pnfs_commit_bucket *buckets;
 };
 
-#define NFS4_OP_MAP_NUM_LONGS \
-       DIV_ROUND_UP(LAST_NFS4_OP, 8 * sizeof(unsigned long))
-#define NFS4_OP_MAP_NUM_WORDS \
-       (NFS4_OP_MAP_NUM_LONGS * sizeof(unsigned long) / sizeof(u32))
-struct nfs4_op_map {
-       union {
-               unsigned long longs[NFS4_OP_MAP_NUM_LONGS];
-               u32 words[NFS4_OP_MAP_NUM_WORDS];
-       } u;
-};
-
 struct nfs41_state_protection {
        u32 how;
        struct nfs4_op_map enforce;