Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _FALLOC_H_
0003 #define _FALLOC_H_
0004 
0005 #include <uapi/linux/falloc.h>
0006 
0007 
0008 /*
0009  * Space reservation ioctls and argument structure
0010  * are designed to be compatible with the legacy XFS ioctls.
0011  */
0012 struct space_resv {
0013     __s16       l_type;
0014     __s16       l_whence;
0015     __s64       l_start;
0016     __s64       l_len;      /* len == 0 means until end of file */
0017     __s32       l_sysid;
0018     __u32       l_pid;
0019     __s32       l_pad[4];   /* reserved area */
0020 };
0021 
0022 #define FS_IOC_RESVSP       _IOW('X', 40, struct space_resv)
0023 #define FS_IOC_UNRESVSP     _IOW('X', 41, struct space_resv)
0024 #define FS_IOC_RESVSP64     _IOW('X', 42, struct space_resv)
0025 #define FS_IOC_UNRESVSP64   _IOW('X', 43, struct space_resv)
0026 #define FS_IOC_ZERO_RANGE   _IOW('X', 57, struct space_resv)
0027 
0028 #define FALLOC_FL_SUPPORTED_MASK    (FALLOC_FL_KEEP_SIZE |      \
0029                      FALLOC_FL_PUNCH_HOLE |     \
0030                      FALLOC_FL_COLLAPSE_RANGE | \
0031                      FALLOC_FL_ZERO_RANGE |     \
0032                      FALLOC_FL_INSERT_RANGE |   \
0033                      FALLOC_FL_UNSHARE_RANGE)
0034 
0035 /* on ia32 l_start is on a 32-bit boundary */
0036 #if defined(CONFIG_X86_64)
0037 struct space_resv_32 {
0038     __s16       l_type;
0039     __s16       l_whence;
0040     __s64       l_start __attribute__((packed));
0041             /* len == 0 means until end of file */
0042     __s64       l_len __attribute__((packed));
0043     __s32       l_sysid;
0044     __u32       l_pid;
0045     __s32       l_pad[4];   /* reserve area */
0046 };
0047 
0048 #define FS_IOC_RESVSP_32    _IOW ('X', 40, struct space_resv_32)
0049 #define FS_IOC_UNRESVSP_32  _IOW ('X', 41, struct space_resv_32)
0050 #define FS_IOC_RESVSP64_32  _IOW ('X', 42, struct space_resv_32)
0051 #define FS_IOC_UNRESVSP64_32    _IOW ('X', 43, struct space_resv_32)
0052 #define FS_IOC_ZERO_RANGE_32    _IOW ('X', 57, struct space_resv_32)
0053 
0054 #endif
0055 
0056 #endif /* _FALLOC_H_ */