btrfs / btrfs-todo

An issues only repo to organize our TODO items
21 stars 2 forks source link

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

Open josefbacik opened 2 years ago

josefbacik commented 2 years ago

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

Labnann commented 1 year ago

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?