xfs_export.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Copyright (c) 2005 Silicon Graphics, Inc.
  4. * All Rights Reserved.
  5. */
  6. #ifndef __XFS_EXPORT_H__
  7. #define __XFS_EXPORT_H__
  8. /*
  9. * Common defines for code related to exporting XFS filesystems over NFS.
  10. *
  11. * The NFS fileid goes out on the wire as an array of
  12. * 32bit unsigned ints in host order. There are 5 possible
  13. * formats.
  14. *
  15. * (1) fileid_type=0x00
  16. * (no fileid data; handled by the generic code)
  17. *
  18. * (2) fileid_type=0x01
  19. * inode-num
  20. * generation
  21. *
  22. * (3) fileid_type=0x02
  23. * inode-num
  24. * generation
  25. * parent-inode-num
  26. * parent-generation
  27. *
  28. * (4) fileid_type=0x81
  29. * inode-num-lo32
  30. * inode-num-hi32
  31. * generation
  32. *
  33. * (5) fileid_type=0x82
  34. * inode-num-lo32
  35. * inode-num-hi32
  36. * generation
  37. * parent-inode-num-lo32
  38. * parent-inode-num-hi32
  39. * parent-generation
  40. *
  41. * Note, the NFS filehandle also includes an fsid portion which
  42. * may have an inode number in it. That number is hardcoded to
  43. * 32bits and there is no way for XFS to intercept it. In
  44. * practice this means when exporting an XFS filesystem with 64bit
  45. * inodes you should either export the mountpoint (rather than
  46. * a subdirectory) or use the "fsid" export option.
  47. */
  48. struct xfs_fid64 {
  49. u64 ino;
  50. u32 gen;
  51. u64 parent_ino;
  52. u32 parent_gen;
  53. } __attribute__((packed));
  54. /* This flag goes on the wire. Don't play with it. */
  55. #define XFS_FILEID_TYPE_64FLAG 0x80 /* NFS fileid has 64bit inodes */
  56. #endif /* __XFS_EXPORT_H__ */