Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pnfs: move common blocklayout XDR defintions to nfs4.h

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>

authored by

Christoph Hellwig and committed by
Trond Myklebust
8bb28975 513d6d7a

+21 -35
+1 -18
fs/nfs/blocklayout/blocklayout.h
··· 46 46 47 47 struct pnfs_block_dev; 48 48 49 - enum pnfs_block_volume_type { 50 - PNFS_BLOCK_VOLUME_SIMPLE = 0, 51 - PNFS_BLOCK_VOLUME_SLICE = 1, 52 - PNFS_BLOCK_VOLUME_CONCAT = 2, 53 - PNFS_BLOCK_VOLUME_STRIPE = 3, 54 - }; 55 - 56 49 #define PNFS_BLOCK_MAX_UUIDS 4 57 50 #define PNFS_BLOCK_MAX_DEVICES 64 58 51 ··· 110 117 struct pnfs_block_dev_map *map); 111 118 }; 112 119 113 - enum exstate4 { 114 - PNFS_BLOCK_READWRITE_DATA = 0, 115 - PNFS_BLOCK_READ_DATA = 1, 116 - PNFS_BLOCK_INVALID_DATA = 2, /* mapped, but data is invalid */ 117 - PNFS_BLOCK_NONE_DATA = 3 /* unmapped, it's a hole */ 118 - }; 119 - 120 120 /* sector_t fields are all in 512-byte sectors */ 121 121 struct pnfs_block_extent { 122 122 union { ··· 120 134 sector_t be_f_offset; /* the starting offset in the file */ 121 135 sector_t be_length; /* the size of the extent */ 122 136 sector_t be_v_offset; /* the starting offset in the volume */ 123 - enum exstate4 be_state; /* the state of this extent */ 137 + enum pnfs_block_extent_state be_state; /* the state of this extent */ 124 138 #define EXTENT_WRITTEN 1 125 139 #define EXTENT_COMMITTING 2 126 140 unsigned int be_tag; 127 141 }; 128 - 129 - /* on the wire size of the extent */ 130 - #define BL_EXTENT_SIZE (7 * sizeof(__be32) + NFS4_DEVICEID4_SIZE) 131 142 132 143 struct pnfs_block_layout { 133 144 struct pnfs_layout_hdr bl_layout;
+1 -1
fs/nfs/blocklayout/extent_tree.c
··· 465 465 static size_t ext_tree_layoutupdate_size(size_t count) 466 466 { 467 467 return sizeof(__be32) /* number of entries */ + 468 - BL_EXTENT_SIZE * count; 468 + PNFS_BLOCK_EXTENT_SIZE * count; 469 469 } 470 470 471 471 static void ext_tree_free_commitdata(struct nfs4_layoutcommit_args *arg,
+1 -1
fs/nfsd/blocklayoutxdr.c
··· 101 101 } 102 102 103 103 nr_iomaps = be32_to_cpup(p++); 104 - expected = sizeof(__be32) + nr_iomaps * NFS4_BLOCK_EXTENT_SIZE; 104 + expected = sizeof(__be32) + nr_iomaps * PNFS_BLOCK_EXTENT_SIZE; 105 105 if (len != expected) { 106 106 dprintk("%s: extent array size mismatch: %u/%u\n", 107 107 __func__, len, expected);
-15
fs/nfsd/blocklayoutxdr.h
··· 7 7 struct iomap; 8 8 struct xdr_stream; 9 9 10 - enum pnfs_block_extent_state { 11 - PNFS_BLOCK_READWRITE_DATA = 0, 12 - PNFS_BLOCK_READ_DATA = 1, 13 - PNFS_BLOCK_INVALID_DATA = 2, 14 - PNFS_BLOCK_NONE_DATA = 3, 15 - }; 16 - 17 10 struct pnfs_block_extent { 18 11 struct nfsd4_deviceid vol_id; 19 12 u64 foff; 20 13 u64 len; 21 14 u64 soff; 22 15 enum pnfs_block_extent_state es; 23 - }; 24 - #define NFS4_BLOCK_EXTENT_SIZE 44 25 - 26 - enum pnfs_block_volume_type { 27 - PNFS_BLOCK_VOLUME_SIMPLE = 0, 28 - PNFS_BLOCK_VOLUME_SLICE = 1, 29 - PNFS_BLOCK_VOLUME_CONCAT = 2, 30 - PNFS_BLOCK_VOLUME_STRIPE = 3, 31 16 }; 32 17 33 18 /*
+18
include/linux/nfs4.h
··· 547 547 NOTIFY_DEVICEID4_DELETE = 1 << 2, 548 548 }; 549 549 550 + enum pnfs_block_volume_type { 551 + PNFS_BLOCK_VOLUME_SIMPLE = 0, 552 + PNFS_BLOCK_VOLUME_SLICE = 1, 553 + PNFS_BLOCK_VOLUME_CONCAT = 2, 554 + PNFS_BLOCK_VOLUME_STRIPE = 3, 555 + }; 556 + 557 + enum pnfs_block_extent_state { 558 + PNFS_BLOCK_READWRITE_DATA = 0, 559 + PNFS_BLOCK_READ_DATA = 1, 560 + PNFS_BLOCK_INVALID_DATA = 2, 561 + PNFS_BLOCK_NONE_DATA = 3, 562 + }; 563 + 564 + /* on the wire size of a block layout extent */ 565 + #define PNFS_BLOCK_EXTENT_SIZE \ 566 + (7 * sizeof(__be32) + NFS4_DEVICEID4_SIZE) 567 + 550 568 #define NFL4_UFLG_MASK 0x0000003F 551 569 #define NFL4_UFLG_DENSE 0x00000001 552 570 #define NFL4_UFLG_COMMIT_THRU_MDS 0x00000002