From: Filipe Manana <fdmanana@gmail.com>
To: Josef Bacik <josef@toxicpanda.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>, kernel-team@fb.com
Subject: Re: [PATCH 5/8] btrfs: remove __btrfs_read_lock_root_node
Date: Mon, 9 Nov 2020 10:20:59 +0000 [thread overview]
Message-ID: <CAL3q7H4PqK1Uf_duNZJNzxzqgsVatvTmu0V3qnKRGVkRnYzijg@mail.gmail.com> (raw)
In-Reply-To: <295a64e139b18fdbedd872f2be8c4688d9f18364.1604697895.git.josef@toxicpanda.com>
On Fri, Nov 6, 2020 at 9:30 PM Josef Bacik <josef@toxicpanda.com> wrote:
>
> We no longer have recursive locking, so remove this variant.
>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Looks good, thanks.
> ---
> fs/btrfs/ctree.c | 2 +-
> fs/btrfs/locking.c | 5 ++---
> fs/btrfs/locking.h | 8 +-------
> 3 files changed, 4 insertions(+), 11 deletions(-)
>
> diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
> index cdd86ced917a..ef7389e6be3d 100644
> --- a/fs/btrfs/ctree.c
> +++ b/fs/btrfs/ctree.c
> @@ -2588,7 +2588,7 @@ static struct extent_buffer *btrfs_search_slot_get_root(struct btrfs_root *root,
> * We don't know the level of the root node until we actually
> * have it read locked
> */
> - b = __btrfs_read_lock_root_node(root, 0);
> + b = btrfs_read_lock_root_node(root);
> level = btrfs_header_level(b);
> if (level > write_lock_level)
> goto out;
> diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c
> index 9b66154803a7..c8b239376fb4 100644
> --- a/fs/btrfs/locking.c
> +++ b/fs/btrfs/locking.c
> @@ -185,14 +185,13 @@ struct extent_buffer *btrfs_lock_root_node(struct btrfs_root *root)
> *
> * Return: root extent buffer with read lock held
> */
> -struct extent_buffer *__btrfs_read_lock_root_node(struct btrfs_root *root,
> - bool recurse)
> +struct extent_buffer *btrfs_read_lock_root_node(struct btrfs_root *root)
> {
> struct extent_buffer *eb;
>
> while (1) {
> eb = btrfs_root_node(root);
> - __btrfs_tree_read_lock(eb, BTRFS_NESTING_NORMAL, recurse);
> + btrfs_tree_read_lock(eb);
> if (eb == root->node)
> break;
> btrfs_tree_read_unlock(eb);
> diff --git a/fs/btrfs/locking.h b/fs/btrfs/locking.h
> index f8f2fd835582..91441e31db18 100644
> --- a/fs/btrfs/locking.h
> +++ b/fs/btrfs/locking.h
> @@ -94,13 +94,7 @@ void btrfs_tree_read_unlock(struct extent_buffer *eb);
> int btrfs_try_tree_read_lock(struct extent_buffer *eb);
> int btrfs_try_tree_write_lock(struct extent_buffer *eb);
> struct extent_buffer *btrfs_lock_root_node(struct btrfs_root *root);
> -struct extent_buffer *__btrfs_read_lock_root_node(struct btrfs_root *root,
> - bool recurse);
> -
> -static inline struct extent_buffer *btrfs_read_lock_root_node(struct btrfs_root *root)
> -{
> - return __btrfs_read_lock_root_node(root, false);
> -}
> +struct extent_buffer *btrfs_read_lock_root_node(struct btrfs_root *root);
>
> #ifdef CONFIG_BTRFS_DEBUG
> static inline void btrfs_assert_tree_locked(struct extent_buffer *eb) {
> --
> 2.26.2
>
--
Filipe David Manana,
“Whether you think you can, or you think you can't — you're right.”
next prev parent reply other threads:[~2020-11-09 10:21 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-06 21:27 [PATCH 0/8] Locking cleanups and lockdep fix Josef Bacik
2020-11-06 21:27 ` [PATCH 1/8] btrfs: cleanup the locking in btrfs_next_old_leaf Josef Bacik
2020-11-09 10:06 ` Filipe Manana
2020-11-06 21:27 ` [PATCH 2/8] btrfs: unlock to current level " Josef Bacik
2020-11-09 10:12 ` Filipe Manana
2020-11-06 21:27 ` [PATCH 3/8] btrfs: kill path->recurse Josef Bacik
2020-11-09 10:19 ` Filipe Manana
2020-11-06 21:27 ` [PATCH 4/8] btrfs: remove the recursion handling code in locking.c Josef Bacik
2020-11-09 10:20 ` Filipe Manana
2020-11-11 14:14 ` David Sterba
2020-11-11 14:29 ` David Sterba
2020-11-11 14:43 ` Josef Bacik
2020-11-11 14:59 ` David Sterba
2020-11-06 21:27 ` [PATCH 5/8] btrfs: remove __btrfs_read_lock_root_node Josef Bacik
2020-11-09 10:20 ` Filipe Manana [this message]
2020-11-06 21:27 ` [PATCH 6/8] btrfs: use btrfs_tree_read_lock in btrfs_search_slot Josef Bacik
2020-11-09 10:21 ` Filipe Manana
2020-11-06 21:27 ` [PATCH 7/8] btrfs: remove the recurse parameter from __btrfs_tree_read_lock Josef Bacik
2020-11-09 10:22 ` Filipe Manana
2020-11-06 21:27 ` [PATCH 8/8] btrfs: remove ->recursed from extent_buffer Josef Bacik
2020-11-09 10:23 ` Filipe Manana
2020-11-12 18:18 ` [PATCH 0/8] Locking cleanups and lockdep fix 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=CAL3q7H4PqK1Uf_duNZJNzxzqgsVatvTmu0V3qnKRGVkRnYzijg@mail.gmail.com \
--to=fdmanana@gmail.com \
--cc=josef@toxicpanda.com \
--cc=kernel-team@fb.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).