From: Tejun H. <tj...@ke...> - 2008-11-20 15:18:13
|
If open sets fi->nonseekable, libfuse will tell the kernel that the file is not seekable. Signed-off-by: Tejun Heo <tj...@ke...> --- include/fuse_common.h | 6 +++++- include/fuse_kernel.h | 2 ++ lib/fuse_lowlevel.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletions(-) diff --git a/include/fuse_common.h b/include/fuse_common.h index f9c6c72..4d37acf 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -65,8 +65,12 @@ struct fuse_file_info { operation. Introduced in version 2.6 */ unsigned int flush : 1; + /** Can be filled in by open, to indicate that the file is not + seekable. Introduced in version 2.9 */ + unsigned int nonseekable : 1; + /** Padding. Do not use*/ - unsigned int padding : 29; + unsigned int padding : 28; /** File handle. May be filled in by filesystem in open(). Available in all other file operations */ diff --git a/include/fuse_kernel.h b/include/fuse_kernel.h index 06f1f1a..3e87106 100644 --- a/include/fuse_kernel.h +++ b/include/fuse_kernel.h @@ -134,9 +134,11 @@ struct fuse_file_lock { * * FOPEN_DIRECT_IO: bypass page cache for this open file * FOPEN_KEEP_CACHE: don't invalidate the data cache on open + * FOPEN_NONSEEKABLE: the file is not seekable */ #define FOPEN_DIRECT_IO (1 << 0) #define FOPEN_KEEP_CACHE (1 << 1) +#define FOPEN_NONSEEKABLE (1 << 2) /** * INIT request/reply flags diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index 9d9424d..35c4608 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -325,6 +325,8 @@ static void fill_open(struct fuse_open_out *arg, arg->open_flags |= FOPEN_DIRECT_IO; if (f->keep_cache) arg->open_flags |= FOPEN_KEEP_CACHE; + if (f->nonseekable) + arg->open_flags |= FOPEN_NONSEEKABLE; } int fuse_reply_entry(fuse_req_t req, const struct fuse_entry_param *e) -- 1.5.6 |