Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dbd5768f authored by Jan Kara's avatar Jan Kara Committed by Fengguang Wu
Browse files

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: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarFengguang Wu <fengguang.wu@intel.com>
parent 7994e6f7
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -297,7 +297,8 @@ in the beginning of ->setattr unconditionally.
be used instead.  It gets called whenever the inode is evicted, whether it has
remaining links or not.  Caller does *not* evict the pagecache or inode-associated
metadata buffers; getting rid of those is responsibility of method, as it had
been for ->delete_inode().
been for ->delete_inode(). Caller makes sure async writeback cannot be running
for the inode while (or after) ->evict_inode() is called.

	->drop_inode() returns int now; it's called on final iput() with
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
simply of return 1.  Note that all actual eviction work is done by caller after
->drop_inode() returns.

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

	NOTE: checking i_nlink in the beginning of ->write_inode() and bailing out
if it's zero is not *and* *never* *had* *been* enough.  Final unlink() and iput()
+1 −1
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ static void
spufs_evict_inode(struct inode *inode)
{
	struct spufs_inode_info *ei = SPUFS_I(inode);
	end_writeback(inode);
	clear_inode(inode);
	if (ei->i_ctx)
		put_spu_context(ei->i_ctx);
	if (ei->i_gang)
+1 −1
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ static struct inode *hypfs_make_inode(struct super_block *sb, umode_t mode)

static void hypfs_evict_inode(struct inode *inode)
{
	end_writeback(inode);
	clear_inode(inode);
	kfree(inode->i_private);
}

+1 −1
Original line number Diff line number Diff line
@@ -448,7 +448,7 @@ void v9fs_evict_inode(struct inode *inode)
	struct v9fs_inode *v9inode = V9FS_I(inode);

	truncate_inode_pages(inode->i_mapping, 0);
	end_writeback(inode);
	clear_inode(inode);
	filemap_fdatawrite(inode->i_mapping);

#ifdef CONFIG_9P_FSCACHE
+1 −1
Original line number Diff line number Diff line
@@ -264,7 +264,7 @@ affs_evict_inode(struct inode *inode)
	}

	invalidate_inode_buffers(inode);
	end_writeback(inode);
	clear_inode(inode);
	affs_free_prealloc(inode);
	cache_page = (unsigned long)AFFS_I(inode)->i_lc;
	if (cache_page) {
Loading