ANDROID: sdcardfs: fix sdcardfs_destroy_inode for the inode RCU approach
According to the following commits, fs: icache RCU free inodes vfs: fix the stupidity with i_dentry in inode destructors sdcardfs_destroy_inode should be fixed for the fast path safety. Signed-off-by: Gao Xiang <gaoxiang25@huawei.com> Change-Id: I84f43c599209d23737c7e28b499dd121cb43636d
This commit is contained in:
parent
a37e92bf34
commit
0d54ef3167
1 changed files with 8 additions and 1 deletions
|
@ -192,9 +192,16 @@ static struct inode *sdcardfs_alloc_inode(struct super_block *sb)
|
|||
return &i->vfs_inode;
|
||||
}
|
||||
|
||||
static void i_callback(struct rcu_head *head)
|
||||
{
|
||||
struct inode *inode = container_of(head, struct inode, i_rcu);
|
||||
|
||||
kmem_cache_free(sdcardfs_inode_cachep, SDCARDFS_I(inode));
|
||||
}
|
||||
|
||||
static void sdcardfs_destroy_inode(struct inode *inode)
|
||||
{
|
||||
kmem_cache_free(sdcardfs_inode_cachep, SDCARDFS_I(inode));
|
||||
call_rcu(&inode->i_rcu, i_callback);
|
||||
}
|
||||
|
||||
/* sdcardfs inode cache constructor */
|
||||
|
|
Loading…
Reference in a new issue