Skip to content

Commit c2bbc0b

Browse files
adam900710kdave
authored andcommitted
btrfs: scrub: remove scrub_ctx::csum_list member
Since the rework of scrub introduced by commit 2af2aaf ("btrfs: scrub: introduce structure for new BTRFS_STRIPE_LEN based interface") and later commits, scrub no longer keeps its data checksum inside sctx. Instead we have scrub_stripe::csums for the checksum of the stripe. Thus we can remove the unused scrub_ctx::csum_list member. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 6822b3f commit c2bbc0b

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

fs/btrfs/scrub.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ struct scrub_ctx {
177177
struct btrfs_fs_info *fs_info;
178178
int first_free;
179179
int cur_stripe;
180-
struct list_head csum_list;
181180
atomic_t cancel_req;
182181
int readonly;
183182
int sectors_per_bio;
@@ -309,17 +308,6 @@ static void scrub_blocked_if_needed(struct btrfs_fs_info *fs_info)
309308
scrub_pause_off(fs_info);
310309
}
311310

312-
static void scrub_free_csums(struct scrub_ctx *sctx)
313-
{
314-
while (!list_empty(&sctx->csum_list)) {
315-
struct btrfs_ordered_sum *sum;
316-
sum = list_first_entry(&sctx->csum_list,
317-
struct btrfs_ordered_sum, list);
318-
list_del(&sum->list);
319-
kfree(sum);
320-
}
321-
}
322-
323311
static noinline_for_stack void scrub_free_ctx(struct scrub_ctx *sctx)
324312
{
325313
int i;
@@ -330,7 +318,6 @@ static noinline_for_stack void scrub_free_ctx(struct scrub_ctx *sctx)
330318
for (i = 0; i < SCRUB_STRIPES_PER_SCTX; i++)
331319
release_scrub_stripe(&sctx->stripes[i]);
332320

333-
scrub_free_csums(sctx);
334321
kfree(sctx);
335322
}
336323

@@ -352,7 +339,6 @@ static noinline_for_stack struct scrub_ctx *scrub_setup_ctx(
352339
refcount_set(&sctx->refs, 1);
353340
sctx->is_dev_replace = is_dev_replace;
354341
sctx->fs_info = fs_info;
355-
INIT_LIST_HEAD(&sctx->csum_list);
356342
for (i = 0; i < SCRUB_STRIPES_PER_SCTX; i++) {
357343
int ret;
358344

0 commit comments

Comments
 (0)