diff options
| author | David Sterba <dsterba@suse.com> | 2025-07-01 19:23:52 +0200 | 
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2025-07-22 00:09:21 +0200 | 
| commit | 1ed0f75d57aef3c447fbc78885c90421e40c1755 (patch) | |
| tree | 701010d0a5b3b26ccbb23ac2ac7d2c68503fc4c0 /rust/helpers/pci.c | |
| parent | 58383c6866a76acb719b1f22caaba64fa4dd3f6e (diff) | |
btrfs: accessors: compile-time fast path for u16
Reading/writing 2 bytes (u16) may need 2 folios to be written to, each
time it's just one byte so using memcpy for that is an overkill.
Add a branch for the split case so that memcpy is now used for u32 and
u64. Another side effect is that the u16 types now don't need additional
stack space, everything fits to registers.
Stack usage is reduced:
  btrfs_get_16                                           -8 (32 -> 24)
  btrfs_set_16                                          -16 (32 -> 16)
Code size reduction:
     text    data     bss     dec     hex filename
  1454691  115665   16088 1586444  18350c pre/btrfs.ko
  1454459  115665   16088 1586212  183424 post/btrfs.ko
  DELTA: -232
Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'rust/helpers/pci.c')
0 files changed, 0 insertions, 0 deletions
