summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/fs.h
diff options
context:
space:
mode:
authorJürg Billeter2017-09-29 14:07:17 +0200
committerAl Viro2018-01-26 01:32:55 +0100
commite1fc742e14e01d84d9693c4aca4ab23da65811fb (patch)
tree5f6aa92ad10ebd83a667d246b17c8fb4e3cb8f4e /include/uapi/linux/fs.h
parentsctp: use vmemdup_user() rather than badly open-coding memdup_user() (diff)
downloadkernel-qcow2-linux-e1fc742e14e01d84d9693c4aca4ab23da65811fb.tar.gz
kernel-qcow2-linux-e1fc742e14e01d84d9693c4aca4ab23da65811fb.tar.xz
kernel-qcow2-linux-e1fc742e14e01d84d9693c4aca4ab23da65811fb.zip
fs: add RWF_APPEND
This is the per-I/O equivalent of O_APPEND to support atomic append operations on any open file. If a file is opened with O_APPEND, pwrite() ignores the offset and always appends data to the end of the file. RWF_APPEND enables atomic append and pwrite() with offset on a single file descriptor. Signed-off-by: Jürg Billeter <j@bitron.ch> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/uapi/linux/fs.h')
-rw-r--r--include/uapi/linux/fs.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h
index 4199f8acbce5..d2a8313fabd7 100644
--- a/include/uapi/linux/fs.h
+++ b/include/uapi/linux/fs.h
@@ -377,7 +377,11 @@ typedef int __bitwise __kernel_rwf_t;
/* per-IO, return -EAGAIN if operation would block */
#define RWF_NOWAIT ((__force __kernel_rwf_t)0x00000008)
+/* per-IO O_APPEND */
+#define RWF_APPEND ((__force __kernel_rwf_t)0x00000010)
+
/* mask of flags supported by the kernel */
-#define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT)
+#define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\
+ RWF_APPEND)
#endif /* _UAPI_LINUX_FS_H */