]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: scrub: move error reporting members to stack
authorQu Wenruo <wqu@suse.com>
Fri, 2 May 2025 00:00:35 +0000 (09:30 +0930)
committerDavid Sterba <dsterba@suse.com>
Thu, 15 May 2025 12:30:54 +0000 (14:30 +0200)
commitce6920dba8fbab888bb5e913a37ed406edb7ce4e
tree3ef537e0f05589304d4e64439028b47b61f44a06
parentec1f3a207cdf314eae4d4ae145f1ffdb829f0652
btrfs: scrub: move error reporting members to stack

Currently the following members of scrub_stripe are only utilized for
error reporting:

- init_error_bitmap
- init_nr_io_errors
- init_nr_csum_errors
- init_nr_meta_errors
- init_nr_meta_gen_errors

There is no need to put all those members into scrub_stripe, which take
24 bytes for each stripe, and we have 128 stripes for each device.

Instead introduce a structure, scrub_error_records, and move all above
members into that structure.

And allocate such structure from stack inside
scrub_stripe_read_repair_worker().
Since that function is called from a workqueue context, we have more
than enough stack space for just 24 bytes.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/scrub.c