Add Bcachefs support

This commit is contained in:
Andrea Mazzoleni 2026-05-03 21:39:35 +02:00
parent 4ed6f21823
commit aa55b96aa8
15 changed files with 387 additions and 129 deletions

View file

@ -366,32 +366,36 @@ int fsinfo(const char* path, int* has_persistent_inode, int* has_syncronized_har
/**
* Get the subvolume directory if the underline filesystem support it
* @param path Full path of the mount point to check. It must end with /
* @param root The full path of the subvolume root that contains the specified path. It will end with /.
* @param root Set the full path of the subvolume root that contains the specified path. It will end with /.
* @param magic Set the magic number of the filesystem
*/
int fssnapshot(const char* path, char* root, size_t root_size);
int fssnapshot(const char* path, char* root, size_t root_size, uint32_t* magic);
/**
* Creates a snapshot of a subvolume.
* Creates a snapshot of a subvolume
* @param magic The magic number of the filesystem.
* @param source Path to the source subvolume.
* @param parent_dir Directory where the snapshot should be created.
* @param name Name of snapshot.
* @return 0 on success, -1 on failure.
*/
int fssnapshot_create(const char* source, const char* parent_dir, const char* name);
int fssnapshot_create(uint32_t magic, const char* source, const char* parent_dir, const char* name);
/**
* Deletes a subvolume/snapshot.
* @param magic The magic number of the filesystem.
* @param parent_dir Directory where the snapshot is.
* @param name Name of snapshot.
* @return 0 on success, -1 on failure.
*/
int fssnapshot_delete(const char* parent_dir, const char* name);
int fssnapshot_delete(uint32_t magic, const char* parent_dir, const char* name);
/**
* Renames a subvolume.
* @param magic The magic number of the filesystem.
* @return 0 on success, -1 on failure.
*/
int fssnapshot_rename(const char* parent_dir, const char* old_name, const char* new_name);
int fssnapshot_rename(uint32_t magic, const char* parent_dir, const char* old_name, const char* new_name);
/*
* Log file.