fix
authorMiklos Szeredi <miklos@szeredi.hu>
Fri, 7 Jan 2005 11:14:15 +0000 (11:14 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Fri, 7 Jan 2005 11:14:15 +0000 (11:14 +0000)
ChangeLog
kernel/dev.c
kernel/file.c
kernel/inode.c

index da93c2b10159879ae144dc3db712064aed6bfdd4..2a5d69f54722f0458a8b242cd163b41363830246 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-01-07  Miklos Szeredi <miklos@szeredi.hu>
+
+       * Compile fix by Christian Magnusson
+
 2005-01-05  Miklos Szeredi <miklos@szeredi.hu>
 
        * Fix compilation for 2.6.{0-5} kernels
index a2a44e48820c70a07823c7f0e40b9e3bea3fbeed..e04fe3c22fcedd6fd051d55c2833af30cb452f65 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/miscdevice.h>
 #include <linux/pagemap.h>
 #include <linux/file.h>
+#include <linux/slab.h>
 
 static kmem_cache_t *fuse_req_cachep;
 
index b7359c5206c8e1c0a89996a097a6f8f4c9259120..7a69cb8cd096cb8806deba16827c5f273d101ad6 100644 (file)
@@ -65,18 +65,16 @@ static int fuse_open(struct inode *inode, struct file *file)
        req->out.args[0].value = &outarg;
        request_send(fc, req);
        err = req->out.h.error;
-       if (!err && !(fc->flags & FUSE_KERNEL_CACHE)) {
+       if (!err && !(fc->flags & FUSE_KERNEL_CACHE))
 #ifdef KERNEL_2_6
                invalidate_inode_pages(inode->i_mapping);
 #else
                invalidate_inode_pages(inode);
 #endif
-       }
        if (err) {
                fuse_request_free(ff->release_req);
                kfree(ff);
-       }
-       else {
+       } else {
                ff->fh = outarg.fh;
                file->private_data = ff;
        }
@@ -605,17 +603,25 @@ static int fuse_file_mmap(struct file *file, struct vm_area_struct *vma)
 
        if (fc->flags & FUSE_DIRECT_IO)
                return -ENODEV;
-       else {
-               if ((vma->vm_flags & VM_SHARED)) {
-                       if ((vma->vm_flags & VM_WRITE))
-                               return -ENODEV;
-                       else
-                               vma->vm_flags &= ~VM_MAYWRITE;
-               }
-               return generic_file_mmap(file, vma);
+
+       if ((vma->vm_flags & VM_SHARED)) {
+               if ((vma->vm_flags & VM_WRITE))
+                       return -ENODEV;
+               else
+                       vma->vm_flags &= ~VM_MAYWRITE;
        }
+       return generic_file_mmap(file, vma);
 }
 
+#ifdef KERNEL_2_6
+static int fuse_set_page_dirty(struct page *page)
+{
+       printk("fuse_set_page_dirty: should not happen\n");
+       dump_stack();
+       return 0;
+}
+#endif
+
 static struct file_operations fuse_file_operations = {
        .read           = fuse_file_read,
        .write          = fuse_file_write,
@@ -635,7 +641,7 @@ static struct address_space_operations fuse_file_aops  = {
        .commit_write   = fuse_commit_write,
 #ifdef KERNEL_2_6
        .readpages      = fuse_readpages,
-       .set_page_dirty = __set_page_dirty_nobuffers,
+       .set_page_dirty = fuse_set_page_dirty,
 #endif
 };
 
index 525a5b667ddb7252c4ed7342277210e225a9fae8..c197d70d8540541a996fd2023dd2c6df7fc67930 100644 (file)
@@ -27,15 +27,19 @@ static kmem_cache_t *fuse_inode_cachep;
 static int mount_count;
 
 static int user_allow_other;
-static int mount_max = 1000;
 #ifdef KERNEL_2_6
 module_param(user_allow_other, int, 0644);
-module_param(mount_max, int, 0644);
 #else
 MODULE_PARM(user_allow_other, "i");
-MODULE_PARM(mount_max, "i");
 #endif
 MODULE_PARM_DESC(user_allow_other, "Allow non root user to specify the \"allow_other\" or \"allow_root\" mount options");
+
+static int mount_max = 1000;
+#ifdef KERNEL_2_6
+module_param(mount_max, int, 0644);
+#else
+MODULE_PARM(mount_max, "i");
+#endif
 MODULE_PARM_DESC(mount_max, "Maximum number of FUSE mounts allowed, if -1 then unlimited (default: 1000)");
 
 #define FUSE_SUPER_MAGIC 0x65735546