mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

The structure scrub_parity is used to indicate that some extents are scrubbed for the purpose of RAID56 P/Q scrubbing. Since the whole RAID56 P/Q scrubbing path has been replaced with new scrub_stripe infrastructure, and we no longer need to use scrub_parity to modify the behavior of data stripes, we can remove it completely. This removal involves: - scrub_parity_workers Now only one worker would be utilized, scrub_workers, to do the read and repair. All writeback would happen at the main scrub thread. - scrub_block::sparity member - scrub_parity structure - function scrub_parity_get() - function scrub_parity_put() - function scrub_free_parity() - function __scrub_mark_bitmap() - function scrub_parity_mark_sectors_error() - function scrub_parity_mark_sectors_data() These helpers are no longer needed, scrub_stripe has its bitmaps and we can use bitmap helpers to get the error/data status. - scrub_parity_bio_endio() - scrub_parity_check_and_repair() - function scrub_sectors_for_parity() - function scrub_extent_for_parity() - function scrub_raid56_data_stripe_for_parity() - function scrub_raid56_parity() The new code would reuse the scrub read-repair and writeback path. Just skip the dev-replace phase. And scrub_stripe infrastructure allows us to submit and wait for those data stripes before scrubbing P/Q, without extra infrastructure. The following two functions are temporarily exported for later cleanup: - scrub_find_csum() - scrub_add_sector_to_rd_bio() Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
23 lines
847 B
C
23 lines
847 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef BTRFS_SCRUB_H
|
|
#define BTRFS_SCRUB_H
|
|
|
|
int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
|
|
u64 end, struct btrfs_scrub_progress *progress,
|
|
int readonly, int is_dev_replace);
|
|
void btrfs_scrub_pause(struct btrfs_fs_info *fs_info);
|
|
void btrfs_scrub_continue(struct btrfs_fs_info *fs_info);
|
|
int btrfs_scrub_cancel(struct btrfs_fs_info *info);
|
|
int btrfs_scrub_cancel_dev(struct btrfs_device *dev);
|
|
int btrfs_scrub_progress(struct btrfs_fs_info *fs_info, u64 devid,
|
|
struct btrfs_scrub_progress *progress);
|
|
|
|
/* Temporary declaration, would be deleted later. */
|
|
struct scrub_ctx;
|
|
struct scrub_sector;
|
|
int scrub_find_csum(struct scrub_ctx *sctx, u64 logical, u8 *csum);
|
|
int scrub_add_sector_to_rd_bio(struct scrub_ctx *sctx,
|
|
struct scrub_sector *sector);
|
|
|
|
#endif
|