pub struct BackingId { /* private fields */ }Expand description
A reference to a previously opened fd intended to be used for passthrough
You can create these via ReplyOpen::open_backing()
and send them via ReplyOpen::opened_passthrough().
When working with backing IDs you need to ensure that they live “long enough”. A good practice
is to create them in the Filesystem::open() impl,
store them in the struct of your Filesystem impl, then drop them in the
Filesystem::release() impl. Dropping them immediately after
sending them in the Filesystem::open() impl can lead to the kernel returning EIO when userspace
attempts to access the file.
This is implemented as a safe wrapper around the backing_id field of the fuse_backing_map
struct used by the ioctls involved in fd passthrough. It is created by performing a
FUSE_DEV_IOC_BACKING_OPEN ioctl on an fd and has a Drop trait impl which makes a matching
FUSE_DEV_IOC_BACKING_CLOSE call. It holds a weak reference on the fuse channel to allow it to
make that call (if the channel hasn’t already been closed).