Christoph Hellwig | 8650b8a | 2015-01-21 11:40:00 +0100 | [diff] [blame] | 1 | #ifndef _NFSD_BLOCKLAYOUTXDR_H |
| 2 | #define _NFSD_BLOCKLAYOUTXDR_H 1 |
| 3 | |
| 4 | #include <linux/blkdev.h> |
| 5 | #include "xdr4.h" |
| 6 | |
| 7 | struct iomap; |
| 8 | struct xdr_stream; |
| 9 | |
Christoph Hellwig | 8650b8a | 2015-01-21 11:40:00 +0100 | [diff] [blame] | 10 | struct pnfs_block_extent { |
| 11 | struct nfsd4_deviceid vol_id; |
| 12 | u64 foff; |
| 13 | u64 len; |
| 14 | u64 soff; |
| 15 | enum pnfs_block_extent_state es; |
| 16 | }; |
Christoph Hellwig | 8650b8a | 2015-01-21 11:40:00 +0100 | [diff] [blame] | 17 | |
| 18 | /* |
| 19 | * Random upper cap for the uuid length to avoid unbounded allocation. |
| 20 | * Not actually limited by the protocol. |
| 21 | */ |
| 22 | #define PNFS_BLOCK_UUID_LEN 128 |
| 23 | |
| 24 | struct pnfs_block_volume { |
| 25 | enum pnfs_block_volume_type type; |
| 26 | union { |
| 27 | struct { |
| 28 | u64 offset; |
| 29 | u32 sig_len; |
| 30 | u8 sig[PNFS_BLOCK_UUID_LEN]; |
| 31 | } simple; |
| 32 | }; |
| 33 | }; |
| 34 | |
| 35 | struct pnfs_block_deviceaddr { |
| 36 | u32 nr_volumes; |
| 37 | struct pnfs_block_volume volumes[]; |
| 38 | }; |
| 39 | |
| 40 | __be32 nfsd4_block_encode_getdeviceinfo(struct xdr_stream *xdr, |
| 41 | struct nfsd4_getdeviceinfo *gdp); |
| 42 | __be32 nfsd4_block_encode_layoutget(struct xdr_stream *xdr, |
| 43 | struct nfsd4_layoutget *lgp); |
| 44 | int nfsd4_block_decode_layoutupdate(__be32 *p, u32 len, struct iomap **iomapp, |
| 45 | u32 block_size); |
| 46 | |
| 47 | #endif /* _NFSD_BLOCKLAYOUTXDR_H */ |