If open sets fi->nonseekable, libfuse will tell the kernel that the file is not seeka...
authorMiklos Szeredi <miklos@szeredi.hu>
Fri, 28 Nov 2008 15:12:48 +0000 (15:12 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Fri, 28 Nov 2008 15:12:48 +0000 (15:12 +0000)
ChangeLog
include/fuse_common.h
include/fuse_kernel.h
lib/fuse_lowlevel.c

index 5487d5939e76ecf06f534aaec68faa13ca3b61af..d6de6ff0f0bad8ffadcfc5956d6dc9251547e9c9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-28  Miklos Szeredi <miklos@szeredi.hu>
+
+       * If open sets fi->nonseekable, libfuse will tell the kernel that
+       the file is not seekable.  Patch by Tejun Heo
+
 2008-11-19  Miklos Szeredi <miklos@szeredi.hu>
 
        * lowlevel lib: fix deadlock if fuse_reply_* is called from the
index 2543225d40001be6f96caccb2f79a2d79ce17cf8..9bbc3868fd22a05ff5fa6f8b3c981f81f15fd997 100644 (file)
@@ -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 */
index c9c4c7e557bf0324e6dec22069e3da4a2d6b512b..b37d9696ae261e57d9607ae8f608ba5318d239f5 100644 (file)
  *  - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in
  *  - add blksize field to fuse_attr
  *  - add file flags field to fuse_read_in and fuse_write_in
+ *
+ * 7.10
+ *  - add nonseekable open flag
  */
 
+#ifndef _LINUX_FUSE_H
+#define _LINUX_FUSE_H
+
 #ifndef linux
 #include <sys/types.h>
 #define __u64 uint64_t
@@ -59,7 +65,7 @@
 #define FUSE_KERNEL_VERSION 7
 
 /** Minor version number of this interface */
-#define FUSE_KERNEL_MINOR_VERSION 9
+#define FUSE_KERNEL_MINOR_VERSION 10
 
 /** The node ID of the root inode */
 #define FUSE_ROOT_ID 1
@@ -131,17 +137,22 @@ 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
+ *
+ * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
  */
 #define FUSE_ASYNC_READ                (1 << 0)
 #define FUSE_POSIX_LOCKS       (1 << 1)
 #define FUSE_FILE_OPS          (1 << 2)
 #define FUSE_ATOMIC_O_TRUNC    (1 << 3)
+#define FUSE_EXPORT_SUPPORT    (1 << 4)
 #define FUSE_BIG_WRITES                (1 << 5)
 
 /**
@@ -439,3 +450,5 @@ struct fuse_dirent {
 #define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1))
 #define FUSE_DIRENT_SIZE(d) \
        FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
+
+#endif /* _LINUX_FUSE_H */
index 99fbfe36ca8ca2dc720a468a43226cb226957043..34ff76cb7ea0f97ad17bb5d1e2a31aa1256123a7 100644 (file)
@@ -322,6 +322,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)