fix
authorMiklos Szeredi <miklos@szeredi.hu>
Fri, 2 Sep 2005 13:05:06 +0000 (13:05 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Fri, 2 Sep 2005 13:05:06 +0000 (13:05 +0000)
ChangeLog
kernel/dir.c
kernel/fuse_i.h
kernel/fuse_kernel.h

index c44e8ffff8ce76dd03ef6dfe05c7bda9adc8bb91..f5a332439895980c7e0f8bc91747f30b71c0d682 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-09-02  Miklos Szeredi <miklos@szeredi.hu>
+
+       * Don't call ACCESS on open.  Will do this properly with atomic
+       open/create
+
+       * Fix compile warning on 2.6.13 and later
+
 2005-08-25  Miklos Szeredi <miklos@szeredi.hu>
 
        * lib: add userspace side of ftruncate() method for experimentation
index f2fe170f74ba8a4a69c57e92e6ae77b50af47659..f1baf782b1e37a919cecb051295b0936b53829e2 100644 (file)
@@ -552,9 +552,7 @@ static int fuse_permission(struct inode *inode, int mask, struct nameidata *nd)
                        return -EACCES;
 
                err = 0;
-               if (nd &&
-                   ((nd->flags & LOOKUP_ACCESS) ||
-                    ((nd->flags & LOOKUP_OPEN) && mode != 0)))
+               if (nd && (nd->flags & LOOKUP_ACCESS))
                        err = fuse_access(inode, mask);
        }
        return err;
@@ -662,7 +660,18 @@ static void free_link(char *link)
                free_page((unsigned long) link);
 }
 
-#ifdef KERNEL_2_6_8_PLUS
+#ifdef KERNEL_2_6_13_PLUS
+static void *fuse_follow_link(struct dentry *dentry, struct nameidata *nd)
+{
+       nd_set_link(nd, read_link(dentry));
+       return NULL;
+}
+
+static void fuse_put_link(struct dentry *dentry, struct nameidata *nd, void *c)
+{
+       free_link(nd_get_link(nd));
+}
+#elif defined(KERNEL_2_6_8_PLUS)
 static int fuse_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
        nd_set_link(nd, read_link(dentry));
index 08c6debe50e98695163da9aecc5ab4bbfbe72c06..1f30d82b6cee144bfeae4e85c48f3f78149d35d1 100644 (file)
@@ -28,6 +28,9 @@
 #  if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
 #    define KERNEL_2_6_10_PLUS
 #  endif
+#  if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
+#    define KERNEL_2_6_13_PLUS
+#  endif
 #endif
 
 #include "config.h"
index e1d8a0c8638fffbb2adbe2ac441c19a1041a47f1..c668c6833a1357259fffd155e64ca522ba8fe620 100644 (file)
@@ -63,6 +63,7 @@ struct fuse_file_lock {
        __u32   type;
 };
 
+/** Valid attribute mask used in the SETATTR request */
 #define FATTR_MODE     (1 << 0)
 #define FATTR_UID      (1 << 1)
 #define FATTR_GID      (1 << 2)
@@ -71,6 +72,12 @@ struct fuse_file_lock {
 #define FATTR_MTIME    (1 << 5)
 #define FATTR_CTIME    (1 << 6)
 
+/**
+ * Flags returned by the OPEN request
+ *
+ * FOPEN_DIRECT_IO: bypass page cache for this open file
+ * FOPEN_KEEP_CACHE: don't invalidate the data cache on open
+ */
 #define FOPEN_DIRECT_IO                (1 << 0)
 #define FOPEN_KEEP_CACHE       (1 << 1)