diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2010-10-01 17:20:22 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-10-25 21:18:21 -0400 |
commit | 4a3956c790290efeb647bbb0c3a90476bb57800e (patch) | |
tree | 18abb41325273d23ae271e49627f01054c5baeb6 /include/linux/fs.h | |
parent | ba10f486658c0ca1bc84c936f6a996e40d071453 (diff) |
vfs: introduce FMODE_UNSIGNED_OFFSET for allowing negative f_pos
Now, rw_verify_area() checsk f_pos is negative or not. And if negative,
returns -EINVAL.
But, some special files as /dev/(k)mem and /proc/<pid>/mem etc.. has
negative offsets. And we can't do any access via read/write to the
file(device).
So introduce FMODE_UNSIGNED_OFFSET to allow negative file offsets.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 0cd6821013a0..7fc126df1c42 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -92,6 +92,9 @@ struct inodes_stat_t { | |||
92 | /* Expect random access pattern */ | 92 | /* Expect random access pattern */ |
93 | #define FMODE_RANDOM ((__force fmode_t)0x1000) | 93 | #define FMODE_RANDOM ((__force fmode_t)0x1000) |
94 | 94 | ||
95 | /* File is huge (eg. /dev/kmem): treat loff_t as unsigned */ | ||
96 | #define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000) | ||
97 | |||
95 | /* File was opened by fanotify and shouldn't generate fanotify events */ | 98 | /* File was opened by fanotify and shouldn't generate fanotify events */ |
96 | #define FMODE_NONOTIFY ((__force fmode_t)0x1000000) | 99 | #define FMODE_NONOTIFY ((__force fmode_t)0x1000000) |
97 | 100 | ||