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

Commit 90324cc1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull writeback tree from Wu Fengguang:
 "Mainly from Jan Kara to avoid iput() in the flusher threads."

* tag 'writeback' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux:
  writeback: Avoid iput() from flusher thread
  vfs: Rename end_writeback() to clear_inode()
  vfs: Move waiting for inode writeback from end_writeback() to evict_inode()
  writeback: Refactor writeback_single_inode()
  writeback: Remove wb->list_lock from writeback_single_inode()
  writeback: Separate inode requeueing after writeback
  writeback: Move I_DIRTY_PAGES handling
  writeback: Move requeueing when I_SYNC set to writeback_sb_inodes()
  writeback: Move clearing of I_SYNC into inode_sync_complete()
  writeback: initialize global_dirty_limit
  fs: remove 8 bytes of padding from struct writeback_control on 64 bit builds
  mm: page-writeback.c: local functions should not be exposed globally
parents fb8b0067 169ebd90
Loading
Loading
Loading
Loading
+7 −9
Original line number Original line 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
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
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
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
	->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
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
simply of return 1.  Note that all actual eviction work is done by caller after
->drop_inode() returns.
->drop_inode() returns.


	clear_inode() is gone; use end_writeback() instead.  As before, it must
	As before, clear_inode() must be called exactly once on each call of
be called exactly once on each call of ->evict_inode() (as it used to be for
->evict_inode() (as it used to be for each call of ->delete_inode()).  Unlike
each call of ->delete_inode()).  Unlike before, if you are using inode-associated
before, if you are using inode-associated metadata buffers (i.e.
metadata buffers (i.e. mark_buffer_dirty_inode()), it's your responsibility to
mark_buffer_dirty_inode()), it's your responsibility to call
call invalidate_inode_buffers() before end_writeback().
invalidate_inode_buffers() before clear_inode().
	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.


	NOTE: checking i_nlink in the beginning of ->write_inode() and bailing out
	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()
if it's zero is not *and* *never* *had* *been* enough.  Final unlink() and iput()
+1 −1
Original line number Original line Diff line number Diff line
@@ -151,7 +151,7 @@ static void
spufs_evict_inode(struct inode *inode)
spufs_evict_inode(struct inode *inode)
{
{
	struct spufs_inode_info *ei = SPUFS_I(inode);
	struct spufs_inode_info *ei = SPUFS_I(inode);
	end_writeback(inode);
	clear_inode(inode);
	if (ei->i_ctx)
	if (ei->i_ctx)
		put_spu_context(ei->i_ctx);
		put_spu_context(ei->i_ctx);
	if (ei->i_gang)
	if (ei->i_gang)
+1 −1
Original line number Original line 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)
static void hypfs_evict_inode(struct inode *inode)
{
{
	end_writeback(inode);
	clear_inode(inode);
	kfree(inode->i_private);
	kfree(inode->i_private);
}
}


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


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


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


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