]> err.no Git - linux-2.6/blobdiff - fs/fuse/inode.c
[PATCH] ufs: ubh_ll_rw_block cleanup
[linux-2.6] / fs / fuse / inode.c
index fd34037b05884accd3148b62bee4ddf68557fd94..a13c0f529058f89000a6559d5cd893436b4607f8 100644 (file)
@@ -236,8 +236,9 @@ static void convert_fuse_statfs(struct kstatfs *stbuf, struct fuse_kstatfs *attr
        /* fsid is left zero */
 }
 
-static int fuse_statfs(struct super_block *sb, struct kstatfs *buf)
+static int fuse_statfs(struct dentry *dentry, struct kstatfs *buf)
 {
+       struct super_block *sb = dentry->d_sb;
        struct fuse_conn *fc = get_fuse_conn_super(sb);
        struct fuse_req *req;
        struct fuse_statfs_out outarg;
@@ -500,11 +501,6 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
        if (file->f_op != &fuse_dev_operations)
                return -EINVAL;
 
-       /* Setting file->private_data can't race with other mount()
-          instances, since BKL is held for ->get_sb() */
-       if (file->private_data)
-               return -EINVAL;
-
        fc = new_conn();
        if (!fc)
                return -ENOMEM;
@@ -540,6 +536,12 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
        if (err)
                goto err_free_req;
 
+       /* Setting file->private_data can't race with other mount()
+          instances, since BKL is held for ->get_sb() */
+       err = -EINVAL;
+       if (file->private_data)
+               goto err_kobject_del;
+
        sb->s_root = root_dentry;
        fc->mounted = 1;
        fc->connected = 1;
@@ -556,6 +558,8 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
 
        return 0;
 
+ err_kobject_del:
+       kobject_del(&fc->kobj);
  err_free_req:
        fuse_request_free(init_req);
  err_put_root:
@@ -566,11 +570,11 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
        return err;
 }
 
-static struct super_block *fuse_get_sb(struct file_system_type *fs_type,
-                                      int flags, const char *dev_name,
-                                      void *raw_data)
+static int fuse_get_sb(struct file_system_type *fs_type,
+                      int flags, const char *dev_name,
+                      void *raw_data, struct vfsmount *mnt)
 {
-       return get_sb_nodev(fs_type, flags, raw_data, fuse_fill_super);
+       return get_sb_nodev(fs_type, flags, raw_data, fuse_fill_super, mnt);
 }
 
 static struct file_system_type fuse_fs_type = {