Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate out item/leaf node modification helpers and unit test them #28

Open
2 tasks
josefbacik opened this issue Feb 27, 2022 · 1 comment
Open
2 tasks
Labels
btrfs-progs For btrfs-progs good first issue Good for newcomers kernel Kernel related issue

Comments

@josefbacik
Copy link
Contributor

We need to have better test coverage of things like

btrfs_del_items
btrfs_split_item (this is currently tested by self tests)
setup_leaf_for_split
btrfs_duplicate_item
btrfs_truncate_item
btrfs_extent_item
btrfs_setup_item_for_insert
btrfs_insert_empty_items
(I'm sure there are more that I'm missing)

Ideally I'd like these helpers all put into their own source file to better identify what functions we need to be used by the rest of the code. Then these all need to have full unit tests to get coverage of all of them. Currently it's a giant pain to do the split_leaf/balance related functions because it requires allocating/freeing extent buffers. Stubbing that out in selftests is kind of a pain, so this would be a good target for a file we keep sync'ed between btrfs-progs and the kernel. The steps would probably be

  • separate the helpers into their own file that can easily be copied between -progs and the kernel.
  • write unit tests in -progs to test all of the functions and their variations.
@josefbacik josefbacik added good first issue Good for newcomers btrfs-progs For btrfs-progs kernel Kernel related issue labels Feb 27, 2022
@Labnann
Copy link

Labnann commented Oct 1, 2022

All of the functions mentioned above are in ctree.c. Does it mean the first task, "Separate the helpers into their own file that can easily be copied between -progs and the kernel" is complete?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
btrfs-progs For btrfs-progs good first issue Good for newcomers kernel Kernel related issue
Projects
None yet
Development

No branches or pull requests

2 participants