mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-23 16:53:58 -05:00
fs/ntfs3: Change destroy_inode to free_inode
Many filesystems already use free_inode callback, so we will use it too from now on. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
parent
098250db5d
commit
ae6b47b565
1 changed files with 4 additions and 16 deletions
|
@ -435,27 +435,18 @@ static struct inode *ntfs_alloc_inode(struct super_block *sb)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
memset(ni, 0, offsetof(struct ntfs_inode, vfs_inode));
|
memset(ni, 0, offsetof(struct ntfs_inode, vfs_inode));
|
||||||
|
|
||||||
mutex_init(&ni->ni_lock);
|
mutex_init(&ni->ni_lock);
|
||||||
|
|
||||||
return &ni->vfs_inode;
|
return &ni->vfs_inode;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ntfs_i_callback(struct rcu_head *head)
|
static void ntfs_free_inode(struct inode *inode)
|
||||||
{
|
{
|
||||||
struct inode *inode = container_of(head, struct inode, i_rcu);
|
|
||||||
struct ntfs_inode *ni = ntfs_i(inode);
|
struct ntfs_inode *ni = ntfs_i(inode);
|
||||||
|
|
||||||
mutex_destroy(&ni->ni_lock);
|
mutex_destroy(&ni->ni_lock);
|
||||||
|
|
||||||
kmem_cache_free(ntfs_inode_cachep, ni);
|
kmem_cache_free(ntfs_inode_cachep, ni);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ntfs_destroy_inode(struct inode *inode)
|
|
||||||
{
|
|
||||||
call_rcu(&inode->i_rcu, ntfs_i_callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void init_once(void *foo)
|
static void init_once(void *foo)
|
||||||
{
|
{
|
||||||
struct ntfs_inode *ni = foo;
|
struct ntfs_inode *ni = foo;
|
||||||
|
@ -621,7 +612,7 @@ static int ntfs_sync_fs(struct super_block *sb, int wait)
|
||||||
|
|
||||||
static const struct super_operations ntfs_sops = {
|
static const struct super_operations ntfs_sops = {
|
||||||
.alloc_inode = ntfs_alloc_inode,
|
.alloc_inode = ntfs_alloc_inode,
|
||||||
.destroy_inode = ntfs_destroy_inode,
|
.free_inode = ntfs_free_inode,
|
||||||
.evict_inode = ntfs_evict_inode,
|
.evict_inode = ntfs_evict_inode,
|
||||||
.put_super = ntfs_put_super,
|
.put_super = ntfs_put_super,
|
||||||
.statfs = ntfs_statfs,
|
.statfs = ntfs_statfs,
|
||||||
|
@ -1517,11 +1508,8 @@ out1:
|
||||||
|
|
||||||
static void __exit exit_ntfs_fs(void)
|
static void __exit exit_ntfs_fs(void)
|
||||||
{
|
{
|
||||||
if (ntfs_inode_cachep) {
|
rcu_barrier();
|
||||||
rcu_barrier();
|
kmem_cache_destroy(ntfs_inode_cachep);
|
||||||
kmem_cache_destroy(ntfs_inode_cachep);
|
|
||||||
}
|
|
||||||
|
|
||||||
unregister_filesystem(&ntfs_fs_type);
|
unregister_filesystem(&ntfs_fs_type);
|
||||||
ntfs3_exit_bitmap();
|
ntfs3_exit_bitmap();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue