From 1548d6d880fbcc83d57825b6357f7fa0be8148f8 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 7 Jan 2017 19:14:29 +0100 Subject: splice: introduce FMODE_SPLICE_READ and FMODE_SPLICE_WRITE Introduce FMODE_SPLICE_READ and FMODE_SPLICE_WRITE. These modes check whether it is legal to read or write a file using splice. Both get automatically set on regular files and are not checked when a 'struct fileoperations' includes the splice_{read,write} methods. Change-Id: Ice6a3fab20bf0ac131f8d908f4bb0f7dc34bf4e3 Suggested-by: Linus Torvalds Cc: Al Viro Signed-off-by: Johannes Thumshirn --- include/linux/fs.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/linux/fs.h') diff --git a/include/linux/fs.h b/include/linux/fs.h index 264a4f9cf..7b0583da9 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -136,6 +136,11 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, */ #define CHECK_IOVEC_ONLY -1 +/* File can be read using splice */ +#define FMODE_SPLICE_READ ((__force fmode_t)0x8000000) +/* File can be written using splice */ +#define FMODE_SPLICE_WRITE ((__force fmode_t)0x10000000) + /* * The below are the various read and write types that we support. Some of * them include behavioral modifiers that send information down to the -- cgit v1.2.3