OpenCloudOS-Kernel/fs/btrfs/tests
Qu Wenruo a97699d1d6 btrfs: replace map_lookup->stripe_len by BTRFS_STRIPE_LEN
Currently btrfs doesn't support stripe lengths other than 64KiB.
This is already set in the tree-checker.

There is really no meaning to record that fixed value in map_lookup for
now, and can all be replaced with BTRFS_STRIPE_LEN.

Furthermore we can use the fix stripe length to do the following
optimization:

- Use BTRFS_STRIPE_LEN_SHIFT to replace some 64bit division
  Now we only need to do a right shift.

  And the value of BTRFS_STRIPE_LEN itself is already too large for bit
  shift, thus if we accidentally use BTRFS_STRIPE_LEN to do bit shift,
  a compiler warning would be triggered.

  Thus this bit shift optimization would be safe.

- Use BTRFS_STRIPE_LEN_MASK to calculate the offset inside a stripe

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
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>
2023-04-17 18:01:14 +02:00
..
btrfs-tests.c fs: port inode_init_owner() to mnt_idmap 2023-01-19 09:24:28 +01:00
btrfs-tests.h btrfs: selftests: Add support for dummy devices 2020-01-23 17:24:34 +01:00
extent-buffer-tests.c btrfs: move accessor helpers into accessors.h 2022-12-05 18:00:42 +01:00
extent-io-tests.c btrfs: drop private_data parameter from extent_io_tree_init 2022-12-05 18:00:54 +01:00
extent-map-tests.c btrfs: replace map_lookup->stripe_len by BTRFS_STRIPE_LEN 2023-04-17 18:01:14 +02:00
free-space-tests.c btrfs: remove use btrfs_remove_free_space_cache instead of variant 2022-09-26 12:27:58 +02:00
free-space-tree-tests.c btrfs: convert btrfs_block_group::needs_free_space to runtime flag 2022-12-05 18:00:51 +01:00
inode-tests.c btrfs: selftests: remove impossible inline extent at non-zero file offset 2022-12-05 18:00:47 +01:00
qgroup-tests.c btrfs: use a structure to pass arguments to backref walking functions 2022-12-05 18:00:50 +01:00