xfs_export.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright (c) 2005 Silicon Graphics, Inc.
  3. * All Rights Reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it would be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write the Free Software Foundation,
  16. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef __XFS_EXPORT_H__
  19. #define __XFS_EXPORT_H__
  20. /*
  21. * Common defines for code related to exporting XFS filesystems over NFS.
  22. *
  23. * The NFS fileid goes out on the wire as an array of
  24. * 32bit unsigned ints in host order. There are 5 possible
  25. * formats.
  26. *
  27. * (1) fileid_type=0x00
  28. * (no fileid data; handled by the generic code)
  29. *
  30. * (2) fileid_type=0x01
  31. * inode-num
  32. * generation
  33. *
  34. * (3) fileid_type=0x02
  35. * inode-num
  36. * generation
  37. * parent-inode-num
  38. * parent-generation
  39. *
  40. * (4) fileid_type=0x81
  41. * inode-num-lo32
  42. * inode-num-hi32
  43. * generation
  44. *
  45. * (5) fileid_type=0x82
  46. * inode-num-lo32
  47. * inode-num-hi32
  48. * generation
  49. * parent-inode-num-lo32
  50. * parent-inode-num-hi32
  51. * parent-generation
  52. *
  53. * Note, the NFS filehandle also includes an fsid portion which
  54. * may have an inode number in it. That number is hardcoded to
  55. * 32bits and there is no way for XFS to intercept it. In
  56. * practice this means when exporting an XFS filesystem with 64bit
  57. * inodes you should either export the mountpoint (rather than
  58. * a subdirectory) or use the "fsid" export option.
  59. */
  60. struct xfs_fid64 {
  61. u64 ino;
  62. u32 gen;
  63. u64 parent_ino;
  64. u32 parent_gen;
  65. } __attribute__((packed));
  66. /* This flag goes on the wire. Don't play with it. */
  67. #define XFS_FILEID_TYPE_64FLAG 0x80 /* NFS fileid has 64bit inodes */
  68. #endif /* __XFS_EXPORT_H__ */