Files
linux/include/trace/events
Qu Wenruo 18d758a2d8 btrfs: replace btrfs_io_context::raid_map with a fixed u64 value
In btrfs_io_context structure, we have a pointer raid_map, which
indicates the logical bytenr for each stripe.

But considering we always call sort_parity_stripes(), the result
raid_map[] is always sorted, thus raid_map[0] is always the logical
bytenr of the full stripe.

So why we waste the space and time (for sorting) for raid_map?

This patch will replace btrfs_io_context::raid_map with a single u64
number, full_stripe_start, by:

- Replace btrfs_io_context::raid_map with full_stripe_start

- Replace call sites using raid_map[0] to use full_stripe_start

- Replace call sites using raid_map[i] to compare with nr_data_stripes.

The benefits are:

- Less memory wasted on raid_map
  It's sizeof(u64) * num_stripes vs sizeof(u64).
  It'll always save at least one u64, and the benefit grows larger with
  num_stripes.

- No more weird alloc_btrfs_io_context() behavior
  As there is only one fixed size + one variable length array.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2023-04-17 18:01:14 +02:00
..
2020-11-30 12:54:01 +00:00
2022-12-07 13:54:09 -08:00
2022-11-21 09:45:49 -06:00
2022-09-21 10:30:42 -06:00
2023-01-13 16:39:18 +01:00
2022-12-08 21:49:12 -05:00
2023-02-02 22:33:13 -08:00
2022-08-03 17:50:58 +02:00
2020-04-22 12:55:54 -07:00
2023-03-22 14:05:24 -07:00
2022-12-10 11:01:12 -05:00
2022-07-30 14:01:30 -04:00
2023-02-20 08:28:49 +00:00
2022-04-07 20:33:15 -07:00