From 793fce1007b772cf58100d1b4791598ef0c07194 Mon Sep 17 00:00:00 2001 From: Stepan Koltsov Date: Fri, 16 Jan 2026 06:34:42 +0000 Subject: [PATCH] Doclinks around backing descriptor --- src/passthrough.rs | 9 +++++---- src/reply.rs | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/passthrough.rs b/src/passthrough.rs index 7238ca62..8309087e 100644 --- a/src/passthrough.rs +++ b/src/passthrough.rs @@ -31,12 +31,13 @@ nix::ioctl_write_ptr!( /// 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()`. +/// You can create these via [`ReplyOpen::open_backing()`](crate::ReplyOpen::open_backing) +/// and send them via [`ReplyOpen::opened_passthrough()`](crate::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 +/// is to create them in the [`Filesystem::open()`](crate::Filesystem::open) impl, +/// store them in the struct of your Filesystem impl, then drop them in the +/// [`Filesystem::release()`](crate::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. /// diff --git a/src/reply.rs b/src/reply.rs index cf3c383a..4b38b891 100644 --- a/src/reply.rs +++ b/src/reply.rs @@ -278,7 +278,8 @@ impl Reply for ReplyOpen { impl ReplyOpen { /// Reply to a request with the given open result /// # Panics - /// When attempting to use kernel passthrough. Use `opened_passthrough()` instead. + /// When attempting to use kernel passthrough. + /// Use [`opened_passthrough()`](Self::opened_passthrough) instead. pub fn opened(self, fh: u64, flags: u32) { let flags = FopenFlags::from_bits_retain(flags); assert!(!flags.contains(FopenFlags::FOPEN_PASSTHROUGH)); @@ -287,7 +288,7 @@ impl ReplyOpen { } /// Registers a fd for passthrough, returning a `BackingId`. Once you have the backing ID, - /// you can pass it as the 3rd parameter of `OpenReply::opened_passthrough()`. This is done in + /// you can pass it as the 3rd parameter of [`ReplyOpen::opened_passthrough()`]. This is done in /// two separate steps because it may make sense to reuse backing IDs (to avoid having to /// repeatedly reopen the underlying file or potentially keep thousands of fds open). #[cfg(feature = "abi-7-40")] @@ -295,8 +296,8 @@ impl ReplyOpen { self.reply.sender.as_ref().unwrap().open_backing(fd.as_fd()) } - /// Reply to a request with an opened backing id. Call `ReplyOpen::open_backing()` to get one of - /// these. + /// Reply to a request with an opened backing id. Call [`ReplyOpen::open_backing()`] + /// to get one of these. #[cfg(feature = "abi-7-40")] pub fn opened_passthrough(self, fh: u64, flags: u32, backing_id: &BackingId) { let flags = FopenFlags::from_bits_retain(flags) | FopenFlags::FOPEN_PASSTHROUGH;