From: Filipe Manana <fdmanana@kernel.org>
To: Josef Bacik <josef@toxicpanda.com>
Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH v2 2/3] btrfs: use btrfs_fs_info for deleting snapshots and cleaner
Date: Mon, 21 Feb 2022 12:40:15 +0000 [thread overview]
Message-ID: <YhOIL6ujpHoBn3++@debian9.Home> (raw)
In-Reply-To: <62d358e74de3ac1393c1e3e8d35d048b3d9861f2.1645214059.git.josef@toxicpanda.com>
On Fri, Feb 18, 2022 at 02:56:11PM -0500, Josef Bacik wrote:
> We're passing a root around here, but we only really need the fs_info,
> so fix up btrfs_clean_one_deleted_snapshot() to take an fs_info instead,
> and then fix up all the callers appropriately.
>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Looks good, thanks.
> ---
> fs/btrfs/disk-io.c | 7 +++----
> fs/btrfs/transaction.c | 4 ++--
> fs/btrfs/transaction.h | 2 +-
> 3 files changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index ed62e81c0b66..183baeffd9c9 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -1947,8 +1947,7 @@ static void end_workqueue_fn(struct btrfs_work *work)
>
> static int cleaner_kthread(void *arg)
> {
> - struct btrfs_root *root = arg;
> - struct btrfs_fs_info *fs_info = root->fs_info;
> + struct btrfs_fs_info *fs_info = (struct btrfs_fs_info *)arg;
> int again;
>
> while (1) {
> @@ -1981,7 +1980,7 @@ static int cleaner_kthread(void *arg)
>
> btrfs_run_delayed_iputs(fs_info);
>
> - again = btrfs_clean_one_deleted_snapshot(root);
> + again = btrfs_clean_one_deleted_snapshot(fs_info);
> mutex_unlock(&fs_info->cleaner_mutex);
>
> /*
> @@ -3806,7 +3805,7 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
> goto fail_sysfs;
> }
>
> - fs_info->cleaner_kthread = kthread_run(cleaner_kthread, tree_root,
> + fs_info->cleaner_kthread = kthread_run(cleaner_kthread, fs_info,
> "btrfs-cleaner");
> if (IS_ERR(fs_info->cleaner_kthread))
> goto fail_sysfs;
> diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
> index dfceee28a149..385c909f0db8 100644
> --- a/fs/btrfs/transaction.c
> +++ b/fs/btrfs/transaction.c
> @@ -2475,10 +2475,10 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
> * because btrfs_commit_super will poke cleaner thread and it will process it a
> * few seconds later.
> */
> -int btrfs_clean_one_deleted_snapshot(struct btrfs_root *root)
> +int btrfs_clean_one_deleted_snapshot(struct btrfs_fs_info *fs_info)
> {
> + struct btrfs_root *root;
> int ret;
> - struct btrfs_fs_info *fs_info = root->fs_info;
>
> spin_lock(&fs_info->trans_lock);
> if (list_empty(&fs_info->dead_roots)) {
> diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h
> index ba8a9826eb37..970ff316069d 100644
> --- a/fs/btrfs/transaction.h
> +++ b/fs/btrfs/transaction.h
> @@ -217,7 +217,7 @@ int btrfs_wait_for_commit(struct btrfs_fs_info *fs_info, u64 transid);
> void btrfs_add_dead_root(struct btrfs_root *root);
> int btrfs_defrag_root(struct btrfs_root *root);
> void btrfs_maybe_wake_unfinished_drop(struct btrfs_fs_info *fs_info);
> -int btrfs_clean_one_deleted_snapshot(struct btrfs_root *root);
> +int btrfs_clean_one_deleted_snapshot(struct btrfs_fs_info *fs_info);
> int btrfs_commit_transaction(struct btrfs_trans_handle *trans);
> void btrfs_commit_transaction_async(struct btrfs_trans_handle *trans);
> int btrfs_end_transaction_throttle(struct btrfs_trans_handle *trans);
> --
> 2.26.3
>
next prev parent reply other threads:[~2022-02-21 12:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-18 19:56 [PATCH v2 0/3] btrfs: fix problem with balance recovery and snap delete Josef Bacik
2022-02-18 19:56 ` [PATCH v2 1/3] btrfs: do not start relocation until in progress drops are done Josef Bacik
2022-02-21 12:38 ` Filipe Manana
2022-02-24 15:03 ` [btrfs] 0ac06c96a6: BUG:KASAN:use-after-free_in_btrfs_drop_snapshot kernel test robot
2022-02-24 15:03 ` kernel test robot
2022-02-18 19:56 ` [PATCH v2 2/3] btrfs: use btrfs_fs_info for deleting snapshots and cleaner Josef Bacik
2022-02-21 12:40 ` Filipe Manana [this message]
2022-02-18 19:56 ` [PATCH v2 3/3] btrfs: pass btrfs_fs_info to btrfs_recover_relocation Josef Bacik
2022-02-21 12:41 ` Filipe Manana
2022-02-21 16:20 ` [PATCH v2 0/3] btrfs: fix problem with balance recovery and snap delete David Sterba
2022-02-24 14:47 ` 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=YhOIL6ujpHoBn3++@debian9.Home \
--to=fdmanana@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.