pub fn snapshot_create(
parent_fd: BorrowedFd<'_>,
source_fd: BorrowedFd<'_>,
name: &CStr,
readonly: bool,
qgroups: &[u64],
) -> Result<()>Expand description
Create a snapshot of the subvolume referred to by source_fd, placing it
as name inside the directory referred to by parent_fd.
If readonly is true the new snapshot is created read-only. If
qgroups is non-empty, the new snapshot is added to those qgroups.
Requires CAP_SYS_ADMIN.
Errors: ENAMETOOLONG if name does not fit in the 4040-byte kernel
buffer. EEXIST if a subvolume or directory with that name already exists.
EROFS if parent_fd refers to a read-only subvolume. EPERM without
CAP_SYS_ADMIN.
ยงErrors
Returns Err if the ioctl fails.