summaryrefslogtreecommitdiff
path: root/scripts/ld-version.sh
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2022-11-15 19:16:17 +0300
committerDavid Sterba <dsterba@suse.com>2022-12-05 20:00:58 +0300
commit637e3b48c22e52daa645b49b73630af3f09328ae (patch)
treebdb71c02f1917fe133729d1328ef8a44613d43c8 /scripts/ld-version.sh
parente23efd8e8767165a6103cf0a4fe273f6b9f182f2 (diff)
downloadlinux-637e3b48c22e52daa645b49b73630af3f09328ae.tar.xz
btrfs: add helpers for manipulating leaf items and data
We have some gnarly memmove and copy_extent_buffer calls for leaf manipulation. This is because our item offsets aren't absolute, they're based on 0 being where the items start in the leaf, which is after the btrfs_header. This means any manipulation of the data requires adding sizeof(struct btrfs_header) to the offsets we pull from the items. Moving the items themselves is easier as the helpers are absolute offsets, however we of course have to call the helpers to get the offsets for the item numbers. This makes for copy_extent_buffer/memmove_extent_buffer calls that are kind of hard to reason about what's happening. Fix this by pushing this logic into helpers. For data we'll only use the item provided offsets, and the helpers will use the BTRFS_LEAF_DATA_OFFSET addition for the offsets. Additionally for the item manipulation simply pass in the item numbers, and then the helpers will call the offset helper to get the actual offset into the leaf. The diffstat makes this look like more code, but that's simply because I added comments for the helpers, it's net negative for the amount of code, and is easier to reason. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'scripts/ld-version.sh')
0 files changed, 0 insertions, 0 deletions