Merge branch 'thermal/next' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal...
[linux-block.git] / include / uapi / linux / fcntl.h
CommitLineData
6f52b16c 1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
607ca46e
DH
2#ifndef _UAPI_LINUX_FCNTL_H
3#define _UAPI_LINUX_FCNTL_H
4
5#include <asm/fcntl.h>
6
7#define F_SETLEASE (F_LINUX_SPECIFIC_BASE + 0)
8#define F_GETLEASE (F_LINUX_SPECIFIC_BASE + 1)
9
10/*
11 * Cancel a blocking posix lock; internal use only until we expose an
12 * asynchronous lock api to userspace:
13 */
14#define F_CANCELLK (F_LINUX_SPECIFIC_BASE + 5)
15
16/* Create a file descriptor with FD_CLOEXEC set. */
17#define F_DUPFD_CLOEXEC (F_LINUX_SPECIFIC_BASE + 6)
18
19/*
20 * Request nofications on a directory.
21 * See below for events that may be notified.
22 */
23#define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2)
24
25/*
26 * Set and get of pipe page size array
27 */
28#define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
29#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
30
40e041a2
DH
31/*
32 * Set/Get seals
33 */
34#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
35#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
36
37/*
38 * Types of seals
39 */
40#define F_SEAL_SEAL 0x0001 /* prevent further seals from being set */
41#define F_SEAL_SHRINK 0x0002 /* prevent file from shrinking */
42#define F_SEAL_GROW 0x0004 /* prevent file from growing */
43#define F_SEAL_WRITE 0x0008 /* prevent writes */
ab3948f5 44#define F_SEAL_FUTURE_WRITE 0x0010 /* prevent future writes while mapped */
40e041a2
DH
45/* (1U << 31) is reserved for signed error codes */
46
c75b1d94
JA
47/*
48 * Set/Get write life time hints. {GET,SET}_RW_HINT operate on the
49 * underlying inode, while {GET,SET}_FILE_RW_HINT operate only on
50 * the specific file.
51 */
52#define F_GET_RW_HINT (F_LINUX_SPECIFIC_BASE + 11)
53#define F_SET_RW_HINT (F_LINUX_SPECIFIC_BASE + 12)
54#define F_GET_FILE_RW_HINT (F_LINUX_SPECIFIC_BASE + 13)
55#define F_SET_FILE_RW_HINT (F_LINUX_SPECIFIC_BASE + 14)
56
57/*
58 * Valid hint values for F_{GET,SET}_RW_HINT. 0 is "not set", or can be
59 * used to clear any hints previously set.
60 */
9a7f12ed 61#define RWH_WRITE_LIFE_NOT_SET 0
c75b1d94
JA
62#define RWH_WRITE_LIFE_NONE 1
63#define RWH_WRITE_LIFE_SHORT 2
64#define RWH_WRITE_LIFE_MEDIUM 3
65#define RWH_WRITE_LIFE_LONG 4
66#define RWH_WRITE_LIFE_EXTREME 5
67
9a7f12ed
ES
68/*
69 * The originally introduced spelling is remained from the first
70 * versions of the patch set that introduced the feature, see commit
71 * v4.13-rc1~212^2~51.
72 */
73#define RWF_WRITE_LIFE_NOT_SET RWH_WRITE_LIFE_NOT_SET
74
607ca46e
DH
75/*
76 * Types of directory notifications that may be requested.
77 */
78#define DN_ACCESS 0x00000001 /* File accessed */
79#define DN_MODIFY 0x00000002 /* File modified */
80#define DN_CREATE 0x00000004 /* File created */
81#define DN_DELETE 0x00000008 /* File removed */
82#define DN_RENAME 0x00000010 /* File renamed */
83#define DN_ATTRIB 0x00000020 /* File changed attibutes */
84#define DN_MULTISHOT 0x80000000 /* Don't remove notifier */
85
86#define AT_FDCWD -100 /* Special value used to indicate
87 openat should use the current
88 working directory. */
89#define AT_SYMLINK_NOFOLLOW 0x100 /* Do not follow symbolic links. */
90#define AT_REMOVEDIR 0x200 /* Remove directory instead of
91 unlinking file. */
92#define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */
93#define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount traversal */
94#define AT_EMPTY_PATH 0x1000 /* Allow empty relative pathname */
95
a528d35e
DH
96#define AT_STATX_SYNC_TYPE 0x6000 /* Type of synchronisation required from statx() */
97#define AT_STATX_SYNC_AS_STAT 0x0000 /* - Do whatever stat() does */
98#define AT_STATX_FORCE_SYNC 0x2000 /* - Force the attributes to be sync'd with the server */
99#define AT_STATX_DONT_SYNC 0x4000 /* - Don't sync attributes with the server */
100
a07b2000
AV
101#define AT_RECURSIVE 0x8000 /* Apply to the entire subtree */
102
607ca46e
DH
103
104#endif /* _UAPI_LINUX_FCNTL_H */