falloc.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _FALLOC_H_
  3. #define _FALLOC_H_
  4. #include <uapi/linux/falloc.h>
  5. /*
  6. * Space reservation ioctls and argument structure
  7. * are designed to be compatible with the legacy XFS ioctls.
  8. */
  9. struct space_resv {
  10. __s16 l_type;
  11. __s16 l_whence;
  12. __s64 l_start;
  13. __s64 l_len; /* len == 0 means until end of file */
  14. __s32 l_sysid;
  15. __u32 l_pid;
  16. __s32 l_pad[4]; /* reserved area */
  17. };
  18. #define FS_IOC_RESVSP _IOW('X', 40, struct space_resv)
  19. #define FS_IOC_UNRESVSP _IOW('X', 41, struct space_resv)
  20. #define FS_IOC_RESVSP64 _IOW('X', 42, struct space_resv)
  21. #define FS_IOC_UNRESVSP64 _IOW('X', 43, struct space_resv)
  22. #define FS_IOC_ZERO_RANGE _IOW('X', 57, struct space_resv)
  23. #define FALLOC_FL_SUPPORTED_MASK (FALLOC_FL_KEEP_SIZE | \
  24. FALLOC_FL_PUNCH_HOLE | \
  25. FALLOC_FL_COLLAPSE_RANGE | \
  26. FALLOC_FL_ZERO_RANGE | \
  27. FALLOC_FL_INSERT_RANGE | \
  28. FALLOC_FL_UNSHARE_RANGE)
  29. /* on ia32 l_start is on a 32-bit boundary */
  30. #if defined(CONFIG_X86_64)
  31. struct space_resv_32 {
  32. __s16 l_type;
  33. __s16 l_whence;
  34. __s64 l_start __attribute__((packed));
  35. /* len == 0 means until end of file */
  36. __s64 l_len __attribute__((packed));
  37. __s32 l_sysid;
  38. __u32 l_pid;
  39. __s32 l_pad[4]; /* reserve area */
  40. };
  41. #define FS_IOC_RESVSP_32 _IOW ('X', 40, struct space_resv_32)
  42. #define FS_IOC_UNRESVSP_32 _IOW ('X', 41, struct space_resv_32)
  43. #define FS_IOC_RESVSP64_32 _IOW ('X', 42, struct space_resv_32)
  44. #define FS_IOC_UNRESVSP64_32 _IOW ('X', 43, struct space_resv_32)
  45. #define FS_IOC_ZERO_RANGE_32 _IOW ('X', 57, struct space_resv_32)
  46. #endif
  47. #endif /* _FALLOC_H_ */