Skip to contentSkip to conversation

Btrfs: cleanup: return the ret value of __btrfs_end_transaction directly in btrfs_end_transaction_

PATCH In review Wang Sheng-Hui 1 participant 1 message Sep 24, 2012 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 Btrfs: cleanup: return the ret value of __btrfs_end_transaction directly in btrfs_end_transaction_

No need to use specific var to record the return value of __btrfs_end_transaction and check if it is not zero. Just return the result directly as btrfs_end_transaction_dmeta.

---
 fs/btrfs/transaction.c |   21 +++------------------
 1 files changed, 3 insertions(+), 18 deletions(-)
fs/btrfs/transaction.c +3 -18
index 27c2600..8fcc501 100644
@@ -602,34 +602,19 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans,
 int btrfs_end_transaction(struct btrfs_trans_handle *trans,
 			  struct btrfs_root *root)
 {
-	int ret;
-
-	ret = __btrfs_end_transaction(trans, root, 0, 1);
-	if (ret)
-		return ret;
-	return 0;
+	return __btrfs_end_transaction(trans, root, 0, 1);
 }
 
 int btrfs_end_transaction_throttle(struct btrfs_trans_handle *trans,
 				   struct btrfs_root *root)
 {
-	int ret;
-
-	ret = __btrfs_end_transaction(trans, root, 1, 1);
-	if (ret)
-		return ret;
-	return 0;
+	return __btrfs_end_transaction(trans, root, 1, 1);
 }
 
 int btrfs_end_transaction_nolock(struct btrfs_trans_handle *trans,
 				 struct btrfs_root *root)
 {
-	int ret;
-
-	ret = __btrfs_end_transaction(trans, root, 0, 0);
-	if (ret)
-		return ret;
-	return 0;
+	return __btrfs_end_transaction(trans, root, 0, 0);
 }
 
 int btrfs_end_transaction_dmeta(struct btrfs_trans_handle *trans,
Signature · 1 line
1.7.1