blocklayoutxdr.h 1021 B

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