Skip to content

Commit a2b757f

Browse files
author
Al Viro
committed
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>
1 parent f614ee1 commit a2b757f

3 files changed

Lines changed: 6 additions & 15 deletions

File tree

‎fs/ntfs/inode.c‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -332,23 +332,11 @@ struct inode *ntfs_alloc_big_inode(struct super_block *sb)
332332
return NULL;
333333
}
334334

335-
static void ntfs_i_callback(struct rcu_head *head)
335+
void ntfs_free_big_inode(struct inode *inode)
336336
{
337-
struct inode *inode = container_of(head, struct inode, i_rcu);
338337
kmem_cache_free(ntfs_big_inode_cache, NTFS_I(inode));
339338
}
340339

341-
void ntfs_destroy_big_inode(struct inode *inode)
342-
{
343-
ntfs_inode *ni = NTFS_I(inode);
344-
345-
ntfs_debug("Entering.");
346-
BUG_ON(ni->page);
347-
if (!atomic_dec_and_test(&ni->count))
348-
BUG();
349-
call_rcu(&inode->i_rcu, ntfs_i_callback);
350-
}
351-
352340
static inline ntfs_inode *ntfs_alloc_extent_inode(void)
353341
{
354342
ntfs_inode *ni;
@@ -2287,6 +2275,9 @@ void ntfs_evict_big_inode(struct inode *vi)
22872275
ni->ext.base_ntfs_ino = NULL;
22882276
}
22892277
}
2278+
BUG_ON(ni->page);
2279+
if (!atomic_dec_and_test(&ni->count))
2280+
BUG();
22902281
return;
22912282
}
22922283

‎fs/ntfs/inode.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ extern struct inode *ntfs_index_iget(struct inode *base_vi, ntfschar *name,
278278
u32 name_len);
279279

280280
extern struct inode *ntfs_alloc_big_inode(struct super_block *sb);
281-
extern void ntfs_destroy_big_inode(struct inode *inode);
281+
extern void ntfs_free_big_inode(struct inode *inode);
282282
extern void ntfs_evict_big_inode(struct inode *vi);
283283

284284
extern void __ntfs_init_inode(struct super_block *sb, ntfs_inode *ni);

‎fs/ntfs/super.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2676,7 +2676,7 @@ static int ntfs_write_inode(struct inode *vi, struct writeback_control *wbc)
26762676
*/
26772677
static const struct super_operations ntfs_sops = {
26782678
.alloc_inode = ntfs_alloc_big_inode, /* VFS: Allocate new inode. */
2679-
.destroy_inode = ntfs_destroy_big_inode, /* VFS: Deallocate inode. */
2679+
.free_inode = ntfs_free_big_inode, /* VFS: Deallocate inode. */
26802680
#ifdef NTFS_RW
26812681
.write_inode = ntfs_write_inode, /* VFS: Write dirty inode to
26822682
disk. */

0 commit comments

Comments
 (0)