]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
pnfs: move common blocklayout XDR defintions to nfs4.h
authorChristoph Hellwig <hch@lst.de>
Mon, 17 Aug 2015 16:41:01 +0000 (18:41 +0200)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Mon, 17 Aug 2015 18:22:49 +0000 (13:22 -0500)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/blocklayout/blocklayout.h
fs/nfs/blocklayout/extent_tree.c
fs/nfsd/blocklayoutxdr.c
fs/nfsd/blocklayoutxdr.h
include/linux/nfs4.h

index 92dca9e90d8dab527d3b5d3b6891981aeb77de11..c556640dcf3bad183659eaac9ac935ca17d30114 100644 (file)
 
 struct pnfs_block_dev;
 
-enum pnfs_block_volume_type {
-       PNFS_BLOCK_VOLUME_SIMPLE        = 0,
-       PNFS_BLOCK_VOLUME_SLICE         = 1,
-       PNFS_BLOCK_VOLUME_CONCAT        = 2,
-       PNFS_BLOCK_VOLUME_STRIPE        = 3,
-};
-
 #define PNFS_BLOCK_MAX_UUIDS   4
 #define PNFS_BLOCK_MAX_DEVICES 64
 
@@ -117,13 +110,6 @@ struct pnfs_block_dev {
                        struct pnfs_block_dev_map *map);
 };
 
-enum exstate4 {
-       PNFS_BLOCK_READWRITE_DATA       = 0,
-       PNFS_BLOCK_READ_DATA            = 1,
-       PNFS_BLOCK_INVALID_DATA         = 2, /* mapped, but data is invalid */
-       PNFS_BLOCK_NONE_DATA            = 3  /* unmapped, it's a hole */
-};
-
 /* sector_t fields are all in 512-byte sectors */
 struct pnfs_block_extent {
        union {
@@ -134,15 +120,12 @@ struct pnfs_block_extent {
        sector_t        be_f_offset;    /* the starting offset in the file */
        sector_t        be_length;      /* the size of the extent */
        sector_t        be_v_offset;    /* the starting offset in the volume */
-       enum exstate4   be_state;       /* the state of this extent */
+       enum pnfs_block_extent_state be_state;  /* the state of this extent */
 #define EXTENT_WRITTEN         1
 #define EXTENT_COMMITTING      2
        unsigned int    be_tag;
 };
 
-/* on the wire size of the extent */
-#define BL_EXTENT_SIZE (7 * sizeof(__be32) + NFS4_DEVICEID4_SIZE)
-
 struct pnfs_block_layout {
        struct pnfs_layout_hdr  bl_layout;
        struct rb_root          bl_ext_rw;
index a11b759d294a9c799c81080a85abe6a35310d8f3..c59a59c37f3dabae1211db9efcb963442c013b36 100644 (file)
@@ -465,7 +465,7 @@ out:
 static size_t ext_tree_layoutupdate_size(size_t count)
 {
        return sizeof(__be32) /* number of entries */ +
-               BL_EXTENT_SIZE * count;
+               PNFS_BLOCK_EXTENT_SIZE * count;
 }
 
 static void ext_tree_free_commitdata(struct nfs4_layoutcommit_args *arg,
index 9aa2796da90d9169488a625d5f80e90010971ff4..6d834dc9bbc826bf8b711fb4adfaf58c82ae5c48 100644 (file)
@@ -101,7 +101,7 @@ nfsd4_block_decode_layoutupdate(__be32 *p, u32 len, struct iomap **iomapp,
        }
 
        nr_iomaps = be32_to_cpup(p++);
-       expected = sizeof(__be32) + nr_iomaps * NFS4_BLOCK_EXTENT_SIZE;
+       expected = sizeof(__be32) + nr_iomaps * PNFS_BLOCK_EXTENT_SIZE;
        if (len != expected) {
                dprintk("%s: extent array size mismatch: %u/%u\n",
                        __func__, len, expected);
index fdc79037c0e78108dd7d359e2d539fccbeffccff..6de925fe84991d09081dce75db8c8cd4ba12dded 100644 (file)
@@ -7,13 +7,6 @@
 struct iomap;
 struct xdr_stream;
 
-enum pnfs_block_extent_state {
-       PNFS_BLOCK_READWRITE_DATA       = 0,
-       PNFS_BLOCK_READ_DATA            = 1,
-       PNFS_BLOCK_INVALID_DATA         = 2,
-       PNFS_BLOCK_NONE_DATA            = 3,
-};
-
 struct pnfs_block_extent {
        struct nfsd4_deviceid           vol_id;
        u64                             foff;
@@ -21,14 +14,6 @@ struct pnfs_block_extent {
        u64                             soff;
        enum pnfs_block_extent_state    es;
 };
-#define NFS4_BLOCK_EXTENT_SIZE         44
-
-enum pnfs_block_volume_type {
-       PNFS_BLOCK_VOLUME_SIMPLE        = 0,
-       PNFS_BLOCK_VOLUME_SLICE         = 1,
-       PNFS_BLOCK_VOLUME_CONCAT        = 2,
-       PNFS_BLOCK_VOLUME_STRIPE        = 3,
-};
 
 /*
  * Random upper cap for the uuid length to avoid unbounded allocation.
index b8e72aad919cfc72ea6710ac3786dc35bbe47201..00121f298269590cabc12ce7924f61d8e8742e07 100644 (file)
@@ -547,6 +547,24 @@ enum pnfs_notify_deviceid_type4 {
        NOTIFY_DEVICEID4_DELETE = 1 << 2,
 };
 
+enum pnfs_block_volume_type {
+       PNFS_BLOCK_VOLUME_SIMPLE        = 0,
+       PNFS_BLOCK_VOLUME_SLICE         = 1,
+       PNFS_BLOCK_VOLUME_CONCAT        = 2,
+       PNFS_BLOCK_VOLUME_STRIPE        = 3,
+};
+
+enum pnfs_block_extent_state {
+       PNFS_BLOCK_READWRITE_DATA       = 0,
+       PNFS_BLOCK_READ_DATA            = 1,
+       PNFS_BLOCK_INVALID_DATA         = 2,
+       PNFS_BLOCK_NONE_DATA            = 3,
+};
+
+/* on the wire size of a block layout extent */
+#define PNFS_BLOCK_EXTENT_SIZE \
+       (7 * sizeof(__be32) + NFS4_DEVICEID4_SIZE)
+
 #define NFL4_UFLG_MASK                 0x0000003F
 #define NFL4_UFLG_DENSE                        0x00000001
 #define NFL4_UFLG_COMMIT_THRU_MDS      0x00000002