xref: /openbmc/linux/include/uapi/linux/fs.h (revision 94dfc73e)
16f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2607ca46eSDavid Howells #ifndef _UAPI_LINUX_FS_H
3607ca46eSDavid Howells #define _UAPI_LINUX_FS_H
4607ca46eSDavid Howells 
5607ca46eSDavid Howells /*
668ce7bfcSTheodore Ts'o  * This file has definitions for some important file table structures
768ce7bfcSTheodore Ts'o  * and constants and structures used by various generic file system
868ce7bfcSTheodore Ts'o  * ioctl's.  Please do not make any changes in this file before
968ce7bfcSTheodore Ts'o  * sending patches for review to linux-fsdevel@vger.kernel.org and
1068ce7bfcSTheodore Ts'o  * linux-api@vger.kernel.org.
11607ca46eSDavid Howells  */
12607ca46eSDavid Howells 
13607ca46eSDavid Howells #include <linux/limits.h>
14607ca46eSDavid Howells #include <linux/ioctl.h>
15607ca46eSDavid Howells #include <linux/types.h>
167af0ab0dSEric Biggers #ifndef __KERNEL__
177af0ab0dSEric Biggers #include <linux/fscrypt.h>
187af0ab0dSEric Biggers #endif
19607ca46eSDavid Howells 
20e262e32dSDavid Howells /* Use of MS_* flags within the kernel is restricted to core mount(2) code. */
21e262e32dSDavid Howells #if !defined(__KERNEL__)
22e262e32dSDavid Howells #include <linux/mount.h>
23e262e32dSDavid Howells #endif
24e262e32dSDavid Howells 
25607ca46eSDavid Howells /*
26607ca46eSDavid Howells  * It's silly to have NR_OPEN bigger than NR_FILE, but you can change
27607ca46eSDavid Howells  * the file limit at runtime and only root can increase the per-process
28607ca46eSDavid Howells  * nr_file rlimit, so it's safe to set up a ridiculously high absolute
29607ca46eSDavid Howells  * upper limit on files-per-process.
30607ca46eSDavid Howells  *
31607ca46eSDavid Howells  * Some programs (notably those using select()) may have to be
32607ca46eSDavid Howells  * recompiled to take full advantage of the new limits..
33607ca46eSDavid Howells  */
34607ca46eSDavid Howells 
35607ca46eSDavid Howells /* Fixed constants first: */
36607ca46eSDavid Howells #undef NR_OPEN
37607ca46eSDavid Howells #define INR_OPEN_CUR 1024	/* Initial setting for nfile rlimits */
38607ca46eSDavid Howells #define INR_OPEN_MAX 4096	/* Hard limit for nfile rlimits */
39607ca46eSDavid Howells 
40607ca46eSDavid Howells #define BLOCK_SIZE_BITS 10
41607ca46eSDavid Howells #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
42607ca46eSDavid Howells 
43607ca46eSDavid Howells #define SEEK_SET	0	/* seek relative to beginning of file */
44607ca46eSDavid Howells #define SEEK_CUR	1	/* seek relative to current file position */
45607ca46eSDavid Howells #define SEEK_END	2	/* seek relative to end of file */
46607ca46eSDavid Howells #define SEEK_DATA	3	/* seek to the next data */
47607ca46eSDavid Howells #define SEEK_HOLE	4	/* seek to the next hole */
48607ca46eSDavid Howells #define SEEK_MAX	SEEK_HOLE
49607ca46eSDavid Howells 
500a7c3937SMiklos Szeredi #define RENAME_NOREPLACE	(1 << 0)	/* Don't overwrite target */
51da1ce067SMiklos Szeredi #define RENAME_EXCHANGE		(1 << 1)	/* Exchange source and dest */
520d7a8555SMiklos Szeredi #define RENAME_WHITEOUT		(1 << 2)	/* Whiteout source */
530a7c3937SMiklos Szeredi 
5404b38d60SChristoph Hellwig struct file_clone_range {
5504b38d60SChristoph Hellwig 	__s64 src_fd;
5604b38d60SChristoph Hellwig 	__u64 src_offset;
5704b38d60SChristoph Hellwig 	__u64 src_length;
5804b38d60SChristoph Hellwig 	__u64 dest_offset;
5904b38d60SChristoph Hellwig };
6004b38d60SChristoph Hellwig 
61607ca46eSDavid Howells struct fstrim_range {
62607ca46eSDavid Howells 	__u64 start;
63607ca46eSDavid Howells 	__u64 len;
64607ca46eSDavid Howells 	__u64 minlen;
65607ca46eSDavid Howells };
66607ca46eSDavid Howells 
6754dbc151SDarrick J. Wong /* extent-same (dedupe) ioctls; these MUST match the btrfs ioctl definitions */
6854dbc151SDarrick J. Wong #define FILE_DEDUPE_RANGE_SAME		0
6954dbc151SDarrick J. Wong #define FILE_DEDUPE_RANGE_DIFFERS	1
7054dbc151SDarrick J. Wong 
7154dbc151SDarrick J. Wong /* from struct btrfs_ioctl_file_extent_same_info */
7254dbc151SDarrick J. Wong struct file_dedupe_range_info {
7354dbc151SDarrick J. Wong 	__s64 dest_fd;		/* in - destination file */
7454dbc151SDarrick J. Wong 	__u64 dest_offset;	/* in - start of extent in destination */
7554dbc151SDarrick J. Wong 	__u64 bytes_deduped;	/* out - total # of bytes we were able
7654dbc151SDarrick J. Wong 				 * to dedupe from this file. */
7754dbc151SDarrick J. Wong 	/* status of this dedupe operation:
7854dbc151SDarrick J. Wong 	 * < 0 for error
7954dbc151SDarrick J. Wong 	 * == FILE_DEDUPE_RANGE_SAME if dedupe succeeds
8054dbc151SDarrick J. Wong 	 * == FILE_DEDUPE_RANGE_DIFFERS if data differs
8154dbc151SDarrick J. Wong 	 */
8254dbc151SDarrick J. Wong 	__s32 status;		/* out - see above description */
8354dbc151SDarrick J. Wong 	__u32 reserved;		/* must be zero */
8454dbc151SDarrick J. Wong };
8554dbc151SDarrick J. Wong 
8654dbc151SDarrick J. Wong /* from struct btrfs_ioctl_file_extent_same_args */
8754dbc151SDarrick J. Wong struct file_dedupe_range {
8854dbc151SDarrick J. Wong 	__u64 src_offset;	/* in - start of extent in source */
8954dbc151SDarrick J. Wong 	__u64 src_length;	/* in - length of extent */
9054dbc151SDarrick J. Wong 	__u16 dest_count;	/* in - total elements in info array */
9154dbc151SDarrick J. Wong 	__u16 reserved1;	/* must be zero */
9254dbc151SDarrick J. Wong 	__u32 reserved2;	/* must be zero */
93*94dfc73eSGustavo A. R. Silva 	struct file_dedupe_range_info info[];
9454dbc151SDarrick J. Wong };
9554dbc151SDarrick J. Wong 
96607ca46eSDavid Howells /* And dynamically-tunable limits and defaults: */
97607ca46eSDavid Howells struct files_stat_struct {
98607ca46eSDavid Howells 	unsigned long nr_files;		/* read only */
99607ca46eSDavid Howells 	unsigned long nr_free_files;	/* read only */
100607ca46eSDavid Howells 	unsigned long max_files;		/* tunable */
101607ca46eSDavid Howells };
102607ca46eSDavid Howells 
103607ca46eSDavid Howells struct inodes_stat_t {
1043942c07cSGlauber Costa 	long nr_inodes;
1053942c07cSGlauber Costa 	long nr_unused;
1063942c07cSGlauber Costa 	long dummy[5];		/* padding for sysctl ABI compatibility */
107607ca46eSDavid Howells };
108607ca46eSDavid Howells 
109607ca46eSDavid Howells 
110607ca46eSDavid Howells #define NR_FILE  8192	/* this can well be larger on a larger system */
111607ca46eSDavid Howells 
112334e580aSDave Chinner /*
113334e580aSDave Chinner  * Structure for FS_IOC_FSGETXATTR[A] and FS_IOC_FSSETXATTR.
114334e580aSDave Chinner  */
115334e580aSDave Chinner struct fsxattr {
116334e580aSDave Chinner 	__u32		fsx_xflags;	/* xflags field value (get/set) */
117334e580aSDave Chinner 	__u32		fsx_extsize;	/* extsize field value (get/set)*/
118334e580aSDave Chinner 	__u32		fsx_nextents;	/* nextents field value (get)	*/
119334e580aSDave Chinner 	__u32		fsx_projid;	/* project identifier (get/set) */
1200a6eab8bSDarrick J. Wong 	__u32		fsx_cowextsize;	/* CoW extsize field value (get/set)*/
1210a6eab8bSDarrick J. Wong 	unsigned char	fsx_pad[8];
122334e580aSDave Chinner };
123334e580aSDave Chinner 
124334e580aSDave Chinner /*
125334e580aSDave Chinner  * Flags for the fsx_xflags field
126334e580aSDave Chinner  */
127334e580aSDave Chinner #define FS_XFLAG_REALTIME	0x00000001	/* data in realtime volume */
128334e580aSDave Chinner #define FS_XFLAG_PREALLOC	0x00000002	/* preallocated file extents */
129334e580aSDave Chinner #define FS_XFLAG_IMMUTABLE	0x00000008	/* file cannot be modified */
130334e580aSDave Chinner #define FS_XFLAG_APPEND		0x00000010	/* all writes append */
131334e580aSDave Chinner #define FS_XFLAG_SYNC		0x00000020	/* all writes synchronous */
132334e580aSDave Chinner #define FS_XFLAG_NOATIME	0x00000040	/* do not update access time */
133334e580aSDave Chinner #define FS_XFLAG_NODUMP		0x00000080	/* do not include in backups */
134334e580aSDave Chinner #define FS_XFLAG_RTINHERIT	0x00000100	/* create with rt bit set */
135334e580aSDave Chinner #define FS_XFLAG_PROJINHERIT	0x00000200	/* create with parents projid */
136334e580aSDave Chinner #define FS_XFLAG_NOSYMLINKS	0x00000400	/* disallow symlink creation */
137334e580aSDave Chinner #define FS_XFLAG_EXTSIZE	0x00000800	/* extent size allocator hint */
138334e580aSDave Chinner #define FS_XFLAG_EXTSZINHERIT	0x00001000	/* inherit inode extent size */
139334e580aSDave Chinner #define FS_XFLAG_NODEFRAG	0x00002000	/* do not defragment */
140334e580aSDave Chinner #define FS_XFLAG_FILESTREAM	0x00004000	/* use filestream allocator */
14158f88ca2SDave Chinner #define FS_XFLAG_DAX		0x00008000	/* use DAX for IO */
1420a6eab8bSDarrick J. Wong #define FS_XFLAG_COWEXTSIZE	0x00010000	/* CoW extent size allocator hint */
143334e580aSDave Chinner #define FS_XFLAG_HASATTR	0x80000000	/* no DIFLAG for this	*/
144334e580aSDave Chinner 
145607ca46eSDavid Howells /* the read-only stuff doesn't really belong here, but any other place is
146607ca46eSDavid Howells    probably as bad and I don't want to create yet another include file. */
147607ca46eSDavid Howells 
148607ca46eSDavid Howells #define BLKROSET   _IO(0x12,93)	/* set device read-only (0 = read-write) */
149607ca46eSDavid Howells #define BLKROGET   _IO(0x12,94)	/* get read-only status (0 = read_write) */
150607ca46eSDavid Howells #define BLKRRPART  _IO(0x12,95)	/* re-read partition table */
151607ca46eSDavid Howells #define BLKGETSIZE _IO(0x12,96)	/* return device size /512 (long *arg) */
152607ca46eSDavid Howells #define BLKFLSBUF  _IO(0x12,97)	/* flush buffer cache */
153607ca46eSDavid Howells #define BLKRASET   _IO(0x12,98)	/* set read ahead for block device */
154607ca46eSDavid Howells #define BLKRAGET   _IO(0x12,99)	/* get current read ahead setting */
155607ca46eSDavid Howells #define BLKFRASET  _IO(0x12,100)/* set filesystem (mm/filemap.c) read-ahead */
156607ca46eSDavid Howells #define BLKFRAGET  _IO(0x12,101)/* get filesystem (mm/filemap.c) read-ahead */
157607ca46eSDavid Howells #define BLKSECTSET _IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */
158607ca46eSDavid Howells #define BLKSECTGET _IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */
159607ca46eSDavid Howells #define BLKSSZGET  _IO(0x12,104)/* get block device sector size */
160607ca46eSDavid Howells #if 0
161607ca46eSDavid Howells #define BLKPG      _IO(0x12,105)/* See blkpg.h */
162607ca46eSDavid Howells 
163607ca46eSDavid Howells /* Some people are morons.  Do not use sizeof! */
164607ca46eSDavid Howells 
165607ca46eSDavid Howells #define BLKELVGET  _IOR(0x12,106,size_t)/* elevator get */
166607ca46eSDavid Howells #define BLKELVSET  _IOW(0x12,107,size_t)/* elevator set */
167607ca46eSDavid Howells /* This was here just to show that the number is taken -
168607ca46eSDavid Howells    probably all these _IO(0x12,*) ioctls should be moved to blkpg.h. */
169607ca46eSDavid Howells #endif
170607ca46eSDavid Howells /* A jump here: 108-111 have been used for various private purposes. */
171607ca46eSDavid Howells #define BLKBSZGET  _IOR(0x12,112,size_t)
172607ca46eSDavid Howells #define BLKBSZSET  _IOW(0x12,113,size_t)
173607ca46eSDavid Howells #define BLKGETSIZE64 _IOR(0x12,114,size_t)	/* return device size in bytes (u64 *arg) */
174607ca46eSDavid Howells #define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup)
175607ca46eSDavid Howells #define BLKTRACESTART _IO(0x12,116)
176607ca46eSDavid Howells #define BLKTRACESTOP _IO(0x12,117)
177607ca46eSDavid Howells #define BLKTRACETEARDOWN _IO(0x12,118)
178607ca46eSDavid Howells #define BLKDISCARD _IO(0x12,119)
179607ca46eSDavid Howells #define BLKIOMIN _IO(0x12,120)
180607ca46eSDavid Howells #define BLKIOOPT _IO(0x12,121)
181607ca46eSDavid Howells #define BLKALIGNOFF _IO(0x12,122)
182607ca46eSDavid Howells #define BLKPBSZGET _IO(0x12,123)
183607ca46eSDavid Howells #define BLKDISCARDZEROES _IO(0x12,124)
184607ca46eSDavid Howells #define BLKSECDISCARD _IO(0x12,125)
185607ca46eSDavid Howells #define BLKROTATIONAL _IO(0x12,126)
186607ca46eSDavid Howells #define BLKZEROOUT _IO(0x12,127)
1877957d93bSMatteo Croce #define BLKGETDISKSEQ _IOR(0x12,128,__u64)
1883ed05a98SShaun Tancheff /*
18963c8af56SDamien Le Moal  * A jump here: 130-136 are reserved for zoned block devices
1903ed05a98SShaun Tancheff  * (see uapi/linux/blkzoned.h)
1913ed05a98SShaun Tancheff  */
192607ca46eSDavid Howells 
193607ca46eSDavid Howells #define BMAP_IOCTL 1		/* obsolete - kept for compatibility */
194607ca46eSDavid Howells #define FIBMAP	   _IO(0x00,1)	/* bmap access */
195607ca46eSDavid Howells #define FIGETBSZ   _IO(0x00,2)	/* get the block size used for bmap */
196607ca46eSDavid Howells #define FIFREEZE	_IOWR('X', 119, int)	/* Freeze */
197607ca46eSDavid Howells #define FITHAW		_IOWR('X', 120, int)	/* Thaw */
198607ca46eSDavid Howells #define FITRIM		_IOWR('X', 121, struct fstrim_range)	/* Trim */
19904b38d60SChristoph Hellwig #define FICLONE		_IOW(0x94, 9, int)
20004b38d60SChristoph Hellwig #define FICLONERANGE	_IOW(0x94, 13, struct file_clone_range)
20154dbc151SDarrick J. Wong #define FIDEDUPERANGE	_IOWR(0x94, 54, struct file_dedupe_range)
202607ca46eSDavid Howells 
20362750d04SEric Sandeen #define FSLABEL_MAX 256	/* Max chars for the interface; each fs may differ */
20462750d04SEric Sandeen 
205607ca46eSDavid Howells #define	FS_IOC_GETFLAGS			_IOR('f', 1, long)
206607ca46eSDavid Howells #define	FS_IOC_SETFLAGS			_IOW('f', 2, long)
207607ca46eSDavid Howells #define	FS_IOC_GETVERSION		_IOR('v', 1, long)
208607ca46eSDavid Howells #define	FS_IOC_SETVERSION		_IOW('v', 2, long)
209607ca46eSDavid Howells #define FS_IOC_FIEMAP			_IOWR('f', 11, struct fiemap)
210607ca46eSDavid Howells #define FS_IOC32_GETFLAGS		_IOR('f', 1, int)
211607ca46eSDavid Howells #define FS_IOC32_SETFLAGS		_IOW('f', 2, int)
212607ca46eSDavid Howells #define FS_IOC32_GETVERSION		_IOR('v', 1, int)
213607ca46eSDavid Howells #define FS_IOC32_SETVERSION		_IOW('v', 2, int)
214334e580aSDave Chinner #define FS_IOC_FSGETXATTR		_IOR('X', 31, struct fsxattr)
215334e580aSDave Chinner #define FS_IOC_FSSETXATTR		_IOW('X', 32, struct fsxattr)
21662750d04SEric Sandeen #define FS_IOC_GETFSLABEL		_IOR(0x94, 49, char[FSLABEL_MAX])
21762750d04SEric Sandeen #define FS_IOC_SETFSLABEL		_IOW(0x94, 50, char[FSLABEL_MAX])
218607ca46eSDavid Howells 
219607ca46eSDavid Howells /*
220607ca46eSDavid Howells  * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS)
22168ce7bfcSTheodore Ts'o  *
22268ce7bfcSTheodore Ts'o  * Note: for historical reasons, these flags were originally used and
22368ce7bfcSTheodore Ts'o  * defined for use by ext2/ext3, and then other file systems started
22468ce7bfcSTheodore Ts'o  * using these flags so they wouldn't need to write their own version
22568ce7bfcSTheodore Ts'o  * of chattr/lsattr (which was shipped as part of e2fsprogs).  You
22668ce7bfcSTheodore Ts'o  * should think twice before trying to use these flags in new
22768ce7bfcSTheodore Ts'o  * contexts, or trying to assign these flags, since they are used both
22868ce7bfcSTheodore Ts'o  * as the UAPI and the on-disk encoding for ext2/3/4.  Also, we are
22968ce7bfcSTheodore Ts'o  * almost out of 32-bit flags.  :-)
23068ce7bfcSTheodore Ts'o  *
23168ce7bfcSTheodore Ts'o  * We have recently hoisted FS_IOC_FSGETXATTR / FS_IOC_FSSETXATTR from
23268ce7bfcSTheodore Ts'o  * XFS to the generic FS level interface.  This uses a structure that
23368ce7bfcSTheodore Ts'o  * has padding and hence has more room to grow, so it may be more
23468ce7bfcSTheodore Ts'o  * appropriate for many new use cases.
23568ce7bfcSTheodore Ts'o  *
23668ce7bfcSTheodore Ts'o  * Please do not change these flags or interfaces before checking with
23768ce7bfcSTheodore Ts'o  * linux-fsdevel@vger.kernel.org and linux-api@vger.kernel.org.
238607ca46eSDavid Howells  */
239607ca46eSDavid Howells #define	FS_SECRM_FL			0x00000001 /* Secure deletion */
240607ca46eSDavid Howells #define	FS_UNRM_FL			0x00000002 /* Undelete */
241607ca46eSDavid Howells #define	FS_COMPR_FL			0x00000004 /* Compress file */
242607ca46eSDavid Howells #define FS_SYNC_FL			0x00000008 /* Synchronous updates */
243607ca46eSDavid Howells #define FS_IMMUTABLE_FL			0x00000010 /* Immutable file */
244607ca46eSDavid Howells #define FS_APPEND_FL			0x00000020 /* writes to file may only append */
245607ca46eSDavid Howells #define FS_NODUMP_FL			0x00000040 /* do not dump file */
246607ca46eSDavid Howells #define FS_NOATIME_FL			0x00000080 /* do not update atime */
247607ca46eSDavid Howells /* Reserved for compression usage... */
248607ca46eSDavid Howells #define FS_DIRTY_FL			0x00000100
249607ca46eSDavid Howells #define FS_COMPRBLK_FL			0x00000200 /* One or more compressed clusters */
250607ca46eSDavid Howells #define FS_NOCOMP_FL			0x00000400 /* Don't compress */
251607ca46eSDavid Howells /* End compression flags --- maybe not all used */
25268ce7bfcSTheodore Ts'o #define FS_ENCRYPT_FL			0x00000800 /* Encrypted file */
253607ca46eSDavid Howells #define FS_BTREE_FL			0x00001000 /* btree format dir */
254607ca46eSDavid Howells #define FS_INDEX_FL			0x00001000 /* hash-indexed directory */
255607ca46eSDavid Howells #define FS_IMAGIC_FL			0x00002000 /* AFS directory */
256607ca46eSDavid Howells #define FS_JOURNAL_DATA_FL		0x00004000 /* Reserved for ext3 */
257607ca46eSDavid Howells #define FS_NOTAIL_FL			0x00008000 /* file tail should not be merged */
258607ca46eSDavid Howells #define FS_DIRSYNC_FL			0x00010000 /* dirsync behaviour (directories only) */
259607ca46eSDavid Howells #define FS_TOPDIR_FL			0x00020000 /* Top of directory hierarchies*/
26068ce7bfcSTheodore Ts'o #define FS_HUGE_FILE_FL			0x00040000 /* Reserved for ext4 */
261607ca46eSDavid Howells #define FS_EXTENT_FL			0x00080000 /* Extents */
262fe9918d3SEric Biggers #define FS_VERITY_FL			0x00100000 /* Verity protected inode */
26368ce7bfcSTheodore Ts'o #define FS_EA_INODE_FL			0x00200000 /* Inode used for large EA */
26468ce7bfcSTheodore Ts'o #define FS_EOFBLOCKS_FL			0x00400000 /* Reserved for ext4 */
265607ca46eSDavid Howells #define FS_NOCOW_FL			0x00800000 /* Do not cow file */
266b383a73fSIra Weiny #define FS_DAX_FL			0x02000000 /* Inode is DAX */
26768ce7bfcSTheodore Ts'o #define FS_INLINE_DATA_FL		0x10000000 /* Reserved for ext4 */
2688b4953e1STheodore Ts'o #define FS_PROJINHERIT_FL		0x20000000 /* Create with parents projid */
26971e90b46SDaniel Rosenberg #define FS_CASEFOLD_FL			0x40000000 /* Folder is case insensitive */
270607ca46eSDavid Howells #define FS_RESERVED_FL			0x80000000 /* reserved for ext2 lib */
271607ca46eSDavid Howells 
272607ca46eSDavid Howells #define FS_FL_USER_VISIBLE		0x0003DFFF /* User visible flags */
273607ca46eSDavid Howells #define FS_FL_USER_MODIFIABLE		0x000380FF /* User modifiable flags */
274607ca46eSDavid Howells 
275607ca46eSDavid Howells 
276607ca46eSDavid Howells #define SYNC_FILE_RANGE_WAIT_BEFORE	1
277607ca46eSDavid Howells #define SYNC_FILE_RANGE_WRITE		2
278607ca46eSDavid Howells #define SYNC_FILE_RANGE_WAIT_AFTER	4
279c553ea4fSAmir Goldstein #define SYNC_FILE_RANGE_WRITE_AND_WAIT	(SYNC_FILE_RANGE_WRITE | \
280c553ea4fSAmir Goldstein 					 SYNC_FILE_RANGE_WAIT_BEFORE | \
281c553ea4fSAmir Goldstein 					 SYNC_FILE_RANGE_WAIT_AFTER)
282607ca46eSDavid Howells 
283ddef7ed2SChristoph Hellwig /*
284ddef7ed2SChristoph Hellwig  * Flags for preadv2/pwritev2:
285ddef7ed2SChristoph Hellwig  */
28697be7ebeSChristoph Hellwig 
287ddef7ed2SChristoph Hellwig typedef int __bitwise __kernel_rwf_t;
288ddef7ed2SChristoph Hellwig 
289ddef7ed2SChristoph Hellwig /* high priority request, poll if possible */
290ddef7ed2SChristoph Hellwig #define RWF_HIPRI	((__force __kernel_rwf_t)0x00000001)
291ddef7ed2SChristoph Hellwig 
292ddef7ed2SChristoph Hellwig /* per-IO O_DSYNC */
293ddef7ed2SChristoph Hellwig #define RWF_DSYNC	((__force __kernel_rwf_t)0x00000002)
294ddef7ed2SChristoph Hellwig 
295ddef7ed2SChristoph Hellwig /* per-IO O_SYNC */
296ddef7ed2SChristoph Hellwig #define RWF_SYNC	((__force __kernel_rwf_t)0x00000004)
297ddef7ed2SChristoph Hellwig 
298ddef7ed2SChristoph Hellwig /* per-IO, return -EAGAIN if operation would block */
299ddef7ed2SChristoph Hellwig #define RWF_NOWAIT	((__force __kernel_rwf_t)0x00000008)
300ddef7ed2SChristoph Hellwig 
301e1fc742eSJürg Billeter /* per-IO O_APPEND */
302e1fc742eSJürg Billeter #define RWF_APPEND	((__force __kernel_rwf_t)0x00000010)
303e1fc742eSJürg Billeter 
304ddef7ed2SChristoph Hellwig /* mask of flags supported by the kernel */
305e1fc742eSJürg Billeter #define RWF_SUPPORTED	(RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\
306e1fc742eSJürg Billeter 			 RWF_APPEND)
307fdd2f5b7SGoldwyn Rodrigues 
308607ca46eSDavid Howells #endif /* _UAPI_LINUX_FS_H */
309