Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/reply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,14 @@ impl ReplyEntry {
));
}

/// Registers a fd for passthrough, returning a `BackingId`. Once you have the backing ID, you can pass it as an argument in [`ReplyOpen::opened_passthrough`] or [`ReplyCreate::created_passthrough`].
///
/// This method is ideal for registering a backing ID for an inode at first lookup. This method should only be called once per inode lifecycle.
pub fn open_backing(&self, fd: impl std::os::fd::AsFd) -> std::io::Result<BackingId> {
// TODO: assert passthrough capability is enabled.
self.reply.sender.as_ref().unwrap().open_backing(fd.as_fd())
}

/// Reply to a request with the given error code
pub fn error(self, err: Errno) {
self.reply.error(err);
Expand Down Expand Up @@ -781,6 +789,14 @@ impl ReplyDirectoryPlus {
))
}

/// Registers a fd for passthrough, returning a `BackingId`. Once you have the backing ID, you can pass it as an argument in [`ReplyOpen::opened_passthrough`] or [`ReplyCreate::created_passthrough`].
///
/// This method is ideal for registering a backing ID for an inode at first lookup. This method should only be called once per inode lifecycle.
pub fn open_backing(&self, fd: impl std::os::fd::AsFd) -> std::io::Result<BackingId> {
// TODO: assert passthrough capability is enabled.
self.reply.sender.as_ref().unwrap().open_backing(fd.as_fd())
}

/// Reply to a request with the filled directory buffer
pub fn ok(self) {
let response: ll::ResponseData = self.buf.into();
Expand Down
Loading