Skip to content

Commit dbd5768

Browse files
jankaraFengguang Wu
authored andcommitted
vfs: Rename end_writeback() to clear_inode()
After we moved inode_sync_wait() from end_writeback() it doesn't make sense to call the function end_writeback() anymore. Rename it to clear_inode() which well says what the function really does - set I_CLEAR flag. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
1 parent 7994e6f commit dbd5768

52 files changed

Lines changed: 68 additions & 70 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/filesystems/porting‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ in the beginning of ->setattr unconditionally.
297297
be used instead. It gets called whenever the inode is evicted, whether it has
298298
remaining links or not. Caller does *not* evict the pagecache or inode-associated
299299
metadata buffers; getting rid of those is responsibility of method, as it had
300-
been for ->delete_inode().
300+
been for ->delete_inode(). Caller makes sure async writeback cannot be running
301+
for the inode while (or after) ->evict_inode() is called.
301302

302303
->drop_inode() returns int now; it's called on final iput() with
303304
inode->i_lock held and it returns true if filesystems wants the inode to be
@@ -306,14 +307,11 @@ updated appropriately. generic_delete_inode() is also alive and it consists
306307
simply of return 1. Note that all actual eviction work is done by caller after
307308
->drop_inode() returns.
308309

309-
clear_inode() is gone; use end_writeback() instead. As before, it must
310-
be called exactly once on each call of ->evict_inode() (as it used to be for
311-
each call of ->delete_inode()). Unlike before, if you are using inode-associated
312-
metadata buffers (i.e. mark_buffer_dirty_inode()), it's your responsibility to
313-
call invalidate_inode_buffers() before end_writeback().
314-
No async writeback (and thus no calls of ->write_inode()) will happen
315-
after end_writeback() returns, so actions that should not overlap with ->write_inode()
316-
(e.g. freeing on-disk inode if i_nlink is 0) ought to be done after that call.
310+
As before, clear_inode() must be called exactly once on each call of
311+
->evict_inode() (as it used to be for each call of ->delete_inode()). Unlike
312+
before, if you are using inode-associated metadata buffers (i.e.
313+
mark_buffer_dirty_inode()), it's your responsibility to call
314+
invalidate_inode_buffers() before clear_inode().
317315

318316
NOTE: checking i_nlink in the beginning of ->write_inode() and bailing out
319317
if it's zero is not *and* *never* *had* *been* enough. Final unlink() and iput()

‎arch/powerpc/platforms/cell/spufs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static void
151151
spufs_evict_inode(struct inode *inode)
152152
{
153153
struct spufs_inode_info *ei = SPUFS_I(inode);
154-
end_writeback(inode);
154+
clear_inode(inode);
155155
if (ei->i_ctx)
156156
put_spu_context(ei->i_ctx);
157157
if (ei->i_gang)

‎arch/s390/hypfs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static struct inode *hypfs_make_inode(struct super_block *sb, umode_t mode)
115115

116116
static void hypfs_evict_inode(struct inode *inode)
117117
{
118-
end_writeback(inode);
118+
clear_inode(inode);
119119
kfree(inode->i_private);
120120
}
121121

‎fs/9p/vfs_inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ void v9fs_evict_inode(struct inode *inode)
448448
struct v9fs_inode *v9inode = V9FS_I(inode);
449449

450450
truncate_inode_pages(inode->i_mapping, 0);
451-
end_writeback(inode);
451+
clear_inode(inode);
452452
filemap_fdatawrite(inode->i_mapping);
453453

454454
#ifdef CONFIG_9P_FSCACHE

‎fs/affs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ affs_evict_inode(struct inode *inode)
264264
}
265265

266266
invalidate_inode_buffers(inode);
267-
end_writeback(inode);
267+
clear_inode(inode);
268268
affs_free_prealloc(inode);
269269
cache_page = (unsigned long)AFFS_I(inode)->i_lc;
270270
if (cache_page) {

‎fs/afs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ void afs_evict_inode(struct inode *inode)
423423
ASSERTCMP(inode->i_ino, ==, vnode->fid.vnode);
424424

425425
truncate_inode_pages(&inode->i_data, 0);
426-
end_writeback(inode);
426+
clear_inode(inode);
427427

428428
afs_give_up_callback(vnode);
429429

‎fs/autofs4/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ static int autofs4_show_options(struct seq_file *m, struct dentry *root)
101101

102102
static void autofs4_evict_inode(struct inode *inode)
103103
{
104-
end_writeback(inode);
104+
clear_inode(inode);
105105
kfree(inode->i_private);
106106
}
107107

‎fs/bfs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ static void bfs_evict_inode(struct inode *inode)
174174

175175
truncate_inode_pages(&inode->i_data, 0);
176176
invalidate_inode_buffers(inode);
177-
end_writeback(inode);
177+
clear_inode(inode);
178178

179179
if (inode->i_nlink)
180180
return;

‎fs/binfmt_misc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ static struct inode *bm_get_inode(struct super_block *sb, int mode)
505505

506506
static void bm_evict_inode(struct inode *inode)
507507
{
508-
end_writeback(inode);
508+
clear_inode(inode);
509509
kfree(inode->i_private);
510510
}
511511

‎fs/block_dev.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ static void bdev_evict_inode(struct inode *inode)
487487
struct list_head *p;
488488
truncate_inode_pages(&inode->i_data, 0);
489489
invalidate_inode_buffers(inode); /* is it needed here? */
490-
end_writeback(inode);
490+
clear_inode(inode);
491491
spin_lock(&bdev_lock);
492492
while ( (p = bdev->bd_inodes.next) != &bdev->bd_inodes ) {
493493
__bd_forget(list_entry(p, struct inode, i_devices));

0 commit comments

Comments
 (0)