fs: icache RCU free inodes
[deliverable/linux.git] / net / sunrpc / rpc_pipe.c
index 52f252432144ab439c9083acf20e8d487fbbd12d..2899fe27f8805229c9878d99a4c7afc6f9526d7b 100644 (file)
@@ -28,7 +28,7 @@
 #include <linux/sunrpc/rpc_pipe_fs.h>
 #include <linux/sunrpc/cache.h>
 
-static struct vfsmount *rpc_mount __read_mostly;
+static struct vfsmount *rpc_mnt __read_mostly;
 static int rpc_mount_count;
 
 static struct file_system_type rpc_pipe_fs_type;
@@ -162,11 +162,19 @@ rpc_alloc_inode(struct super_block *sb)
 }
 
 static void
-rpc_destroy_inode(struct inode *inode)
+rpc_i_callback(struct rcu_head *head)
 {
+       struct inode *inode = container_of(head, struct inode, i_rcu);
+       INIT_LIST_HEAD(&inode->i_dentry);
        kmem_cache_free(rpc_inode_cachep, RPC_I(inode));
 }
 
+static void
+rpc_destroy_inode(struct inode *inode)
+{
+       call_rcu(&inode->i_rcu, rpc_i_callback);
+}
+
 static int
 rpc_pipe_open(struct inode *inode, struct file *filp)
 {
@@ -417,20 +425,20 @@ struct vfsmount *rpc_get_mount(void)
 {
        int err;
 
-       err = simple_pin_fs(&rpc_pipe_fs_type, &rpc_mount, &rpc_mount_count);
+       err = simple_pin_fs(&rpc_pipe_fs_type, &rpc_mnt, &rpc_mount_count);
        if (err != 0)
                return ERR_PTR(err);
-       return rpc_mount;
+       return rpc_mnt;
 }
 EXPORT_SYMBOL_GPL(rpc_get_mount);
 
 void rpc_put_mount(void)
 {
-       simple_release_fs(&rpc_mount, &rpc_mount_count);
+       simple_release_fs(&rpc_mnt, &rpc_mount_count);
 }
 EXPORT_SYMBOL_GPL(rpc_put_mount);
 
-static int rpc_delete_dentry(struct dentry *dentry)
+static int rpc_delete_dentry(const struct dentry *dentry)
 {
        return 1;
 }
@@ -445,6 +453,7 @@ rpc_get_inode(struct super_block *sb, umode_t mode)
        struct inode *inode = new_inode(sb);
        if (!inode)
                return NULL;
+       inode->i_ino = get_next_ino();
        inode->i_mode = mode;
        inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
        switch(mode & S_IFMT) {
@@ -1017,17 +1026,17 @@ rpc_fill_super(struct super_block *sb, void *data, int silent)
        return 0;
 }
 
-static int
-rpc_get_sb(struct file_system_type *fs_type,
-               int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *
+rpc_mount(struct file_system_type *fs_type,
+               int flags, const char *dev_name, void *data)
 {
-       return get_sb_single(fs_type, flags, data, rpc_fill_super, mnt);
+       return mount_single(fs_type, flags, data, rpc_fill_super);
 }
 
 static struct file_system_type rpc_pipe_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "rpc_pipefs",
-       .get_sb         = rpc_get_sb,
+       .mount          = rpc_mount,
        .kill_sb        = kill_litter_super,
 };
 
This page took 0.027531 seconds and 5 git commands to generate.