Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Amit Arora | 97ac735 | 2007-07-17 21:42:44 -0400 | [diff] [blame] | 2 | #ifndef _FALLOC_H_ |
| 3 | #define _FALLOC_H_ |
| 4 | |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 5 | #include <uapi/linux/falloc.h> |
Amit Arora | 97ac735 | 2007-07-17 21:42:44 -0400 | [diff] [blame] | 6 | |
Ankit Jain | 3e63cbb | 2009-06-19 14:28:07 -0400 | [diff] [blame] | 7 | |
| 8 | /* |
| 9 | * Space reservation ioctls and argument structure |
| 10 | * are designed to be compatible with the legacy XFS ioctls. |
| 11 | */ |
| 12 | struct space_resv { |
| 13 | __s16 l_type; |
| 14 | __s16 l_whence; |
| 15 | __s64 l_start; |
| 16 | __s64 l_len; /* len == 0 means until end of file */ |
| 17 | __s32 l_sysid; |
| 18 | __u32 l_pid; |
| 19 | __s32 l_pad[4]; /* reserved area */ |
| 20 | }; |
| 21 | |
| 22 | #define FS_IOC_RESVSP _IOW('X', 40, struct space_resv) |
Christoph Hellwig | 837a6e7 | 2019-10-24 22:26:02 -0700 | [diff] [blame] | 23 | #define FS_IOC_UNRESVSP _IOW('X', 41, struct space_resv) |
Ankit Jain | 3e63cbb | 2009-06-19 14:28:07 -0400 | [diff] [blame] | 24 | #define FS_IOC_RESVSP64 _IOW('X', 42, struct space_resv) |
Christoph Hellwig | 837a6e7 | 2019-10-24 22:26:02 -0700 | [diff] [blame] | 25 | #define FS_IOC_UNRESVSP64 _IOW('X', 43, struct space_resv) |
| 26 | #define FS_IOC_ZERO_RANGE _IOW('X', 57, struct space_resv) |
Ankit Jain | 3e63cbb | 2009-06-19 14:28:07 -0400 | [diff] [blame] | 27 | |
Namjae Jeon | dd46c78 | 2015-03-25 15:07:05 +1100 | [diff] [blame] | 28 | #define FALLOC_FL_SUPPORTED_MASK (FALLOC_FL_KEEP_SIZE | \ |
| 29 | FALLOC_FL_PUNCH_HOLE | \ |
| 30 | FALLOC_FL_COLLAPSE_RANGE | \ |
| 31 | FALLOC_FL_ZERO_RANGE | \ |
Darrick J. Wong | 71be6b4 | 2016-10-03 09:11:14 -0700 | [diff] [blame] | 32 | FALLOC_FL_INSERT_RANGE | \ |
| 33 | FALLOC_FL_UNSHARE_RANGE) |
Namjae Jeon | dd46c78 | 2015-03-25 15:07:05 +1100 | [diff] [blame] | 34 | |
Al Viro | 011da44 | 2019-04-21 19:24:03 -0400 | [diff] [blame] | 35 | /* on ia32 l_start is on a 32-bit boundary */ |
| 36 | #if defined(CONFIG_X86_64) |
| 37 | struct space_resv_32 { |
| 38 | __s16 l_type; |
| 39 | __s16 l_whence; |
| 40 | __s64 l_start __attribute__((packed)); |
| 41 | /* len == 0 means until end of file */ |
| 42 | __s64 l_len __attribute__((packed)); |
| 43 | __s32 l_sysid; |
| 44 | __u32 l_pid; |
| 45 | __s32 l_pad[4]; /* reserve area */ |
| 46 | }; |
| 47 | |
Linus Torvalds | 97eeb4d | 2019-12-02 14:46:22 -0800 | [diff] [blame] | 48 | #define FS_IOC_RESVSP_32 _IOW ('X', 40, struct space_resv_32) |
| 49 | #define FS_IOC_UNRESVSP_32 _IOW ('X', 41, struct space_resv_32) |
Al Viro | 011da44 | 2019-04-21 19:24:03 -0400 | [diff] [blame] | 50 | #define FS_IOC_RESVSP64_32 _IOW ('X', 42, struct space_resv_32) |
Linus Torvalds | 97eeb4d | 2019-12-02 14:46:22 -0800 | [diff] [blame] | 51 | #define FS_IOC_UNRESVSP64_32 _IOW ('X', 43, struct space_resv_32) |
| 52 | #define FS_IOC_ZERO_RANGE_32 _IOW ('X', 57, struct space_resv_32) |
Al Viro | 011da44 | 2019-04-21 19:24:03 -0400 | [diff] [blame] | 53 | |
Al Viro | 011da44 | 2019-04-21 19:24:03 -0400 | [diff] [blame] | 54 | #endif |
| 55 | |
Amit Arora | 97ac735 | 2007-07-17 21:42:44 -0400 | [diff] [blame] | 56 | #endif /* _FALLOC_H_ */ |