pub unsafe extern "C" fn btrfs_util_create_subvolume_iterator(
    path: *const c_char,
    top: u64,
    flags: c_int,
    ret: *mut *mut btrfs_util_subvolume_iterator
) -> btrfs_util_error
Expand description

btrfs_util_create_subvolume_iterator() - Create an iterator over subvolumes in a Btrfs filesystem. @path: Path in a Btrfs filesystem. This may be any path in the filesystem; it does not have to refer to a subvolume unless @top is zero. @top: List subvolumes beneath (but not including) the subvolume with this ID. If zero is given, the subvolume ID of @path is used. To list all subvolumes, pass %BTRFS_FS_TREE_OBJECTID (i.e., 5). The returned paths are relative to the subvolume with this ID. @flags: Bitmask of BTRFS_UTIL_SUBVOLUME_ITERATOR_* flags. @ret: Returned iterator.

Subvolume iterators require appropriate privilege (CAP_SYS_ADMIN) unless @top is zero and the kernel supports BTRFS_IOC_GET_SUBVOL_ROOTREF and BTRFS_IOC_INO_LOOKUP_USER (kernel >= 4.18). In this case, subvolumes which cannot be accessed (e.g., due to permissions or other mounts) will be skipped.

The returned iterator must be freed with btrfs_util_destroy_subvolume_iterator().

Return: %BTRFS_UTIL_OK on success, non-zero error code on failure.