linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 3/3] btrfs: ctree: Remove stalled comment of setting up path lock
Date: Tue, 10 Sep 2019 15:40:19 +0800	[thread overview]
Message-ID: <20190910074019.23158-4-wqu@suse.com> (raw)
In-Reply-To: <20190910074019.23158-1-wqu@suse.com>

The following comment shows up in btrfs_search_slot() with out much
sense:

	/*
	 * setup the path here so we can release it under lock
	 * contention with the cow code
	 */
	if (cow) {
		/* code touching path->lock[] is far away from here */
	}

It turns out that just some stalled comment which is not cleaned up
properly.

The original code is introduced in commit 65b51a009e29
("btrfs_search_slot: reduce lock contention by cowing in two stages"):
+
+               /*
+                * setup the path here so we can release it under lock
+                * contention with the cow code
+                */
+               p->nodes[level] = b;
+               if (!p->skip_locking)
+                       p->locks[level] = 1;
+

But in current code base, we have different timing modifying path lock,
so just remove that stalled comment.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 fs/btrfs/ctree.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 3be8b32c0d37..a2e264190eee 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -2764,10 +2764,6 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root *root,
 		int dec = 0;
 		level = btrfs_header_level(b);
 
-		/*
-		 * setup the path here so we can release it under lock
-		 * contention with the cow code
-		 */
 		if (cow) {
 			bool last_level = (level == (BTRFS_MAX_LEVEL - 1));
 
-- 
2.23.0


  parent reply	other threads:[~2019-09-10  7:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10  7:40 [PATCH 0/3] Small code style cleanup for ctree.c Qu Wenruo
2019-09-10  7:40 ` [PATCH 1/3] btrfs: ctree: Reduce one indent level for btrfs_search_slot() Qu Wenruo
2019-09-10  7:54   ` Anand Jain
2019-09-10  8:24   ` Nikolay Borisov
2019-09-10  8:31     ` Qu Wenruo
2019-09-10  8:42       ` Nikolay Borisov
2019-09-23 16:09         ` David Sterba
2019-09-10  7:40 ` [PATCH 2/3] btrfs: ctree: Reduce one indent level for btrfs_search_old_slot() Qu Wenruo
2019-09-10  7:58   ` Anand Jain
2019-09-23 16:32   ` David Sterba
2019-09-10  7:40 ` Qu Wenruo [this message]
2019-09-10  7:51   ` [PATCH 3/3] btrfs: ctree: Remove stalled comment of setting up path lock Nikolay Borisov
2019-09-23 16:36 ` [PATCH 0/3] Small code style cleanup for ctree.c 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=20190910074019.23158-4-wqu@suse.com \
    --to=wqu@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).