linux/fs/btrfs/tests
Filipe Manana 2a1ed20f0d btrfs: remove op field from struct btrfs_free_space_ctl
The op field always points to the same use_bitmap function, the only
exception is during self tests where we make it temporarily point to a
different function. So just because of this op pointer field we are
increasing the structure size by 8 bytes.

Instead of storing a pointer to a use_bitmap function in struct
btrfs_free_space_ctl, move the pointer to struct btrfs_info, make
insert_into_bitmap() use that pointer if we are running the self tests
and initialize that pointer to the current, default use_bitmap function
(now exported for the tests as btrfs_use_bitmap). This way we reduce
the size of struct btrfs_free_space_ctl from 136 to 128 bytes and can
now fit 32 structures in a 4K page instead of 30. This also avoids the
cost of the indirection of a function pointer call when we are not
running the self tests.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2026-06-08 15:53:29 +02:00
..
btrfs-tests.c btrfs: remove op field from struct btrfs_free_space_ctl 2026-06-08 15:53:29 +02:00
btrfs-tests.h btrfs: tests: zoned: add tests cases for zoned code 2026-04-07 18:55:52 +02:00
chunk-allocation-tests.c btrfs: tests: add unit tests for pending extent walking functions 2026-02-03 07:56:25 +01:00
delayed-refs-tests.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
extent-buffer-tests.c btrfs: abort transaction on generation mismatch when marking eb as dirty 2023-10-12 16:44:07 +02:00
extent-io-tests.c folio_batch: rename pagevec.h to folio_batch.h 2026-04-05 13:53:07 -07:00
extent-map-tests.c btrfs: tests: prepare extent map tests for strict alignment checks 2026-02-03 07:56:19 +01:00
free-space-tests.c btrfs: remove op field from struct btrfs_free_space_ctl 2026-06-08 15:53:29 +02:00
free-space-tree-tests.c btrfs: use the btrfs_block_group_end() helper everywhere 2026-02-03 07:54:36 +01:00
inode-tests.c btrfs: tests: remove invalid file extent map tests 2026-02-03 07:56:19 +01:00
qgroup-tests.c btrfs: tests: fix root tree leak in btrfs_test_qgroups() 2026-01-09 17:41:45 +01:00
raid-stripe-tree-tests.c btrfs: selftests: add a selftest for deleting two out of three extents 2025-01-14 15:57:55 +01:00
zoned-tests.c btrfs: replace kcalloc() calls to kzalloc_objs() 2026-04-07 18:55:59 +02:00