* [PATCH] btrfs: scrub: Remove some unused functions
@ 2023-05-12 5:44 Jiapeng Chong
2023-05-12 8:48 ` David Sterba
0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2023-05-12 5:44 UTC (permalink / raw)
To: clm; +Cc: josef, dsterba, linux-btrfs, linux-kernel, Jiapeng Chong, Abaci Robot
These functions are defined in the scrub.c file, but not called
elsewhere, so delete these unused functions.
fs/btrfs/scrub.c:553:20: warning: unused function 'scrub_stripe_index_and_offset'.
fs/btrfs/scrub.c:543:19: warning: unused function 'scrub_nr_raid_mirrors'.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4937
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
fs/btrfs/scrub.c | 42 ------------------------------------------
1 file changed, 42 deletions(-)
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 836725a19661..6fd90c8fd64a 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -540,48 +540,6 @@ static void scrub_print_common_warning(const char *errstr, struct btrfs_device *
btrfs_free_path(path);
}
-static inline int scrub_nr_raid_mirrors(struct btrfs_io_context *bioc)
-{
- if (bioc->map_type & BTRFS_BLOCK_GROUP_RAID5)
- return 2;
- else if (bioc->map_type & BTRFS_BLOCK_GROUP_RAID6)
- return 3;
- else
- return (int)bioc->num_stripes;
-}
-
-static inline void scrub_stripe_index_and_offset(u64 logical, u64 map_type,
- u64 full_stripe_logical,
- int nstripes, int mirror,
- int *stripe_index,
- u64 *stripe_offset)
-{
- int i;
-
- if (map_type & BTRFS_BLOCK_GROUP_RAID56_MASK) {
- const int nr_data_stripes = (map_type & BTRFS_BLOCK_GROUP_RAID5) ?
- nstripes - 1 : nstripes - 2;
-
- /* RAID5/6 */
- for (i = 0; i < nr_data_stripes; i++) {
- const u64 data_stripe_start = full_stripe_logical +
- (i * BTRFS_STRIPE_LEN);
-
- if (logical >= data_stripe_start &&
- logical < data_stripe_start + BTRFS_STRIPE_LEN)
- break;
- }
-
- *stripe_index = i;
- *stripe_offset = (logical - full_stripe_logical) &
- BTRFS_STRIPE_LEN_MASK;
- } else {
- /* The other RAID type */
- *stripe_index = mirror;
- *stripe_offset = 0;
- }
-}
-
static int fill_writer_pointer_gap(struct scrub_ctx *sctx, u64 physical)
{
int ret = 0;
--
2.20.1.7.g153144c
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] btrfs: scrub: Remove some unused functions
2023-05-12 5:44 [PATCH] btrfs: scrub: Remove some unused functions Jiapeng Chong
@ 2023-05-12 8:48 ` David Sterba
0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2023-05-12 8:48 UTC (permalink / raw)
To: Jiapeng Chong; +Cc: clm, josef, dsterba, linux-btrfs, linux-kernel, Abaci Robot
On Fri, May 12, 2023 at 01:44:57PM +0800, Jiapeng Chong wrote:
> These functions are defined in the scrub.c file, but not called
> elsewhere, so delete these unused functions.
>
> fs/btrfs/scrub.c:553:20: warning: unused function 'scrub_stripe_index_and_offset'.
> fs/btrfs/scrub.c:543:19: warning: unused function 'scrub_nr_raid_mirrors'.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4937
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Added to misc-next, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-12 8:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-12 5:44 [PATCH] btrfs: scrub: Remove some unused functions Jiapeng Chong
2023-05-12 8:48 ` David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®