All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: optimize code converge mutex unlock
@ 2017-12-20  6:42 Anand Jain
  2017-12-20  8:19 ` Nikolay Borisov
  0 siblings, 1 reply; 3+ messages in thread
From: Anand Jain @ 2017-12-20  6:42 UTC (permalink / raw)
  To: linux-btrfs

No functional change rearrange the mutex_unlock.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 fs/btrfs/transaction.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 6348573e26a7..04f07144b45c 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -2265,16 +2265,13 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
 	}
 
 	ret = write_all_supers(fs_info, 0);
-	if (ret) {
-		mutex_unlock(&fs_info->tree_log_mutex);
-		goto scrub_continue;
-	}
-
 	/*
 	 * the super is written, we can safely allow the tree-loggers
 	 * to go about their business
 	 */
 	mutex_unlock(&fs_info->tree_log_mutex);
+	if (ret)
+		goto scrub_continue;
 
 	btrfs_finish_extent_commit(trans, fs_info);
 
-- 
2.15.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: optimize code converge mutex unlock
  2017-12-20  6:42 [PATCH] btrfs: optimize code converge mutex unlock Anand Jain
@ 2017-12-20  8:19 ` Nikolay Borisov
  2018-01-05 13:12   ` David Sterba
  0 siblings, 1 reply; 3+ messages in thread
From: Nikolay Borisov @ 2017-12-20  8:19 UTC (permalink / raw)
  To: Anand Jain, linux-btrfs



On 20.12.2017 08:42, Anand Jain wrote:
> No functional change rearrange the mutex_unlock.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
> ---
>  fs/btrfs/transaction.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
> index 6348573e26a7..04f07144b45c 100644
> --- a/fs/btrfs/transaction.c
> +++ b/fs/btrfs/transaction.c
> @@ -2265,16 +2265,13 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
>  	}
>  
>  	ret = write_all_supers(fs_info, 0);
> -	if (ret) {
> -		mutex_unlock(&fs_info->tree_log_mutex);
> -		goto scrub_continue;
> -	}
> -
>  	/*
>  	 * the super is written, we can safely allow the tree-loggers
>  	 * to go about their business
>  	 */
>  	mutex_unlock(&fs_info->tree_log_mutex);
> +	if (ret)
> +		goto scrub_continue;
>  
>  	btrfs_finish_extent_commit(trans, fs_info);
>  
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: optimize code converge mutex unlock
  2017-12-20  8:19 ` Nikolay Borisov
@ 2018-01-05 13:12   ` David Sterba
  0 siblings, 0 replies; 3+ messages in thread
From: David Sterba @ 2018-01-05 13:12 UTC (permalink / raw)
  To: Nikolay Borisov; +Cc: Anand Jain, linux-btrfs

On Wed, Dec 20, 2017 at 10:19:14AM +0200, Nikolay Borisov wrote:
> 
> 
> On 20.12.2017 08:42, Anand Jain wrote:
> > No functional change rearrange the mutex_unlock.
> > 
> > Signed-off-by: Anand Jain <anand.jain@oracle.com>
> 
> Reviewed-by: Nikolay Borisov <nborisov@suse.com>

Added to for-next.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-05 13:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-20  6:42 [PATCH] btrfs: optimize code converge mutex unlock Anand Jain
2017-12-20  8:19 ` Nikolay Borisov
2018-01-05 13:12   ` David Sterba

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.