fs: icache RCU free inodes
[deliverable/linux.git] / drivers / staging / smbfs / inode.c
index 552951aa749834ebc9d61baa4368d066e9f858ef..244319dc970275d41f7d17f8e0c9b1c5cd790a9b 100644 (file)
@@ -62,11 +62,18 @@ static struct inode *smb_alloc_inode(struct super_block *sb)
        return &ei->vfs_inode;
 }
 
-static void smb_destroy_inode(struct inode *inode)
+static void smb_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(smb_inode_cachep, SMB_I(inode));
 }
 
+static void smb_destroy_inode(struct inode *inode)
+{
+       call_rcu(&inode->i_rcu, smb_i_callback);
+}
+
 static void init_once(void *foo)
 {
        struct smb_inode_info *ei = (struct smb_inode_info *) foo;
@@ -537,7 +544,7 @@ static int smb_fill_super(struct super_block *sb, void *raw_data, int silent)
        server->mnt = NULL;
        server->sock_file = NULL;
        init_waitqueue_head(&server->conn_wq);
-       init_MUTEX(&server->sem);
+       sema_init(&server->sem, 1);
        INIT_LIST_HEAD(&server->entry);
        INIT_LIST_HEAD(&server->xmitq);
        INIT_LIST_HEAD(&server->recvq);
@@ -793,16 +800,16 @@ out:
        return error;
 }
 
-static int smb_get_sb(struct file_system_type *fs_type,
-       int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *smb_mount(struct file_system_type *fs_type,
+       int flags, const char *dev_name, void *data)
 {
-       return get_sb_nodev(fs_type, flags, data, smb_fill_super, mnt);
+       return mount_nodev(fs_type, flags, data, smb_fill_super);
 }
 
 static struct file_system_type smb_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "smbfs",
-       .get_sb         = smb_get_sb,
+       .mount          = smb_mount,
        .kill_sb        = kill_anon_super,
        .fs_flags       = FS_BINARY_MOUNTDATA,
 };
This page took 0.032521 seconds and 5 git commands to generate.