From: Nikolay Borisov <nborisov@suse.com>
To: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 17/22] btrfs: kill tree_mod_log_set_root_pointer helper
Date: Thu, 8 Mar 2018 17:40:33 +0200 [thread overview]
Message-ID: <daf312a4-a82d-8376-47e3-55c29eceb3e8@suse.com> (raw)
In-Reply-To: <72ff37265349f68c04229797f49a09670ae46934.1520518876.git.dsterba@suse.com>
On 8.03.2018 16:33, David Sterba wrote:
> A useless wrapper around tree_mod_log_insert_root that hides missing
> error handling. Move it to the callers.
>
> Signed-off-by: David Sterba <dsterba@suse.com>
For 15-17:
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
> ---
> fs/btrfs/ctree.c | 20 +++++++-------------
> 1 file changed, 7 insertions(+), 13 deletions(-)
>
> diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
> index ceb0836d74cd..30950439731e 100644
> --- a/fs/btrfs/ctree.c
> +++ b/fs/btrfs/ctree.c
> @@ -883,16 +883,6 @@ static noinline int tree_mod_log_free_eb(struct extent_buffer *eb)
> return ret;
> }
>
> -static noinline void
> -tree_mod_log_set_root_pointer(struct btrfs_root *root,
> - struct extent_buffer *new_root_node,
> - int log_removal)
> -{
> - int ret;
> - ret = tree_mod_log_insert_root(root->node, new_root_node, log_removal);
> - BUG_ON(ret < 0);
> -}
> -
> /*
> * check if the tree block can be shared by multiple trees
> */
> @@ -1119,7 +1109,8 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans,
> parent_start = buf->start;
>
> extent_buffer_get(cow);
> - tree_mod_log_set_root_pointer(root, cow, 1);
> + ret = tree_mod_log_insert_root(root->node, cow, 1);
> + BUG_ON(ret < 0);
> rcu_assign_pointer(root->node, cow);
>
> btrfs_free_tree_block(trans, root, buf, parent_start,
> @@ -1873,7 +1864,8 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
> goto enospc;
> }
>
> - tree_mod_log_set_root_pointer(root, child, 1);
> + ret = tree_mod_log_insert_root(root->node, child, 1);
> + BUG_ON(ret < 0);
> rcu_assign_pointer(root->node, child);
>
> add_root_to_dirty_list(root);
> @@ -3319,6 +3311,7 @@ static noinline int insert_new_root(struct btrfs_trans_handle *trans,
> struct extent_buffer *c;
> struct extent_buffer *old;
> struct btrfs_disk_key lower_key;
> + int ret;
>
> BUG_ON(path->nodes[level]);
> BUG_ON(path->nodes[level-1] != root->node);
> @@ -3357,7 +3350,8 @@ static noinline int insert_new_root(struct btrfs_trans_handle *trans,
> btrfs_mark_buffer_dirty(c);
>
> old = root->node;
> - tree_mod_log_set_root_pointer(root, c, 0);
> + ret = tree_mod_log_insert_root(root->node, c, 0);
> + BUG_ON(ret < 0);
> rcu_assign_pointer(root->node, c);
>
> /* the super has an extra ref to root->node */
>
next prev parent reply other threads:[~2018-03-08 15:40 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-08 14:33 [PATCH 00/22] Misc cleanups David Sterba
2018-03-08 14:33 ` [PATCH 01/22] btrfs: assume that bio_ret is always valid in submit_extent_page David Sterba
2018-03-08 14:33 ` [PATCH 02/22] btrfs: assume that prev_em_start is always valid in __do_readpage David Sterba
2018-03-13 15:03 ` Anand Jain
2018-03-16 16:12 ` David Sterba
2018-03-08 14:33 ` [PATCH 03/22] btrfs: remove redundant variable " David Sterba
2018-03-08 14:33 ` [PATCH 04/22] btrfs: cleanup merging conditions in submit_extent_page David Sterba
2018-03-08 14:33 ` [PATCH 05/22] btrfs: document more parameters of submit_extent_page David Sterba
2018-03-08 14:33 ` [PATCH 06/22] btrfs: drop fs_info parameter from tree_mod_log_set_node_key David Sterba
2018-03-08 14:33 ` [PATCH 07/22] btrfs: drop fs_info parameter from tree_mod_log_insert_move David Sterba
2018-03-08 14:33 ` [PATCH 08/22] btrfs: drop fs_info parameter from tree_mod_log_insert_key David Sterba
2018-03-08 14:33 ` [PATCH 09/22] btrfs: drop fs_info parameter from tree_mod_log_free_eb David Sterba
2018-03-08 14:33 ` [PATCH 10/22] " David Sterba
2018-03-08 14:33 ` [PATCH 11/22] btrfs: drop unused fs_info parameter from tree_mod_log_eb_move David Sterba
2018-03-08 14:33 ` [PATCH 12/22] btrfs: embed tree_mod_move structure to tree_mod_elem David Sterba
2018-03-08 14:33 ` [PATCH 13/22] btrfs: drop fs_info parameter from __tree_mod_log_oldest_root David Sterba
2018-03-08 14:33 ` [PATCH 14/22] btrfs: remove trivial locking wrappers of tree mod log David Sterba
2018-03-08 15:37 ` Nikolay Borisov
2018-03-08 15:56 ` David Sterba
2018-03-08 14:33 ` [PATCH 15/22] btrfs: kill trivial wrapper tree_mod_log_eb_move David Sterba
2018-03-08 14:33 ` [PATCH 16/22] btrfs: kill tree_mod_log_set_node_key helper David Sterba
2018-03-08 14:33 ` [PATCH 17/22] btrfs: kill tree_mod_log_set_root_pointer helper David Sterba
2018-03-08 15:40 ` Nikolay Borisov [this message]
2018-03-08 14:33 ` [PATCH 18/22] btrfs: move allocation after simple tests in tree_mod_log_insert_key David Sterba
2018-03-08 15:26 ` Filipe Manana
2018-03-08 15:54 ` David Sterba
2018-03-08 14:33 ` [PATCH 19/22] btrfs: separate types for submit_bio_start and submit_bio_done David Sterba
2018-03-08 14:33 ` [PATCH 20/22] btrfs: remove unused parameters from extent_submit_bio_start_t David Sterba
2018-03-08 14:33 ` [PATCH 21/22] btrfs: remove unused parameters from extent_submit_bio_done_t David Sterba
2018-03-08 14:33 ` [PATCH 22/22] btrfs: rename submit callbacks and drop double underscores 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=daf312a4-a82d-8376-47e3-55c29eceb3e8@suse.com \
--to=nborisov@suse.com \
--cc=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/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).