diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2019-04-15 22:36:59 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2019-05-01 22:43:26 -0400 |
commit | a2b757fe0fcd46f32ee35882610a797cd3dcda6f (patch) | |
tree | 03cc797b9bd3caabb9d399fd150a4830314fd4d9 | |
parent | f614ee1e3ea7ac155f827294fccb4816552c99ec (diff) |
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>
-rw-r--r-- | fs/ntfs/inode.c | 17 | ||||
-rw-r--r-- | fs/ntfs/inode.h | 2 | ||||
-rw-r--r-- | fs/ntfs/super.c | 2 |
3 files changed, 6 insertions, 15 deletions
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index bd3221cbdd95..fb1a2b49a5da 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c | |||
@@ -332,23 +332,11 @@ struct inode *ntfs_alloc_big_inode(struct super_block *sb) | |||
332 | return NULL; | 332 | return NULL; |
333 | } | 333 | } |
334 | 334 | ||
335 | static void ntfs_i_callback(struct rcu_head *head) | 335 | void ntfs_free_big_inode(struct inode *inode) |
336 | { | 336 | { |
337 | struct inode *inode = container_of(head, struct inode, i_rcu); | ||
338 | kmem_cache_free(ntfs_big_inode_cache, NTFS_I(inode)); | 337 | kmem_cache_free(ntfs_big_inode_cache, NTFS_I(inode)); |
339 | } | 338 | } |
340 | 339 | ||
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 | |||
352 | static inline ntfs_inode *ntfs_alloc_extent_inode(void) | 340 | static inline ntfs_inode *ntfs_alloc_extent_inode(void) |
353 | { | 341 | { |
354 | ntfs_inode *ni; | 342 | ntfs_inode *ni; |
@@ -2287,6 +2275,9 @@ void ntfs_evict_big_inode(struct inode *vi) | |||
2287 | ni->ext.base_ntfs_ino = NULL; | 2275 | ni->ext.base_ntfs_ino = NULL; |
2288 | } | 2276 | } |
2289 | } | 2277 | } |
2278 | BUG_ON(ni->page); | ||
2279 | if (!atomic_dec_and_test(&ni->count)) | ||
2280 | BUG(); | ||
2290 | return; | 2281 | return; |
2291 | } | 2282 | } |
2292 | 2283 | ||
diff --git a/fs/ntfs/inode.h b/fs/ntfs/inode.h index b3c3469de6cb..58c8fd2948d3 100644 --- a/fs/ntfs/inode.h +++ b/fs/ntfs/inode.h | |||
@@ -278,7 +278,7 @@ extern struct inode *ntfs_index_iget(struct inode *base_vi, ntfschar *name, | |||
278 | u32 name_len); | 278 | u32 name_len); |
279 | 279 | ||
280 | extern struct inode *ntfs_alloc_big_inode(struct super_block *sb); | 280 | 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); |
282 | extern void ntfs_evict_big_inode(struct inode *vi); | 282 | extern void ntfs_evict_big_inode(struct inode *vi); |
283 | 283 | ||
284 | extern void __ntfs_init_inode(struct super_block *sb, ntfs_inode *ni); | 284 | extern void __ntfs_init_inode(struct super_block *sb, ntfs_inode *ni); |
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index bb7159f697f2..887ea8b3b000 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c | |||
@@ -2676,7 +2676,7 @@ static int ntfs_write_inode(struct inode *vi, struct writeback_control *wbc) | |||
2676 | */ | 2676 | */ |
2677 | static const struct super_operations ntfs_sops = { | 2677 | static const struct super_operations ntfs_sops = { |
2678 | .alloc_inode = ntfs_alloc_big_inode, /* VFS: Allocate new inode. */ | 2678 | .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. */ |
2680 | #ifdef NTFS_RW | 2680 | #ifdef NTFS_RW |
2681 | .write_inode = ntfs_write_inode, /* VFS: Write dirty inode to | 2681 | .write_inode = ntfs_write_inode, /* VFS: Write dirty inode to |
2682 | disk. */ | 2682 | disk. */ |