From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Cc: Anand Jain <anand.jain@oracle.com>
Subject: [RFC PATCH] btrfs: remove struct scrub_stx for superblock scrubbing
Date: Tue, 21 Mar 2023 13:23:54 +0800 [thread overview]
Message-ID: <10d0f55b196d4dc949f0ac29f2f0af023eaa7523.1679376183.git.anand.jain@oracle.com> (raw)
Following the patchset that implements reader-friendly scrub code
made the struct scrub_stx is no longer required for scrubbing superblocks.
btrfs: scrub: use a more reader friendly code to implement scrub_simple_mirror()
Therefore, scrub_ctx does not need to be passed as a parameter,
(unless there are other plans for it).
This patch cleans up the code and is built on top of the above patchset.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
fs/btrfs/scrub.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index beccf763ae64..bc87277559d3 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -4909,12 +4909,12 @@ int scrub_enumerate_chunks(struct scrub_ctx *sctx,
return ret;
}
-static int scrub_one_super(struct scrub_ctx *sctx, struct btrfs_device *dev,
- struct page *page, u64 physical, u64 generation)
+static int scrub_one_super(struct btrfs_device *dev, struct page *page,
+ u64 physical, u64 generation)
{
- struct btrfs_fs_info *fs_info = sctx->fs_info;
struct bio_vec bvec;
struct bio bio;
+ struct btrfs_fs_info *fs_info = dev->fs_info;
struct btrfs_super_block *sb = page_address(page);
int ret;
@@ -4945,15 +4945,14 @@ static int scrub_one_super(struct scrub_ctx *sctx, struct btrfs_device *dev,
return ret;
}
-static noinline_for_stack int scrub_supers(struct scrub_ctx *sctx,
- struct btrfs_device *scrub_dev)
+static noinline_for_stack int scrub_supers(struct btrfs_device *scrub_dev)
{
int i;
u64 bytenr;
u64 gen;
int ret = 0;
struct page *page;
- struct btrfs_fs_info *fs_info = sctx->fs_info;
+ struct btrfs_fs_info *fs_info = scrub_dev->fs_info;
if (BTRFS_FS_ERROR(fs_info))
return -EROFS;
@@ -4976,7 +4975,7 @@ static noinline_for_stack int scrub_supers(struct scrub_ctx *sctx,
if (!btrfs_check_super_location(scrub_dev, bytenr))
continue;
- ret = scrub_one_super(sctx, scrub_dev, page, bytenr, gen);
+ ret = scrub_one_super(scrub_dev, page, bytenr, gen);
if (ret)
break;
}
@@ -5172,7 +5171,7 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
* kick off writing super in log tree sync.
*/
mutex_lock(&fs_info->fs_devices->device_list_mutex);
- ret = scrub_supers(sctx, dev);
+ ret = scrub_supers(dev);
mutex_unlock(&fs_info->fs_devices->device_list_mutex);
spin_lock(&sctx->stat_lock);
--
2.38.1
next reply other threads:[~2023-03-21 5:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-21 5:23 Anand Jain [this message]
2023-03-21 7:26 ` [RFC PATCH] btrfs: remove struct scrub_stx for superblock scrubbing Qu Wenruo
2023-03-21 10:11 ` Anand Jain
2023-03-23 1:13 ` Qu Wenruo
2023-03-23 2:56 ` Anand Jain
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=10d0f55b196d4dc949f0ac29f2f0af023eaa7523.1679376183.git.anand.jain@oracle.com \
--to=anand.jain@oracle.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).