All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gu Jinxiang <gujx@cn.fujitsu.com>
To: <nborisov@suse.com>
Cc: <dsterba@suse.cz>, <linux-btrfs@vger.kernel.org>,
	Gu JinXiang <gujx@cn.fujitsu.com>
Subject: [PATCH v3 2/2] btrfs: use enum instead of constant value
Date: Thu, 11 Jan 2018 16:12:18 +0800	[thread overview]
Message-ID: <1515658338-6781-2-git-send-email-gujx@cn.fujitsu.com> (raw)
In-Reply-To: <1515658338-6781-1-git-send-email-gujx@cn.fujitsu.com>

From: Gu JinXiang <gujx@cn.fujitsu.com>

load_free_space_tree calls either function load_free_space_bitmaps or
load_free_space_extents. And either of those two will lead to call
btrfs_next_item.
So in function load_free_space_tree, use READA_FORWARD to read forward
ahead.

Changelog:
v2->v1: change enum from READA_BACK to READA_FORWARD, since according
to the logic of the source, it should reada_for_search forward, not
backward.
And, Reference:
commit e4058b54d1e4 ("btrfs: cleanup, use enum values for btrfs_path reada")

v3->v2: add commit message to make it easy to understand. And split it
to two patch.

Signed-off-by: Gu JinXiang <gujx@cn.fujitsu.com>
---
 fs/btrfs/free-space-tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/free-space-tree.c b/fs/btrfs/free-space-tree.c
index d7b6c0017143..af36a6a971fe 100644
--- a/fs/btrfs/free-space-tree.c
+++ b/fs/btrfs/free-space-tree.c
@@ -1573,7 +1573,7 @@ int load_free_space_tree(struct btrfs_caching_control *caching_ctl)
 	 */
 	path->skip_locking = 1;
 	path->search_commit_root = 1;
-	path->reada = 1;
+	path->reada = READA_FORWARD;
 
 	info = search_free_space_info(NULL, fs_info, block_group, path, 0);
 	if (IS_ERR(info)) {
-- 
2.14.3




  reply	other threads:[~2018-01-11  8:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-05 10:35 [PATCH] btrfs: use enum instead of constant value Gu Jinxiang
2017-12-05 17:35 ` David Sterba
2018-01-11  6:59   ` [PATCH v2] " Gu Jinxiang
2018-01-11  7:24     ` Nikolay Borisov
2018-01-11  8:12       ` [PATCH v3 1/2] " Gu Jinxiang
2018-01-11  8:12         ` Gu Jinxiang [this message]
2018-01-11  8:14           ` [PATCH v3 2/2] " Nikolay Borisov
2018-01-11  8:14         ` [PATCH v3 1/2] " Nikolay Borisov
2018-02-06 14:54         ` 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=1515658338-6781-2-git-send-email-gujx@cn.fujitsu.com \
    --to=gujx@cn.fujitsu.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /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.