Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fuse: implement nonseekable open

Let the client request nonseekable open using FOPEN_NONSEEKABLE and
call nonseekable_open() on the file if requested.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>

authored by

Tejun Heo and committed by
Miklos Szeredi
a7c1b990 29d434b3

+8 -1
+2
fs/fuse/file.c
··· 101 101 file->f_op = &fuse_direct_io_file_operations; 102 102 if (!(outarg->open_flags & FOPEN_KEEP_CACHE)) 103 103 invalidate_inode_pages2(inode->i_mapping); 104 + if (outarg->open_flags & FOPEN_NONSEEKABLE) 105 + nonseekable_open(inode, file); 104 106 ff->fh = outarg->fh; 105 107 file->private_data = fuse_file_get(ff); 106 108 }
+6 -1
include/linux/fuse.h
··· 17 17 * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in 18 18 * - add blksize field to fuse_attr 19 19 * - add file flags field to fuse_read_in and fuse_write_in 20 + * 21 + * 7.10 22 + * - add nonseekable open flag 20 23 */ 21 24 22 25 #ifndef _LINUX_FUSE_H ··· 32 29 #define FUSE_KERNEL_VERSION 7 33 30 34 31 /** Minor version number of this interface */ 35 - #define FUSE_KERNEL_MINOR_VERSION 9 32 + #define FUSE_KERNEL_MINOR_VERSION 10 36 33 37 34 /** The node ID of the root inode */ 38 35 #define FUSE_ROOT_ID 1 ··· 104 101 * 105 102 * FOPEN_DIRECT_IO: bypass page cache for this open file 106 103 * FOPEN_KEEP_CACHE: don't invalidate the data cache on open 104 + * FOPEN_NONSEEKABLE: the file is not seekable 107 105 */ 108 106 #define FOPEN_DIRECT_IO (1 << 0) 109 107 #define FOPEN_KEEP_CACHE (1 << 1) 108 + #define FOPEN_NONSEEKABLE (1 << 2) 110 109 111 110 /** 112 111 * INIT request/reply flags