[3/3] btrfs: ctree: Remove stalled comment of setting up path lock
diff mbox series

Message ID 20190910074019.23158-4-wqu@suse.com
State New
Headers show
Series
  • Small code style cleanup for ctree.c
Related show

Commit Message

Qu WenRuo Sept. 10, 2019, 7:40 a.m. UTC
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(-)

Comments

Nikolay Borisov Sept. 10, 2019, 7:51 a.m. UTC | #1
On 10.09.19 г. 10:40 ч., Qu Wenruo wrote:
> 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>

Reviewed-by: Nikolay Borisov <nborisov@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));
>  
>

Patch
diff mbox series

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));