All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 03/12] btrfs: remove wait from struct btrfs_delalloc_work
Date: Thu,  3 Dec 2015 17:56:29 +0100	[thread overview]
Message-ID: <3042460136bee7bf48860f16a391e6d75f2d0d5c.1449161602.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1449161602.git.dsterba@suse.com>

The value is 0 and never changes, we can propagate the value, remove
wait and the implied dead code.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/ctree.h |  1 -
 fs/btrfs/inode.c | 11 +++--------
 2 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index cb540251f666..a61c53bce162 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -3902,7 +3902,6 @@ void btrfs_extent_item_to_extent_map(struct inode *inode,
 /* inode.c */
 struct btrfs_delalloc_work {
 	struct inode *inode;
-	int wait;
 	int delay_iput;
 	struct completion completion;
 	struct list_head list;
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 9898b0d79c5a..15b29e879ffc 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -9440,14 +9440,10 @@ static void btrfs_run_delalloc_work(struct btrfs_work *work)
 	delalloc_work = container_of(work, struct btrfs_delalloc_work,
 				     work);
 	inode = delalloc_work->inode;
-	if (delalloc_work->wait) {
-		btrfs_wait_ordered_range(inode, 0, (u64)-1);
-	} else {
+	filemap_flush(inode->i_mapping);
+	if (test_bit(BTRFS_INODE_HAS_ASYNC_EXTENT,
+				&BTRFS_I(inode)->runtime_flags))
 		filemap_flush(inode->i_mapping);
-		if (test_bit(BTRFS_INODE_HAS_ASYNC_EXTENT,
-			     &BTRFS_I(inode)->runtime_flags))
-			filemap_flush(inode->i_mapping);
-	}
 
 	if (delalloc_work->delay_iput)
 		btrfs_add_delayed_iput(inode);
@@ -9468,7 +9464,6 @@ struct btrfs_delalloc_work *btrfs_alloc_delalloc_work(struct inode *inode,
 	init_completion(&work->completion);
 	INIT_LIST_HEAD(&work->list);
 	work->inode = inode;
-	work->wait = 0;
 	work->delay_iput = delay_iput;
 	WARN_ON_ONCE(!inode);
 	btrfs_init_work(&work->work, btrfs_flush_delalloc_helper,
-- 
2.6.2


  parent reply	other threads:[~2015-12-03 16:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-03 16:56 [PULL][PATCH 00/12] Minor cleanups and code simplifications David Sterba
2015-12-03 16:56 ` [PATCH 01/12] btrfs: make btrfs_close_one_device static David Sterba
2015-12-03 16:56 ` [PATCH 02/12] btrfs: sink parameter wait to btrfs_alloc_delalloc_work David Sterba
2015-12-03 16:56 ` David Sterba [this message]
2015-12-03 16:56 ` [PATCH 04/12] btrfs: change how delay_iput is tracked in btrfs_delalloc_work David Sterba
2015-12-04  2:25   ` Liu Bo
2015-12-04 12:36     ` David Sterba
2015-12-04 12:50       ` Holger Hoffstätte
2015-12-07 14:23         ` David Sterba
2015-12-04 13:08       ` Filipe Manana
2015-12-07 13:52         ` David Sterba
2015-12-03 16:56 ` [PATCH 05/12] btrfs: remove a trivial helper btrfs_set_buffer_uptodate David Sterba
2015-12-03 16:56 ` [PATCH 06/12] btrfs: make set_extent_buffer_uptodate return void David Sterba
2015-12-03 16:56 ` [PATCH 07/12] btrfs: make clear_extent_buffer_uptodate " David Sterba
2015-12-03 16:56 ` [PATCH 08/12] btrfs: make extent_clear_unlock_delalloc " David Sterba
2015-12-03 16:56 ` [PATCH 09/12] btrfs: make end_extent_writepage " David Sterba
2015-12-03 16:56 ` [PATCH 10/12] btrfs: make extent_range_clear_dirty_for_io " David Sterba
2015-12-03 16:56 ` [PATCH 11/12] btrfs: make extent_range_redirty_for_io " David Sterba
2015-12-03 16:56 ` [PATCH 12/12] btrfs: make set_range_writeback " David Sterba
2015-12-07 14:16 ` [PULL][PATCH 00/12] Minor cleanups and code simplifications David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3042460136bee7bf48860f16a391e6d75f2d0d5c.1449161602.git.dsterba@suse.com \
    --to=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.