All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
To: David Sterba <dsterba@suse.com>
Cc: Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	linux-btrfs@vger.kernel.org, Nikolay Borisov <nborisov@suse.com>,
	Naohiro Aota <Naohiro.Aota@wdc.com>
Subject: [PATCH 13/21] btrfs: make scrub_submit and scrub_wr_submit non-static
Date: Wed, 24 Nov 2021 01:30:39 -0800	[thread overview]
Message-ID: <d146a531c25f1ad1b621bb3b4db9c219181f46d1.1637745470.git.johannes.thumshirn@wdc.com> (raw)
In-Reply-To: <cover.1637745470.git.johannes.thumshirn@wdc.com>

This is a preparation for moving zoned related code out of scrub.c and
into zoned.c.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 fs/btrfs/scrub.c | 43 +++++++++++++++++++++----------------------
 fs/btrfs/scrub.h |  2 ++
 2 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index ccb74f2e75b92..e8fa305f71a10 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -204,7 +204,6 @@ static void scrub_remap_extent(struct btrfs_fs_info *fs_info,
 			       int *extent_mirror_num);
 static int scrub_add_page_to_wr_bio(struct scrub_ctx *sctx,
 				    struct scrub_page *spage);
-static void scrub_wr_submit(struct scrub_ctx *sctx);
 static void scrub_wr_bio_end_io(struct bio *bio);
 static void scrub_wr_bio_end_io_worker(struct btrfs_work *work);
 static void scrub_put_ctx(struct scrub_ctx *sctx);
@@ -1626,7 +1625,7 @@ static int scrub_add_page_to_wr_bio(struct scrub_ctx *sctx,
 		   spage->physical_for_dev_replace ||
 		   sbio->logical + sbio->page_count * sectorsize !=
 		   spage->logical) {
-		scrub_wr_submit(sctx);
+		btrfs_scrub_wr_submit(sctx);
 		goto again;
 	}
 
@@ -1638,7 +1637,7 @@ static int scrub_add_page_to_wr_bio(struct scrub_ctx *sctx,
 			mutex_unlock(&sctx->wr_lock);
 			return -EIO;
 		}
-		scrub_wr_submit(sctx);
+		btrfs_scrub_wr_submit(sctx);
 		goto again;
 	}
 
@@ -1646,13 +1645,13 @@ static int scrub_add_page_to_wr_bio(struct scrub_ctx *sctx,
 	scrub_page_get(spage);
 	sbio->page_count++;
 	if (sbio->page_count == sctx->pages_per_wr_bio)
-		scrub_wr_submit(sctx);
+		btrfs_scrub_wr_submit(sctx);
 	mutex_unlock(&sctx->wr_lock);
 
 	return 0;
 }
 
-static void scrub_wr_submit(struct scrub_ctx *sctx)
+void btrfs_scrub_wr_submit(struct scrub_ctx *sctx)
 {
 	struct scrub_bio *sbio;
 
@@ -1989,7 +1988,7 @@ static void scrub_throttle(struct scrub_ctx *sctx)
 	sctx->throttle_deadline = 0;
 }
 
-static void scrub_submit(struct scrub_ctx *sctx)
+void btrfs_scrub_submit(struct scrub_ctx *sctx)
 {
 	struct scrub_bio *sbio;
 
@@ -2053,7 +2052,7 @@ static int scrub_add_page_to_rd_bio(struct scrub_ctx *sctx,
 		   sbio->logical + sbio->page_count * sectorsize !=
 		   spage->logical ||
 		   sbio->dev != spage->dev) {
-		scrub_submit(sctx);
+		btrfs_scrub_submit(sctx);
 		goto again;
 	}
 
@@ -2065,7 +2064,7 @@ static int scrub_add_page_to_rd_bio(struct scrub_ctx *sctx,
 			sbio->bio = NULL;
 			return -EIO;
 		}
-		scrub_submit(sctx);
+		btrfs_scrub_submit(sctx);
 		goto again;
 	}
 
@@ -2073,7 +2072,7 @@ static int scrub_add_page_to_rd_bio(struct scrub_ctx *sctx,
 	atomic_inc(&sblock->outstanding_pages);
 	sbio->page_count++;
 	if (sbio->page_count == sctx->pages_per_rd_bio)
-		scrub_submit(sctx);
+		btrfs_scrub_submit(sctx);
 
 	return 0;
 }
@@ -2125,7 +2124,7 @@ static void scrub_missing_raid56_worker(struct btrfs_work *work)
 
 	if (sctx->is_dev_replace && sctx->flush_all_writes) {
 		mutex_lock(&sctx->wr_lock);
-		scrub_wr_submit(sctx);
+		btrfs_scrub_wr_submit(sctx);
 		mutex_unlock(&sctx->wr_lock);
 	}
 
@@ -2281,7 +2280,7 @@ static int scrub_pages(struct scrub_ctx *sctx, u64 logical, u32 len,
 		}
 
 		if (flags & BTRFS_EXTENT_FLAG_SUPER)
-			scrub_submit(sctx);
+			btrfs_scrub_submit(sctx);
 	}
 
 	/* last one frees, either here or in bio completion for last page */
@@ -2335,7 +2334,7 @@ static void scrub_bio_end_io_worker(struct btrfs_work *work)
 
 	if (sctx->is_dev_replace && sctx->flush_all_writes) {
 		mutex_lock(&sctx->wr_lock);
-		scrub_wr_submit(sctx);
+		btrfs_scrub_wr_submit(sctx);
 		mutex_unlock(&sctx->wr_lock);
 	}
 
@@ -3048,9 +3047,9 @@ static noinline_for_stack int scrub_raid56_parity(struct scrub_ctx *sctx,
 						logic_end - logic_start);
 	}
 	scrub_parity_put(sparity);
-	scrub_submit(sctx);
+	btrfs_scrub_submit(sctx);
 	mutex_lock(&sctx->wr_lock);
-	scrub_wr_submit(sctx);
+	btrfs_scrub_wr_submit(sctx);
 	mutex_unlock(&sctx->wr_lock);
 
 	btrfs_release_path(path);
@@ -3063,9 +3062,9 @@ static void sync_replace_for_zoned(struct scrub_ctx *sctx)
 		return;
 
 	sctx->flush_all_writes = true;
-	scrub_submit(sctx);
+	btrfs_scrub_submit(sctx);
 	mutex_lock(&sctx->wr_lock);
-	scrub_wr_submit(sctx);
+	btrfs_scrub_wr_submit(sctx);
 	mutex_unlock(&sctx->wr_lock);
 
 	wait_event(sctx->list_wait, atomic_read(&sctx->bios_in_flight) == 0);
@@ -3233,9 +3232,9 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx,
 		if (atomic_read(&fs_info->scrub_pause_req)) {
 			/* push queued extents */
 			sctx->flush_all_writes = true;
-			scrub_submit(sctx);
+			btrfs_scrub_submit(sctx);
 			mutex_lock(&sctx->wr_lock);
-			scrub_wr_submit(sctx);
+			btrfs_scrub_wr_submit(sctx);
 			mutex_unlock(&sctx->wr_lock);
 			wait_event(sctx->list_wait,
 				   atomic_read(&sctx->bios_in_flight) == 0);
@@ -3464,9 +3463,9 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx,
 	}
 out:
 	/* push queued extents */
-	scrub_submit(sctx);
+	btrfs_scrub_submit(sctx);
 	mutex_lock(&sctx->wr_lock);
-	scrub_wr_submit(sctx);
+	btrfs_scrub_wr_submit(sctx);
 	mutex_unlock(&sctx->wr_lock);
 
 	blk_finish_plug(&plug);
@@ -3778,9 +3777,9 @@ int scrub_enumerate_chunks(struct scrub_ctx *sctx,
 		 * changes to 0.
 		 */
 		sctx->flush_all_writes = true;
-		scrub_submit(sctx);
+		btrfs_scrub_submit(sctx);
 		mutex_lock(&sctx->wr_lock);
-		scrub_wr_submit(sctx);
+		btrfs_scrub_wr_submit(sctx);
 		mutex_unlock(&sctx->wr_lock);
 
 		wait_event(sctx->list_wait,
diff --git a/fs/btrfs/scrub.h b/fs/btrfs/scrub.h
index 3eb8c8905c902..8d17fac108556 100644
--- a/fs/btrfs/scrub.h
+++ b/fs/btrfs/scrub.h
@@ -48,4 +48,6 @@ struct scrub_ctx {
 	refcount_t              refs;
 };
 
+void btrfs_scrub_submit(struct scrub_ctx *sctx);
+void btrfs_scrub_wr_submit(struct scrub_ctx *sctx);
 #endif /* BTRFS_SCRUB_H */
-- 
2.31.1


  parent reply	other threads:[~2021-11-24  9:31 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24  9:30 [PATCH 00/21] btrfs: first batch of zoned cleanups Johannes Thumshirn
2021-11-24  9:30 ` [PATCH 01/21] btrfs: zoned: encapsulate inode locking for zoned relocation Johannes Thumshirn
2021-11-24  9:30 ` [PATCH 02/21] btrfs: zoned: simplify btrfs_check_meta_write_pointer Johannes Thumshirn
2021-11-24  9:30 ` [PATCH 03/21] btrfs: zoned: sink zone check into btrfs_repair_one_zone Johannes Thumshirn
2021-11-24 16:28   ` Josef Bacik
2021-11-24 17:29   ` David Sterba
2021-11-25  7:13     ` Johannes Thumshirn
2021-11-24  9:30 ` [PATCH 04/21] btrfs: zoned: it's pointless to check for REQ_OP_ZONE_APPEND and btrfs_is_zoned Johannes Thumshirn
2021-11-24 17:33   ` David Sterba
2021-11-24  9:30 ` [PATCH 05/21] btrfs: zoned: move compatible fs flags check to zoned code Johannes Thumshirn
2021-11-24 17:36   ` David Sterba
2021-11-25 10:00     ` Johannes Thumshirn
2021-11-24  9:30 ` [PATCH 06/21] btrfs: zoned: move mark_block_group_to_copy " Johannes Thumshirn
2021-11-24 17:48   ` David Sterba
2021-11-24  9:30 ` [PATCH 07/21] btrfs: zoned: move btrfs_finish_block_group_to_copy " Johannes Thumshirn
2021-11-24  9:30 ` [PATCH 08/21] btrfs: zoned: move is_block_group_to_copy " Johannes Thumshirn
2021-11-24  9:30 ` [PATCH 09/21] btrfs: zoned: skip zoned check if block_group is marked as copy Johannes Thumshirn
2021-11-29  8:18   ` [btrfs] a323b5f59e: xfstests.btrfs.167.fail kernel test robot
2021-11-29  8:18     ` kernel test robot
2021-11-24  9:30 ` [PATCH 10/21] btrfs: move struct scrub_ctx to scrub.h Johannes Thumshirn
2021-11-26 16:48   ` David Sterba
2021-11-24  9:30 ` [PATCH 11/21] btrfs: zoned: move fill_writer_pointer_gap to zoned code Johannes Thumshirn
2021-11-24  9:30 ` [PATCH 12/21] btrfs: zoned: sync_write_pointer_for_zoned " Johannes Thumshirn
2021-11-24  9:30 ` Johannes Thumshirn [this message]
2021-11-24  9:30 ` [PATCH 14/21] btrfs: zoned: move sync_replace_for_zoned " Johannes Thumshirn
2021-11-24  9:30 ` [PATCH 15/21] btrfs: zoned: move finish_extent_writes_for_zoned " Johannes Thumshirn
2021-11-24  9:30 ` [PATCH 16/21] btrfs: move btrfs_scrub_dev() definition to scrub.h Johannes Thumshirn
2021-11-24  9:30 ` [PATCH 17/21] btrfs: move btrfs_scrub_pause() " Johannes Thumshirn
2021-11-24  9:30 ` [PATCH 18/21] btrfs: move btrfs_scrub_continue() " Johannes Thumshirn
2021-11-24  9:30 ` [PATCH 19/21] btrfs: move btrfs_scrub_cancel() " Johannes Thumshirn
2021-11-24  9:30 ` [PATCH 20/21] btrfs: move btrfs_scrub_cancel_dev() " Johannes Thumshirn
2021-11-24  9:30 ` [PATCH 21/21] btrfs: move btrfs_scrub_progress() " Johannes Thumshirn
2021-11-24 16:34 ` [PATCH 00/21] btrfs: first batch of zoned cleanups Josef Bacik
2021-11-25  9:58   ` Johannes Thumshirn

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=d146a531c25f1ad1b621bb3b4db9c219181f46d1.1637745470.git.johannes.thumshirn@wdc.com \
    --to=johannes.thumshirn@wdc.com \
    --cc=Naohiro.Aota@wdc.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@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 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.