Re: [PATCH 0/7] Cleanup btrfs_item_* related helpers
From: David Sterba <hidden>
Date: 2021-11-08 19:31:19
On Thu, Oct 21, 2021 at 02:58:30PM -0400, Josef Bacik wrote:
Hello, We've got a lot of odd patterns with our btrfs_item* helpers. In a lot of places we use teh btrfs_item_*_nr() helpers, in some places we get the btrfs_item and then use the direct helpers on that. Our btrfs_item_key() helpers only take the slot. Fix this up by using a leaf+slot combination everywhere, and only use the offset calculations in the helpers. This gives us a net deletion of about 40 lines, and also allows me to more easily change the btrfs_item math when I change the size of btrfs_header in the future without needing to update all the callsites to pass in an extent buffer. Thanks, Josef Bacik (7): btrfs: use btrfs_item_size_nr/btrfs_item_offset_nr everywhere btrfs: add btrfs_set_item_*_nr() helpers btrfs: make btrfs_file_extent_inline_item_len take a slot btrfs: introduce item_nr token variant helpers btrfs: drop the _nr from the item helpers btrfs: remove the btrfs_item_end() helper btrfs: rename btrfs_item_end_nr to btrfs_item_data_end
Added to misc-next, thanks. It's a big conflict surface but hopefully all incorrect uses of the helpers in the old/new code should be caught by a mismatching types of the parameters.