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

Consider using libbtrfsutil in the btrfs plugin #552

Open
vojtechtrefny opened this issue Jul 23, 2020 · 3 comments
Open

Consider using libbtrfsutil in the btrfs plugin #552

vojtechtrefny opened this issue Jul 23, 2020 · 3 comments

Comments

@vojtechtrefny
Copy link
Member

libbtrfsutil was added in 2018 (btrfs-progs 4.16), we should consider using it in the btrfs plugin instead of calling btrfs tools and parsing their output. It looks like it supports everything we need (but we should take a closer look first to be 100 % sure).

@jelly
Copy link
Contributor

jelly commented Dec 4, 2023

One downside I noticed here is that libbtrsutil is not actually used by the btrfs binary, but it is used by snapper it probably doesn't break a lot but worth to check if it has unit tests.

If libblockdev wants to extend btrfs information, then libbrtfsutil needs to be extended.

@tbzatek
Copy link
Member

tbzatek commented Dec 5, 2023

libbtrsutil is not actually used by the btrfs binary

Isn't it linked statically? Sometimes distros tend to link everything statically for initramfs use.

If libblockdev wants to extend btrfs information, then libbrtfsutil needs to be extended.

Theoretically we may opt for a mixed use - library calls for most of the stuff and external tools as a fallback for missing functionality. Assuming both the library and the tools are part of a single package.

@jelly
Copy link
Contributor

jelly commented Dec 6, 2023

I think I might have looked at it wrong, this struct is indeed re-used in the cli interface https://github.com/search?q=repo%3Akdave%2Fbtrfs-progs+btrfs_util_subvolume&type=code

And FYI there is a list of things which are required for snapper and implemented in libbtrfsutil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants