logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

ext4.h (4122B)


  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _LINUX_EXT4_H
  3. #define _LINUX_EXT4_H
  4. #include <linux/fiemap.h>
  5. #include <linux/fs.h>
  6. #include <linux/ioctl.h>
  7. #include <linux/types.h>
  8. /*
  9. * ext4-specific ioctl commands
  10. */
  11. #define EXT4_IOC_GETVERSION _IOR('f', 3, long)
  12. #define EXT4_IOC_SETVERSION _IOW('f', 4, long)
  13. #define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION
  14. #define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION
  15. #define EXT4_IOC_GETRSVSZ _IOR('f', 5, long)
  16. #define EXT4_IOC_SETRSVSZ _IOW('f', 6, long)
  17. #define EXT4_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long)
  18. #define EXT4_IOC_GROUP_ADD _IOW('f', 8, struct ext4_new_group_input)
  19. #define EXT4_IOC_MIGRATE _IO('f', 9)
  20. /* note ioctl 10 reserved for an early version of the FIEMAP ioctl */
  21. /* note ioctl 11 reserved for filesystem-independent FIEMAP ioctl */
  22. #define EXT4_IOC_ALLOC_DA_BLKS _IO('f', 12)
  23. #define EXT4_IOC_MOVE_EXT _IOWR('f', 15, struct move_extent)
  24. #define EXT4_IOC_RESIZE_FS _IOW('f', 16, __u64)
  25. #define EXT4_IOC_SWAP_BOOT _IO('f', 17)
  26. #define EXT4_IOC_PRECACHE_EXTENTS _IO('f', 18)
  27. /* ioctl codes 19--39 are reserved for fscrypt */
  28. #define EXT4_IOC_CLEAR_ES_CACHE _IO('f', 40)
  29. #define EXT4_IOC_GETSTATE _IOW('f', 41, __u32)
  30. #define EXT4_IOC_GET_ES_CACHE _IOWR('f', 42, struct fiemap)
  31. #define EXT4_IOC_CHECKPOINT _IOW('f', 43, __u32)
  32. #define EXT4_IOC_GETFSUUID _IOR('f', 44, struct fsuuid)
  33. #define EXT4_IOC_SETFSUUID _IOW('f', 44, struct fsuuid)
  34. #define EXT4_IOC_SHUTDOWN _IOR('X', 125, __u32)
  35. /*
  36. * ioctl commands in 32 bit emulation
  37. */
  38. #define EXT4_IOC32_GETVERSION _IOR('f', 3, int)
  39. #define EXT4_IOC32_SETVERSION _IOW('f', 4, int)
  40. #define EXT4_IOC32_GETRSVSZ _IOR('f', 5, int)
  41. #define EXT4_IOC32_SETRSVSZ _IOW('f', 6, int)
  42. #define EXT4_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int)
  43. #define EXT4_IOC32_GROUP_ADD _IOW('f', 8, struct compat_ext4_new_group_input)
  44. #define EXT4_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION
  45. #define EXT4_IOC32_SETVERSION_OLD FS_IOC32_SETVERSION
  46. /*
  47. * Flags returned by EXT4_IOC_GETSTATE
  48. *
  49. * We only expose to userspace a subset of the state flags in
  50. * i_state_flags
  51. */
  52. #define EXT4_STATE_FLAG_EXT_PRECACHED 0x00000001
  53. #define EXT4_STATE_FLAG_NEW 0x00000002
  54. #define EXT4_STATE_FLAG_NEWENTRY 0x00000004
  55. #define EXT4_STATE_FLAG_DA_ALLOC_CLOSE 0x00000008
  56. /*
  57. * Flags for ioctl EXT4_IOC_CHECKPOINT
  58. */
  59. #define EXT4_IOC_CHECKPOINT_FLAG_DISCARD 0x1
  60. #define EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT 0x2
  61. #define EXT4_IOC_CHECKPOINT_FLAG_DRY_RUN 0x4
  62. #define EXT4_IOC_CHECKPOINT_FLAG_VALID (EXT4_IOC_CHECKPOINT_FLAG_DISCARD | \
  63. EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT | \
  64. EXT4_IOC_CHECKPOINT_FLAG_DRY_RUN)
  65. /*
  66. * Structure for EXT4_IOC_GETFSUUID/EXT4_IOC_SETFSUUID
  67. */
  68. struct fsuuid {
  69. __u32 fsu_len;
  70. __u32 fsu_flags;
  71. __u8 fsu_uuid[];
  72. };
  73. /*
  74. * Structure for EXT4_IOC_MOVE_EXT
  75. */
  76. struct move_extent {
  77. __u32 reserved; /* should be zero */
  78. __u32 donor_fd; /* donor file descriptor */
  79. __u64 orig_start; /* logical start offset in block for orig */
  80. __u64 donor_start; /* logical start offset in block for donor */
  81. __u64 len; /* block length to be moved */
  82. __u64 moved_len; /* moved block length */
  83. };
  84. /*
  85. * Flags used by EXT4_IOC_SHUTDOWN
  86. */
  87. #define EXT4_GOING_FLAGS_DEFAULT 0x0 /* going down */
  88. #define EXT4_GOING_FLAGS_LOGFLUSH 0x1 /* flush log but not data */
  89. #define EXT4_GOING_FLAGS_NOLOGFLUSH 0x2 /* don't flush log nor data */
  90. /* Used to pass group descriptor data when online resize is done */
  91. struct ext4_new_group_input {
  92. __u32 group; /* Group number for this data */
  93. __u64 block_bitmap; /* Absolute block number of block bitmap */
  94. __u64 inode_bitmap; /* Absolute block number of inode bitmap */
  95. __u64 inode_table; /* Absolute block number of inode table start */
  96. __u32 blocks_count; /* Total number of blocks in this group */
  97. __u16 reserved_blocks; /* Number of reserved blocks in this group */
  98. __u16 unused;
  99. };
  100. /*
  101. * Returned by EXT4_IOC_GET_ES_CACHE as an additional possible flag.
  102. * It indicates that the entry in extent status cache is for a hole.
  103. */
  104. #define EXT4_FIEMAP_EXTENT_HOLE 0x08000000
  105. #endif /* _LINUX_EXT4_H */