C API¶
-
int
Bcachefs_open(Bcachefs *this, const char *path)¶ Open a Bcachefs disk image for reading.
- Return
- 1 on success and 0 on failure
- Parameters
this: the bcachefs struct to use for the initializationpath: the path to the image
-
int
Bcachefs_close(Bcachefs *this)¶ close the Bcachefs disk image
- Return
- 1 on success and 0 on failure
- Parameters
this: the disk image to close
-
int
Bcachefs_iter(const Bcachefs *this, Bcachefs_iterator *iter, enum btree_id type)¶ prepare a bcachefs iterator to go through a bcachefs btree
- Return
- 1 on success and 0 on failure
- Parameters
this: the disk image we want to iterate throughiter: the iterator struct to initializetype: the btree type we want to iterate over
-
const struct bch_val *
Bcachefs_iter_next(const Bcachefs *this, Bcachefs_iterator *iter)¶ fetch next value from the iterator
- Return
- the next value or
NULLif we reached the end - Parameters
this: the disk image we are iterating throughiter: the iterator struct
-
int
Bcachefs_iter_fini(const Bcachefs *this, Bcachefs_iterator *iter)¶ free all the resources allocated by the iterator
- Return
- 1 on success and 0 on failure
- Parameters
this: the disk image we are iterating throughiter: the iterator struct
-
Bcachefs_extent
Bcachefs_iter_make_extent(const Bcachefs *this, Bcachefs_iterator *iter)¶ extract extent information from a bch_val
- Return
- the extracted value
- Parameters
this: the disk image we are reading fromiter: the iterator pointing to the value we want to extract
-
Bcachefs_inode
Bcachefs_iter_make_inode(const Bcachefs *this, Bcachefs_iterator *iter)¶ extract inode information from a bch_val
- Return
- the extracted value
- Parameters
this: the disk image we are reading fromiter: the iterator pointing to the value we want to extract
-
Bcachefs_dirent
Bcachefs_iter_make_dirent(const Bcachefs *this, Bcachefs_iterator *iter)¶ extract dirent information from a bch_val
- Return
- the extracted value
- Parameters
this: the disk image we are reading fromiter: the iterator pointing to the value we want to extract