xref: /OK3568_Linux_fs/kernel/include/uapi/linux/fs.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2*4882a593Smuzhiyun #ifndef _UAPI_LINUX_FS_H
3*4882a593Smuzhiyun #define _UAPI_LINUX_FS_H
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun /*
6*4882a593Smuzhiyun  * This file has definitions for some important file table structures
7*4882a593Smuzhiyun  * and constants and structures used by various generic file system
8*4882a593Smuzhiyun  * ioctl's.  Please do not make any changes in this file before
9*4882a593Smuzhiyun  * sending patches for review to linux-fsdevel@vger.kernel.org and
10*4882a593Smuzhiyun  * linux-api@vger.kernel.org.
11*4882a593Smuzhiyun  */
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun #include <linux/limits.h>
14*4882a593Smuzhiyun #include <linux/ioctl.h>
15*4882a593Smuzhiyun #include <linux/types.h>
16*4882a593Smuzhiyun #ifndef __KERNEL__
17*4882a593Smuzhiyun #include <linux/fscrypt.h>
18*4882a593Smuzhiyun #endif
19*4882a593Smuzhiyun 
20*4882a593Smuzhiyun /* Use of MS_* flags within the kernel is restricted to core mount(2) code. */
21*4882a593Smuzhiyun #if !defined(__KERNEL__)
22*4882a593Smuzhiyun #include <linux/mount.h>
23*4882a593Smuzhiyun #endif
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun /*
26*4882a593Smuzhiyun  * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
27*4882a593Smuzhiyun  * the file limit at runtime and only root can increase the per-process
28*4882a593Smuzhiyun  * nr_file rlimit, so it's safe to set up a ridiculously high absolute
29*4882a593Smuzhiyun  * upper limit on files-per-process.
30*4882a593Smuzhiyun  *
31*4882a593Smuzhiyun  * Some programs (notably those using select()) may have to be
32*4882a593Smuzhiyun  * recompiled to take full advantage of the new limits..
33*4882a593Smuzhiyun  */
34*4882a593Smuzhiyun 
35*4882a593Smuzhiyun /* Fixed constants first: */
36*4882a593Smuzhiyun #undef NR_OPEN
37*4882a593Smuzhiyun #define INR_OPEN_CUR 1024	/* Initial setting for nfile rlimits */
38*4882a593Smuzhiyun #define INR_OPEN_MAX 4096	/* Hard limit for nfile rlimits */
39*4882a593Smuzhiyun 
40*4882a593Smuzhiyun #define BLOCK_SIZE_BITS 10
41*4882a593Smuzhiyun #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
42*4882a593Smuzhiyun 
43*4882a593Smuzhiyun #define SEEK_SET	0	/* seek relative to beginning of file */
44*4882a593Smuzhiyun #define SEEK_CUR	1	/* seek relative to current file position */
45*4882a593Smuzhiyun #define SEEK_END	2	/* seek relative to end of file */
46*4882a593Smuzhiyun #define SEEK_DATA	3	/* seek to the next data */
47*4882a593Smuzhiyun #define SEEK_HOLE	4	/* seek to the next hole */
48*4882a593Smuzhiyun #define SEEK_MAX	SEEK_HOLE
49*4882a593Smuzhiyun 
50*4882a593Smuzhiyun #define RENAME_NOREPLACE	(1 << 0)	/* Don't overwrite target */
51*4882a593Smuzhiyun #define RENAME_EXCHANGE		(1 << 1)	/* Exchange source and dest */
52*4882a593Smuzhiyun #define RENAME_WHITEOUT		(1 << 2)	/* Whiteout source */
53*4882a593Smuzhiyun 
54*4882a593Smuzhiyun struct file_clone_range {
55*4882a593Smuzhiyun 	__s64 src_fd;
56*4882a593Smuzhiyun 	__u64 src_offset;
57*4882a593Smuzhiyun 	__u64 src_length;
58*4882a593Smuzhiyun 	__u64 dest_offset;
59*4882a593Smuzhiyun };
60*4882a593Smuzhiyun 
61*4882a593Smuzhiyun struct fstrim_range {
62*4882a593Smuzhiyun 	__u64 start;
63*4882a593Smuzhiyun 	__u64 len;
64*4882a593Smuzhiyun 	__u64 minlen;
65*4882a593Smuzhiyun };
66*4882a593Smuzhiyun 
67*4882a593Smuzhiyun /* extent-same (dedupe) ioctls; these MUST match the btrfs ioctl definitions */
68*4882a593Smuzhiyun #define FILE_DEDUPE_RANGE_SAME		0
69*4882a593Smuzhiyun #define FILE_DEDUPE_RANGE_DIFFERS	1
70*4882a593Smuzhiyun 
71*4882a593Smuzhiyun /* from struct btrfs_ioctl_file_extent_same_info */
72*4882a593Smuzhiyun struct file_dedupe_range_info {
73*4882a593Smuzhiyun 	__s64 dest_fd;		/* in - destination file */
74*4882a593Smuzhiyun 	__u64 dest_offset;	/* in - start of extent in destination */
75*4882a593Smuzhiyun 	__u64 bytes_deduped;	/* out - total # of bytes we were able
76*4882a593Smuzhiyun 				 * to dedupe from this file. */
77*4882a593Smuzhiyun 	/* status of this dedupe operation:
78*4882a593Smuzhiyun 	 * < 0 for error
79*4882a593Smuzhiyun 	 * == FILE_DEDUPE_RANGE_SAME if dedupe succeeds
80*4882a593Smuzhiyun 	 * == FILE_DEDUPE_RANGE_DIFFERS if data differs
81*4882a593Smuzhiyun 	 */
82*4882a593Smuzhiyun 	__s32 status;		/* out - see above description */
83*4882a593Smuzhiyun 	__u32 reserved;		/* must be zero */
84*4882a593Smuzhiyun };
85*4882a593Smuzhiyun 
86*4882a593Smuzhiyun /* from struct btrfs_ioctl_file_extent_same_args */
87*4882a593Smuzhiyun struct file_dedupe_range {
88*4882a593Smuzhiyun 	__u64 src_offset;	/* in - start of extent in source */
89*4882a593Smuzhiyun 	__u64 src_length;	/* in - length of extent */
90*4882a593Smuzhiyun 	__u16 dest_count;	/* in - total elements in info array */
91*4882a593Smuzhiyun 	__u16 reserved1;	/* must be zero */
92*4882a593Smuzhiyun 	__u32 reserved2;	/* must be zero */
93*4882a593Smuzhiyun 	struct file_dedupe_range_info info[0];
94*4882a593Smuzhiyun };
95*4882a593Smuzhiyun 
96*4882a593Smuzhiyun /* And dynamically-tunable limits and defaults: */
97*4882a593Smuzhiyun struct files_stat_struct {
98*4882a593Smuzhiyun 	unsigned long nr_files;		/* read only */
99*4882a593Smuzhiyun 	unsigned long nr_free_files;	/* read only */
100*4882a593Smuzhiyun 	unsigned long max_files;		/* tunable */
101*4882a593Smuzhiyun };
102*4882a593Smuzhiyun 
103*4882a593Smuzhiyun struct inodes_stat_t {
104*4882a593Smuzhiyun 	long nr_inodes;
105*4882a593Smuzhiyun 	long nr_unused;
106*4882a593Smuzhiyun 	long dummy[5];		/* padding for sysctl ABI compatibility */
107*4882a593Smuzhiyun };
108*4882a593Smuzhiyun 
109*4882a593Smuzhiyun 
110*4882a593Smuzhiyun #define NR_FILE  8192	/* this can well be larger on a larger system */
111*4882a593Smuzhiyun 
112*4882a593Smuzhiyun /*
113*4882a593Smuzhiyun  * Structure for FS_IOC_FSGETXATTR[A] and FS_IOC_FSSETXATTR.
114*4882a593Smuzhiyun  */
115*4882a593Smuzhiyun struct fsxattr {
116*4882a593Smuzhiyun 	__u32		fsx_xflags;	/* xflags field value (get/set) */
117*4882a593Smuzhiyun 	__u32		fsx_extsize;	/* extsize field value (get/set)*/
118*4882a593Smuzhiyun 	__u32		fsx_nextents;	/* nextents field value (get)	*/
119*4882a593Smuzhiyun 	__u32		fsx_projid;	/* project identifier (get/set) */
120*4882a593Smuzhiyun 	__u32		fsx_cowextsize;	/* CoW extsize field value (get/set)*/
121*4882a593Smuzhiyun 	unsigned char	fsx_pad[8];
122*4882a593Smuzhiyun };
123*4882a593Smuzhiyun 
124*4882a593Smuzhiyun /*
125*4882a593Smuzhiyun  * Flags for the fsx_xflags field
126*4882a593Smuzhiyun  */
127*4882a593Smuzhiyun #define FS_XFLAG_REALTIME	0x00000001	/* data in realtime volume */
128*4882a593Smuzhiyun #define FS_XFLAG_PREALLOC	0x00000002	/* preallocated file extents */
129*4882a593Smuzhiyun #define FS_XFLAG_IMMUTABLE	0x00000008	/* file cannot be modified */
130*4882a593Smuzhiyun #define FS_XFLAG_APPEND		0x00000010	/* all writes append */
131*4882a593Smuzhiyun #define FS_XFLAG_SYNC		0x00000020	/* all writes synchronous */
132*4882a593Smuzhiyun #define FS_XFLAG_NOATIME	0x00000040	/* do not update access time */
133*4882a593Smuzhiyun #define FS_XFLAG_NODUMP		0x00000080	/* do not include in backups */
134*4882a593Smuzhiyun #define FS_XFLAG_RTINHERIT	0x00000100	/* create with rt bit set */
135*4882a593Smuzhiyun #define FS_XFLAG_PROJINHERIT	0x00000200	/* create with parents projid */
136*4882a593Smuzhiyun #define FS_XFLAG_NOSYMLINKS	0x00000400	/* disallow symlink creation */
137*4882a593Smuzhiyun #define FS_XFLAG_EXTSIZE	0x00000800	/* extent size allocator hint */
138*4882a593Smuzhiyun #define FS_XFLAG_EXTSZINHERIT	0x00001000	/* inherit inode extent size */
139*4882a593Smuzhiyun #define FS_XFLAG_NODEFRAG	0x00002000	/* do not defragment */
140*4882a593Smuzhiyun #define FS_XFLAG_FILESTREAM	0x00004000	/* use filestream allocator */
141*4882a593Smuzhiyun #define FS_XFLAG_DAX		0x00008000	/* use DAX for IO */
142*4882a593Smuzhiyun #define FS_XFLAG_COWEXTSIZE	0x00010000	/* CoW extent size allocator hint */
143*4882a593Smuzhiyun #define FS_XFLAG_HASATTR	0x80000000	/* no DIFLAG for this	*/
144*4882a593Smuzhiyun 
145*4882a593Smuzhiyun /* the read-only stuff doesn't really belong here, but any other place is
146*4882a593Smuzhiyun    probably as bad and I don't want to create yet another include file. */
147*4882a593Smuzhiyun 
148*4882a593Smuzhiyun #define BLKROSET   _IO(0x12,93)	/* set device read-only (0 = read-write) */
149*4882a593Smuzhiyun #define BLKROGET   _IO(0x12,94)	/* get read-only status (0 = read_write) */
150*4882a593Smuzhiyun #define BLKRRPART  _IO(0x12,95)	/* re-read partition table */
151*4882a593Smuzhiyun #define BLKGETSIZE _IO(0x12,96)	/* return device size /512 (long *arg) */
152*4882a593Smuzhiyun #define BLKFLSBUF  _IO(0x12,97)	/* flush buffer cache */
153*4882a593Smuzhiyun #define BLKRASET   _IO(0x12,98)	/* set read ahead for block device */
154*4882a593Smuzhiyun #define BLKRAGET   _IO(0x12,99)	/* get current read ahead setting */
155*4882a593Smuzhiyun #define BLKFRASET  _IO(0x12,100)/* set filesystem (mm/filemap.c) read-ahead */
156*4882a593Smuzhiyun #define BLKFRAGET  _IO(0x12,101)/* get filesystem (mm/filemap.c) read-ahead */
157*4882a593Smuzhiyun #define BLKSECTSET _IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */
158*4882a593Smuzhiyun #define BLKSECTGET _IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */
159*4882a593Smuzhiyun #define BLKSSZGET  _IO(0x12,104)/* get block device sector size */
160*4882a593Smuzhiyun #if 0
161*4882a593Smuzhiyun #define BLKPG      _IO(0x12,105)/* See blkpg.h */
162*4882a593Smuzhiyun 
163*4882a593Smuzhiyun /* Some people are morons.  Do not use sizeof! */
164*4882a593Smuzhiyun 
165*4882a593Smuzhiyun #define BLKELVGET  _IOR(0x12,106,size_t)/* elevator get */
166*4882a593Smuzhiyun #define BLKELVSET  _IOW(0x12,107,size_t)/* elevator set */
167*4882a593Smuzhiyun /* This was here just to show that the number is taken -
168*4882a593Smuzhiyun    probably all these _IO(0x12,*) ioctls should be moved to blkpg.h. */
169*4882a593Smuzhiyun #endif
170*4882a593Smuzhiyun /* A jump here: 108-111 have been used for various private purposes. */
171*4882a593Smuzhiyun #define BLKBSZGET  _IOR(0x12,112,size_t)
172*4882a593Smuzhiyun #define BLKBSZSET  _IOW(0x12,113,size_t)
173*4882a593Smuzhiyun #define BLKGETSIZE64 _IOR(0x12,114,size_t)	/* return device size in bytes (u64 *arg) */
174*4882a593Smuzhiyun #define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup)
175*4882a593Smuzhiyun #define BLKTRACESTART _IO(0x12,116)
176*4882a593Smuzhiyun #define BLKTRACESTOP _IO(0x12,117)
177*4882a593Smuzhiyun #define BLKTRACETEARDOWN _IO(0x12,118)
178*4882a593Smuzhiyun #define BLKDISCARD _IO(0x12,119)
179*4882a593Smuzhiyun #define BLKIOMIN _IO(0x12,120)
180*4882a593Smuzhiyun #define BLKIOOPT _IO(0x12,121)
181*4882a593Smuzhiyun #define BLKALIGNOFF _IO(0x12,122)
182*4882a593Smuzhiyun #define BLKPBSZGET _IO(0x12,123)
183*4882a593Smuzhiyun #define BLKDISCARDZEROES _IO(0x12,124)
184*4882a593Smuzhiyun #define BLKSECDISCARD _IO(0x12,125)
185*4882a593Smuzhiyun #define BLKROTATIONAL _IO(0x12,126)
186*4882a593Smuzhiyun #define BLKZEROOUT _IO(0x12,127)
187*4882a593Smuzhiyun /*
188*4882a593Smuzhiyun  * A jump here: 130-131 are reserved for zoned block devices
189*4882a593Smuzhiyun  * (see uapi/linux/blkzoned.h)
190*4882a593Smuzhiyun  */
191*4882a593Smuzhiyun 
192*4882a593Smuzhiyun #define BMAP_IOCTL 1		/* obsolete - kept for compatibility */
193*4882a593Smuzhiyun #define FIBMAP	   _IO(0x00,1)	/* bmap access */
194*4882a593Smuzhiyun #define FIGETBSZ   _IO(0x00,2)	/* get the block size used for bmap */
195*4882a593Smuzhiyun #define FIFREEZE	_IOWR('X', 119, int)	/* Freeze */
196*4882a593Smuzhiyun #define FITHAW		_IOWR('X', 120, int)	/* Thaw */
197*4882a593Smuzhiyun #define FITRIM		_IOWR('X', 121, struct fstrim_range)	/* Trim */
198*4882a593Smuzhiyun #define FICLONE		_IOW(0x94, 9, int)
199*4882a593Smuzhiyun #define FICLONERANGE	_IOW(0x94, 13, struct file_clone_range)
200*4882a593Smuzhiyun #define FIDEDUPERANGE	_IOWR(0x94, 54, struct file_dedupe_range)
201*4882a593Smuzhiyun 
202*4882a593Smuzhiyun #define FSLABEL_MAX 256	/* Max chars for the interface; each fs may differ */
203*4882a593Smuzhiyun 
204*4882a593Smuzhiyun #define	FS_IOC_GETFLAGS			_IOR('f', 1, long)
205*4882a593Smuzhiyun #define	FS_IOC_SETFLAGS			_IOW('f', 2, long)
206*4882a593Smuzhiyun #define	FS_IOC_GETVERSION		_IOR('v', 1, long)
207*4882a593Smuzhiyun #define	FS_IOC_SETVERSION		_IOW('v', 2, long)
208*4882a593Smuzhiyun #define FS_IOC_FIEMAP			_IOWR('f', 11, struct fiemap)
209*4882a593Smuzhiyun #define FS_IOC32_GETFLAGS		_IOR('f', 1, int)
210*4882a593Smuzhiyun #define FS_IOC32_SETFLAGS		_IOW('f', 2, int)
211*4882a593Smuzhiyun #define FS_IOC32_GETVERSION		_IOR('v', 1, int)
212*4882a593Smuzhiyun #define FS_IOC32_SETVERSION		_IOW('v', 2, int)
213*4882a593Smuzhiyun #define FS_IOC_FSGETXATTR		_IOR('X', 31, struct fsxattr)
214*4882a593Smuzhiyun #define FS_IOC_FSSETXATTR		_IOW('X', 32, struct fsxattr)
215*4882a593Smuzhiyun #define FS_IOC_GETFSLABEL		_IOR(0x94, 49, char[FSLABEL_MAX])
216*4882a593Smuzhiyun #define FS_IOC_SETFSLABEL		_IOW(0x94, 50, char[FSLABEL_MAX])
217*4882a593Smuzhiyun 
218*4882a593Smuzhiyun /*
219*4882a593Smuzhiyun  * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
220*4882a593Smuzhiyun  *
221*4882a593Smuzhiyun  * Note: for historical reasons, these flags were originally used and
222*4882a593Smuzhiyun  * defined for use by ext2/ext3, and then other file systems started
223*4882a593Smuzhiyun  * using these flags so they wouldn't need to write their own version
224*4882a593Smuzhiyun  * of chattr/lsattr (which was shipped as part of e2fsprogs).  You
225*4882a593Smuzhiyun  * should think twice before trying to use these flags in new
226*4882a593Smuzhiyun  * contexts, or trying to assign these flags, since they are used both
227*4882a593Smuzhiyun  * as the UAPI and the on-disk encoding for ext2/3/4.  Also, we are
228*4882a593Smuzhiyun  * almost out of 32-bit flags.  :-)
229*4882a593Smuzhiyun  *
230*4882a593Smuzhiyun  * We have recently hoisted FS_IOC_FSGETXATTR / FS_IOC_FSSETXATTR from
231*4882a593Smuzhiyun  * XFS to the generic FS level interface.  This uses a structure that
232*4882a593Smuzhiyun  * has padding and hence has more room to grow, so it may be more
233*4882a593Smuzhiyun  * appropriate for many new use cases.
234*4882a593Smuzhiyun  *
235*4882a593Smuzhiyun  * Please do not change these flags or interfaces before checking with
236*4882a593Smuzhiyun  * linux-fsdevel@vger.kernel.org and linux-api@vger.kernel.org.
237*4882a593Smuzhiyun  */
238*4882a593Smuzhiyun #define	FS_SECRM_FL			0x00000001 /* Secure deletion */
239*4882a593Smuzhiyun #define	FS_UNRM_FL			0x00000002 /* Undelete */
240*4882a593Smuzhiyun #define	FS_COMPR_FL			0x00000004 /* Compress file */
241*4882a593Smuzhiyun #define FS_SYNC_FL			0x00000008 /* Synchronous updates */
242*4882a593Smuzhiyun #define FS_IMMUTABLE_FL			0x00000010 /* Immutable file */
243*4882a593Smuzhiyun #define FS_APPEND_FL			0x00000020 /* writes to file may only append */
244*4882a593Smuzhiyun #define FS_NODUMP_FL			0x00000040 /* do not dump file */
245*4882a593Smuzhiyun #define FS_NOATIME_FL			0x00000080 /* do not update atime */
246*4882a593Smuzhiyun /* Reserved for compression usage... */
247*4882a593Smuzhiyun #define FS_DIRTY_FL			0x00000100
248*4882a593Smuzhiyun #define FS_COMPRBLK_FL			0x00000200 /* One or more compressed clusters */
249*4882a593Smuzhiyun #define FS_NOCOMP_FL			0x00000400 /* Don't compress */
250*4882a593Smuzhiyun /* End compression flags --- maybe not all used */
251*4882a593Smuzhiyun #define FS_ENCRYPT_FL			0x00000800 /* Encrypted file */
252*4882a593Smuzhiyun #define FS_BTREE_FL			0x00001000 /* btree format dir */
253*4882a593Smuzhiyun #define FS_INDEX_FL			0x00001000 /* hash-indexed directory */
254*4882a593Smuzhiyun #define FS_IMAGIC_FL			0x00002000 /* AFS directory */
255*4882a593Smuzhiyun #define FS_JOURNAL_DATA_FL		0x00004000 /* Reserved for ext3 */
256*4882a593Smuzhiyun #define FS_NOTAIL_FL			0x00008000 /* file tail should not be merged */
257*4882a593Smuzhiyun #define FS_DIRSYNC_FL			0x00010000 /* dirsync behaviour (directories only) */
258*4882a593Smuzhiyun #define FS_TOPDIR_FL			0x00020000 /* Top of directory hierarchies*/
259*4882a593Smuzhiyun #define FS_HUGE_FILE_FL			0x00040000 /* Reserved for ext4 */
260*4882a593Smuzhiyun #define FS_EXTENT_FL			0x00080000 /* Extents */
261*4882a593Smuzhiyun #define FS_VERITY_FL			0x00100000 /* Verity protected inode */
262*4882a593Smuzhiyun #define FS_EA_INODE_FL			0x00200000 /* Inode used for large EA */
263*4882a593Smuzhiyun #define FS_EOFBLOCKS_FL			0x00400000 /* Reserved for ext4 */
264*4882a593Smuzhiyun #define FS_NOCOW_FL			0x00800000 /* Do not cow file */
265*4882a593Smuzhiyun #define FS_DAX_FL			0x02000000 /* Inode is DAX */
266*4882a593Smuzhiyun #define FS_INLINE_DATA_FL		0x10000000 /* Reserved for ext4 */
267*4882a593Smuzhiyun #define FS_PROJINHERIT_FL		0x20000000 /* Create with parents projid */
268*4882a593Smuzhiyun #define FS_CASEFOLD_FL			0x40000000 /* Folder is case insensitive */
269*4882a593Smuzhiyun #define FS_RESERVED_FL			0x80000000 /* reserved for ext2 lib */
270*4882a593Smuzhiyun 
271*4882a593Smuzhiyun #define FS_FL_USER_VISIBLE		0x0003DFFF /* User visible flags */
272*4882a593Smuzhiyun #define FS_FL_USER_MODIFIABLE		0x000380FF /* User modifiable flags */
273*4882a593Smuzhiyun 
274*4882a593Smuzhiyun 
275*4882a593Smuzhiyun #define SYNC_FILE_RANGE_WAIT_BEFORE	1
276*4882a593Smuzhiyun #define SYNC_FILE_RANGE_WRITE		2
277*4882a593Smuzhiyun #define SYNC_FILE_RANGE_WAIT_AFTER	4
278*4882a593Smuzhiyun #define SYNC_FILE_RANGE_WRITE_AND_WAIT	(SYNC_FILE_RANGE_WRITE | \
279*4882a593Smuzhiyun 					 SYNC_FILE_RANGE_WAIT_BEFORE | \
280*4882a593Smuzhiyun 					 SYNC_FILE_RANGE_WAIT_AFTER)
281*4882a593Smuzhiyun 
282*4882a593Smuzhiyun /*
283*4882a593Smuzhiyun  * Flags for preadv2/pwritev2:
284*4882a593Smuzhiyun  */
285*4882a593Smuzhiyun 
286*4882a593Smuzhiyun typedef int __bitwise __kernel_rwf_t;
287*4882a593Smuzhiyun 
288*4882a593Smuzhiyun /* high priority request, poll if possible */
289*4882a593Smuzhiyun #define RWF_HIPRI	((__force __kernel_rwf_t)0x00000001)
290*4882a593Smuzhiyun 
291*4882a593Smuzhiyun /* per-IO O_DSYNC */
292*4882a593Smuzhiyun #define RWF_DSYNC	((__force __kernel_rwf_t)0x00000002)
293*4882a593Smuzhiyun 
294*4882a593Smuzhiyun /* per-IO O_SYNC */
295*4882a593Smuzhiyun #define RWF_SYNC	((__force __kernel_rwf_t)0x00000004)
296*4882a593Smuzhiyun 
297*4882a593Smuzhiyun /* per-IO, return -EAGAIN if operation would block */
298*4882a593Smuzhiyun #define RWF_NOWAIT	((__force __kernel_rwf_t)0x00000008)
299*4882a593Smuzhiyun 
300*4882a593Smuzhiyun /* per-IO O_APPEND */
301*4882a593Smuzhiyun #define RWF_APPEND	((__force __kernel_rwf_t)0x00000010)
302*4882a593Smuzhiyun 
303*4882a593Smuzhiyun /* mask of flags supported by the kernel */
304*4882a593Smuzhiyun #define RWF_SUPPORTED	(RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\
305*4882a593Smuzhiyun 			 RWF_APPEND)
306*4882a593Smuzhiyun 
307*4882a593Smuzhiyun #endif /* _UAPI_LINUX_FS_H */
308