Btrfs: remove unnecessary cur_trans set before goto loop in join_transaction
PATCH 3/4 Btrfs: remove unnecessary cur_trans set before goto loop in join_transaction
In the big loop, cur_trans will be set fs_info->running_transaction before it's used. And after kmem_cache_free it and goto loop, it will be setup again. No need to setup it immediately after freed.
Signed-off-by Wang Sheng-Hui <[email protected]>
--- fs/btrfs/transaction.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
fs/btrfs/transaction.c +0 -1
@@ -98,7 +98,6 @@ loop:* to redo the trans_no_join checks above */ kmem_cache_free (btrfs_transaction_cachep, cur_trans); - cur_trans = fs_info->running_transaction; goto loop; }else if (fs_info->fs_state &BTRFS_SUPER_FLAG_ERROR ) {spin_unlock (&fs_info->trans_lock);
Signature · 1 line
1.7.1
Quoted 14 lines · Wang Sheng-Hui
In the big loop,
cur_transwill be setfs_info->running_transactionbefore it's used. And afterkmem_cache_freeit and goto loop, it will be setup again. No need to setup it immediately after freed.Signed-off-by Wang Sheng-Hui <[email protected]>--- fs/btrfs/transaction.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)fs/btrfs/transaction.c +0
-0
fs/btrfs/transaction.c loop: · line 103
Quoted 7 lines
fs/btrfs/transaction.c +0
-1@@ -98,7 +98,6 @@ loop:* to redo the trans_no_join checks above */ kmem_cache_free (btrfs_transaction_cachep, cur_trans); - cur_trans = fs_info->running_transaction; goto loop; }else if (fs_info->fs_state &BTRFS_SUPER_FLAG_ERROR ) {spin_unlock (&fs_info->trans_lock);
This is Obviously Correct(TM) :-) and doesn't seem to have been picked up by btrfs maintainers. I am picking it up now.
Signature · 2 lines
Jiri Kosina SUSE Labs