Slab API: remove useless ctor parameter and reorder parameters
[deliverable/linux.git] / fs / fuse / inode.c
index 1397018ff47665e28bead1fb5a75592703c762c9..8079884456854509313920883559b48c75fb7718 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/parser.h>
 #include <linux/statfs.h>
 #include <linux/random.h>
+#include <linux/sched.h>
 
 MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>");
 MODULE_DESCRIPTION("Filesystem in Userspace");
@@ -400,6 +401,7 @@ static int fuse_show_options(struct seq_file *m, struct vfsmount *mnt)
 static struct fuse_conn *new_conn(void)
 {
        struct fuse_conn *fc;
+       int err;
 
        fc = kzalloc(sizeof(*fc), GFP_KERNEL);
        if (fc) {
@@ -415,10 +417,17 @@ static struct fuse_conn *new_conn(void)
                atomic_set(&fc->num_waiting, 0);
                fc->bdi.ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE;
                fc->bdi.unplug_io_fn = default_unplug_io_fn;
+               err = bdi_init(&fc->bdi);
+               if (err) {
+                       kfree(fc);
+                       fc = NULL;
+                       goto out;
+               }
                fc->reqctr = 0;
                fc->blocked = 1;
                get_random_bytes(&fc->scramble_key, sizeof(fc->scramble_key));
        }
+out:
        return fc;
 }
 
@@ -428,6 +437,7 @@ void fuse_conn_put(struct fuse_conn *fc)
                if (fc->destroy_req)
                        fuse_request_free(fc->destroy_req);
                mutex_destroy(&fc->inst_mutex);
+               bdi_destroy(&fc->bdi);
                kfree(fc);
        }
 }
@@ -453,6 +463,7 @@ static const struct super_operations fuse_super_operations = {
        .destroy_inode  = fuse_destroy_inode,
        .read_inode     = fuse_read_inode,
        .clear_inode    = fuse_clear_inode,
+       .drop_inode     = generic_delete_inode,
        .remount_fs     = fuse_remount_fs,
        .put_super      = fuse_put_super,
        .umount_begin   = fuse_umount_begin,
@@ -653,10 +664,9 @@ static int fuse_get_sb_blk(struct file_system_type *fs_type,
 static struct file_system_type fuseblk_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "fuseblk",
-       .fs_flags       = FS_HAS_SUBTYPE,
        .get_sb         = fuse_get_sb_blk,
        .kill_sb        = kill_block_super,
-       .fs_flags       = FS_REQUIRES_DEV,
+       .fs_flags       = FS_REQUIRES_DEV | FS_HAS_SUBTYPE,
 };
 
 static inline int register_fuseblk(void)
@@ -682,13 +692,11 @@ static inline void unregister_fuseblk(void)
 static decl_subsys(fuse, NULL, NULL);
 static decl_subsys(connections, NULL, NULL);
 
-static void fuse_inode_init_once(void *foo, struct kmem_cache *cachep,
-                                unsigned long flags)
+static void fuse_inode_init_once(struct kmem_cache *cachep, void *foo)
 {
        struct inode * inode = foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(inode);
+       inode_init_once(inode);
 }
 
 static int __init fuse_fs_init(void)
@@ -706,7 +714,7 @@ static int __init fuse_fs_init(void)
        fuse_inode_cachep = kmem_cache_create("fuse_inode",
                                              sizeof(struct fuse_inode),
                                              0, SLAB_HWCACHE_ALIGN,
-                                             fuse_inode_init_once, NULL);
+                                             fuse_inode_init_once);
        err = -ENOMEM;
        if (!fuse_inode_cachep)
                goto out_unreg2;
This page took 0.028242 seconds and 5 git commands to generate.