ntfs: switch to ->free_inode()
move the synchronous stuff from ->destroy_inode() to ->evict_inode(), turn the RCU-delayed part into ->free_inode() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
f614ee1e3e
commit
a2b757fe0f
@ -332,23 +332,11 @@ struct inode *ntfs_alloc_big_inode(struct super_block *sb)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ntfs_i_callback(struct rcu_head *head)
|
void ntfs_free_big_inode(struct inode *inode)
|
||||||
{
|
{
|
||||||
struct inode *inode = container_of(head, struct inode, i_rcu);
|
|
||||||
kmem_cache_free(ntfs_big_inode_cache, NTFS_I(inode));
|
kmem_cache_free(ntfs_big_inode_cache, NTFS_I(inode));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ntfs_destroy_big_inode(struct inode *inode)
|
|
||||||
{
|
|
||||||
ntfs_inode *ni = NTFS_I(inode);
|
|
||||||
|
|
||||||
ntfs_debug("Entering.");
|
|
||||||
BUG_ON(ni->page);
|
|
||||||
if (!atomic_dec_and_test(&ni->count))
|
|
||||||
BUG();
|
|
||||||
call_rcu(&inode->i_rcu, ntfs_i_callback);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline ntfs_inode *ntfs_alloc_extent_inode(void)
|
static inline ntfs_inode *ntfs_alloc_extent_inode(void)
|
||||||
{
|
{
|
||||||
ntfs_inode *ni;
|
ntfs_inode *ni;
|
||||||
@ -2287,6 +2275,9 @@ void ntfs_evict_big_inode(struct inode *vi)
|
|||||||
ni->ext.base_ntfs_ino = NULL;
|
ni->ext.base_ntfs_ino = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BUG_ON(ni->page);
|
||||||
|
if (!atomic_dec_and_test(&ni->count))
|
||||||
|
BUG();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ extern struct inode *ntfs_index_iget(struct inode *base_vi, ntfschar *name,
|
|||||||
u32 name_len);
|
u32 name_len);
|
||||||
|
|
||||||
extern struct inode *ntfs_alloc_big_inode(struct super_block *sb);
|
extern struct inode *ntfs_alloc_big_inode(struct super_block *sb);
|
||||||
extern void ntfs_destroy_big_inode(struct inode *inode);
|
extern void ntfs_free_big_inode(struct inode *inode);
|
||||||
extern void ntfs_evict_big_inode(struct inode *vi);
|
extern void ntfs_evict_big_inode(struct inode *vi);
|
||||||
|
|
||||||
extern void __ntfs_init_inode(struct super_block *sb, ntfs_inode *ni);
|
extern void __ntfs_init_inode(struct super_block *sb, ntfs_inode *ni);
|
||||||
|
@ -2676,7 +2676,7 @@ static int ntfs_write_inode(struct inode *vi, struct writeback_control *wbc)
|
|||||||
*/
|
*/
|
||||||
static const struct super_operations ntfs_sops = {
|
static const struct super_operations ntfs_sops = {
|
||||||
.alloc_inode = ntfs_alloc_big_inode, /* VFS: Allocate new inode. */
|
.alloc_inode = ntfs_alloc_big_inode, /* VFS: Allocate new inode. */
|
||||||
.destroy_inode = ntfs_destroy_big_inode, /* VFS: Deallocate inode. */
|
.free_inode = ntfs_free_big_inode, /* VFS: Deallocate inode. */
|
||||||
#ifdef NTFS_RW
|
#ifdef NTFS_RW
|
||||||
.write_inode = ntfs_write_inode, /* VFS: Write dirty inode to
|
.write_inode = ntfs_write_inode, /* VFS: Write dirty inode to
|
||||||
disk. */
|
disk. */
|
||||||
|
Loading…
Reference in New Issue
Block a user