linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Fasheh <mfasheh@suse.de>
To: linux-btrfs@vger.kernel.org
Cc: Chris Mason <chris.mason@oracle.com>,
	Mark Fasheh <mfasheh@suse.de>, Mark Fasheh <mfasheh@suse.com>
Subject: [PATCH 16/20] btrfs: make add_delayed_ref_head() void
Date: Thu, 15 Sep 2011 10:34:55 -0700	[thread overview]
Message-ID: <1316108099-5099-17-git-send-email-mfasheh@suse.de> (raw)
In-Reply-To: <1316108099-5099-1-git-send-email-mfasheh@suse.de>

From: Mark Fasheh <mfasheh@suse.com>

This is trivial as the function always returns success. We can remove 3
BUG_ON(ret) lines as a result.

Signed-off-by: Mark Fasheh <mfasheh@suse.com>
---
 fs/btrfs/delayed-ref.c |   26 ++++++++++----------------
 1 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c
index 125cf76..b5c3d7c 100644
--- a/fs/btrfs/delayed-ref.c
+++ b/fs/btrfs/delayed-ref.c
@@ -390,10 +390,10 @@ update_existing_head_ref(struct btrfs_delayed_ref_node *existing,
  * this does all the dirty work in terms of maintaining the correct
  * overall modification count.
  */
-static noinline int add_delayed_ref_head(struct btrfs_trans_handle *trans,
-					struct btrfs_delayed_ref_node *ref,
-					u64 bytenr, u64 num_bytes,
-					int action, int is_data)
+static noinline void add_delayed_ref_head(struct btrfs_trans_handle *trans,
+					  struct btrfs_delayed_ref_node *ref,
+					  u64 bytenr, u64 num_bytes,
+					  int action, int is_data)
 {
 	struct btrfs_delayed_ref_node *existing;
 	struct btrfs_delayed_ref_head *head_ref = NULL;
@@ -462,7 +462,6 @@ static noinline int add_delayed_ref_head(struct btrfs_trans_handle *trans,
 		delayed_refs->num_entries++;
 		trans->delayed_ref_updates++;
 	}
-	return 0;
 }
 
 /*
@@ -610,9 +609,8 @@ int btrfs_add_delayed_tree_ref(struct btrfs_trans_handle *trans,
 	 * insert both the head node and the new ref without dropping
 	 * the spin lock
 	 */
-	ret = add_delayed_ref_head(trans, &head_ref->node, bytenr, num_bytes,
-				   action, 0);
-	BUG_ON(ret);
+	add_delayed_ref_head(trans, &head_ref->node, bytenr, num_bytes, action,
+			     0);
 
 	ret = add_delayed_tree_ref(trans, &ref->node, bytenr, num_bytes,
 				   parent, ref_root, level, action);
@@ -655,9 +653,8 @@ int btrfs_add_delayed_data_ref(struct btrfs_trans_handle *trans,
 	 * insert both the head node and the new ref without dropping
 	 * the spin lock
 	 */
-	ret = add_delayed_ref_head(trans, &head_ref->node, bytenr, num_bytes,
-				   action, 1);
-	BUG_ON(ret);
+	add_delayed_ref_head(trans, &head_ref->node, bytenr, num_bytes,
+			     action, 1);
 
 	ret = add_delayed_data_ref(trans, &ref->node, bytenr, num_bytes,
 				   parent, ref_root, owner, offset, action);
@@ -672,7 +669,6 @@ int btrfs_add_delayed_extent_op(struct btrfs_trans_handle *trans,
 {
 	struct btrfs_delayed_ref_head *head_ref;
 	struct btrfs_delayed_ref_root *delayed_refs;
-	int ret;
 
 	head_ref = kmalloc(sizeof(*head_ref), GFP_NOFS);
 	if (!head_ref)
@@ -683,10 +679,8 @@ int btrfs_add_delayed_extent_op(struct btrfs_trans_handle *trans,
 	delayed_refs = &trans->transaction->delayed_refs;
 	spin_lock(&delayed_refs->lock);
 
-	ret = add_delayed_ref_head(trans, &head_ref->node, bytenr,
-				   num_bytes, BTRFS_UPDATE_DELAYED_HEAD,
-				   extent_op->is_data);
-	BUG_ON(ret);
+	add_delayed_ref_head(trans, &head_ref->node, bytenr, num_bytes,
+			     BTRFS_UPDATE_DELAYED_HEAD, extent_op->is_data);
 
 	spin_unlock(&delayed_refs->lock);
 	return 0;
-- 
1.7.6


  parent reply	other threads:[~2011-09-15 17:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-15 17:34 [PATCH 0/20] btrfs: More error handling fixes Mark Fasheh
2011-09-15 17:34 ` [PATCH 01/20] btrfs: Don't BUG_ON errors from btrfs_create_subvol_root() Mark Fasheh
2011-09-15 17:34 ` [PATCH 02/20] btrfs: Don't BUG_ON() errors in update_ref_for_cow() Mark Fasheh
2011-09-15 17:34 ` [PATCH 03/20] btrfs: Don't BUG_ON kzalloc error in btrfs_lookup_csums_range() Mark Fasheh
2011-09-15 17:34 ` [PATCH 04/20] btrfs: make insert_ptr() void Mark Fasheh
2011-09-15 17:34 ` [PATCH 05/20] btrfs: Don't BUG_ON errors in __finish_chunk_alloc() Mark Fasheh
2011-09-15 17:34 ` [PATCH 06/20] btrfs: fix error check of btrfs_lookup_dentry() Mark Fasheh
2011-09-15 17:34 ` [PATCH 07/20] btrfs: make fixup_low_keys() void Mark Fasheh
2011-09-15 17:34 ` [PATCH 08/20] btrfs: make del_ptr() and btrfs_del_leaf() void Mark Fasheh
2011-09-15 17:34 ` [PATCH 09/20] btrfs: Don't BUG_ON failures in find_and_setup_root() Mark Fasheh
2011-09-15 17:34 ` [PATCH 10/20] btrfs: go readonly on insert error in btrfs_add_root_ref() Mark Fasheh
2011-09-15 17:34 ` [PATCH 11/20] btrfs: Go readonly on bad extent refs in update_ref_for_cow() Mark Fasheh
2011-09-15 17:34 ` [PATCH 12/20] btrfs: Don't BUG_ON errors from update_ref_for_cow() Mark Fasheh
2011-09-15 17:34 ` [PATCH 13/20] btrfs: Go readonly on tree errors in balance_level Mark Fasheh
2011-09-15 17:34 ` [PATCH 14/20] btrfs: Document BUG() in find_lock_delalloc_range() Mark Fasheh
2011-09-15 17:34 ` [PATCH 15/20] btrfs: Go readonly on missing ref in btrfs_get_parent() Mark Fasheh
2011-09-15 17:34 ` Mark Fasheh [this message]
2011-09-15 17:34 ` [PATCH 17/20] btrfs: make add_delayed_tree_ref() void Mark Fasheh
2011-09-15 17:34 ` [PATCH 18/20] btrfs: Don't BUG_ON insert errors in btrfs_alloc_dev_extent() Mark Fasheh
2011-09-15 17:34 ` [PATCH 19/20] btrfs: Remove BUG_ON from __btrfs_alloc_chunk() Mark Fasheh
2011-09-15 17:34 ` [PATCH 20/20] btrfs: Remove BUG_ON from __finish_chunk_alloc() Mark Fasheh
2011-09-15 18:03 ` [PATCH 0/20] btrfs: More error handling fixes 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=1316108099-5099-17-git-send-email-mfasheh@suse.de \
    --to=mfasheh@suse.de \
    --cc=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=mfasheh@suse.com \
    /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).