-
Notifications
You must be signed in to change notification settings - Fork 250
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
libbtrfsutil: implement what snapper needs from libbtrfs #218
Comments
Hiding symbols via the .sym version script does not work so we'd have to drag all the unused symbols indefinitelly. There are only 4 symbol linked by libsnapper
Suggested solution, that's kind of brutal and breaking the practices of library and symbol versioning: limit the exports only to the known onse and don't change the version. Snapper would work after rebuild. Once the number of exports is reduced to minimum, headers can be trimmed down only to structure definitions and declarations of relevant functions. The remaining part of the export would be the ioctl definitions and ctree.h with the structures, plus the helpers around that. To avoid breaking the library, a separate set of files can be created and reduced independently of the standard headers. |
Dependencies verified on openSUSE ( |
Another step to decommission libbtrfs in favor of libbtrfsutil. Remove all symbols that are not used by snapper, as this is the only known widely distributed tool that uses some of the librarized functionality, apart from the ioctls. The symbol versioning does not allow to remove once exported symbol so this is a dirty trick that works only in this situation. The unused symbols are not exported anymore BUT the library has the same version. This would be normally an ABI violation, but there's no change for snapper (build and runtime verified on version 0.9.0). The known used symbols are preserved. * btrfs_subvolid_resolve * btrfs_read_and_process_send_stream * subvol_uuid_search_init * subvol_uuid_search Issue: #218 Signed-off-by: David Sterba <[email protected]>
Another step to decommission libbtrfs in favor of libbtrfsutil. Remove all symbols that are not used by snapper, as this is the only known widely distributed tool that uses some of the librarized functionality, apart from the ioctls. The symbol versioning does not allow to remove once exported symbol so this is a dirty trick that works only in this situation. The unused symbols are not exported anymore BUT the library has the same version. This would be normally an ABI violation, but there's no change for snapper (build and runtime verified on version 0.9.0). The known used symbols are preserved. * btrfs_subvolid_resolve * btrfs_read_and_process_send_stream * subvol_uuid_search_init * subvol_uuid_search Issue: kdave#218 Signed-off-by: David Sterba <[email protected]>
Initial support for libbtrfsutil about to land in snapper openSUSE/snapper#767 |
The PR got merged and the todo list updated. |
Get subvolume id also imlemented openSUSE/snapper#832 . |
Find subvolume by id openSUSE/snapper#771 . |
The library interface has been updated to 0.1.3 and can be now extended with new ioctl wrappers. |
The snapper tool was historically first user of the libbtrfs and at the moment is the only known. As libbtrfs needs to be deprecated in favor of libbtrfsutil, we need to implement the missing functinoality.
Check https://github.com/openSUSE/snapper files src/Btrfs*.cc for 'btrfs_*' and 'subvol_uuid_*'.
The used interfaces are stream dump and subvolume enumeration.
Data structures used:
Exported functions used:
subvol_search_by_pathExported but not used:
The text was updated successfully, but these errors were encountered: