diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-01-06 21:45:43 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-01-06 21:45:43 -0600 |
| commit | 0f45ef90df6d036aec2077b702fdf465f61c16d6 (patch) | |
| tree | 0abaef4cf55aa8aecc3ae985858bf870f6836e01 /src/ops/traits.rs | |
| parent | f0e7c0997553ab356d5aa683d5322ab2de575188 (diff) | |
Implement Bmap
Diffstat (limited to 'src/ops/traits.rs')
| -rw-r--r-- | src/ops/traits.rs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/ops/traits.rs b/src/ops/traits.rs index 3a81e85..e8b8008 100644 --- a/src/ops/traits.rs +++ b/src/ops/traits.rs @@ -7,7 +7,7 @@ pub use super::{ dir::{ReplyEntries, ReplyFound}, entry::{RequestLink, RequestTarget}, global::ReplyFsInfo, - inode::{ReplyStat, RequestForget}, + inode::{ReplyBlock, ReplyStat, RequestBlock, RequestForget}, open::{ReplyOpen, ReplyPermissionDenied}, rw::ReplyAll, xattr::ReplyXattrRead, @@ -168,6 +168,20 @@ impl<'o, O: Operation<'o>> Request<'o, O> { { O::source_ino(self) } + + pub fn block(&self) -> u64 + where + O: RequestBlock<'o>, + { + O::block(self) + } + + pub fn block_size(&self) -> u32 + where + O: RequestBlock<'o>, + { + O::block_size(self) + } } impl<'o, O: Operation<'o>> Reply<'o, O> { @@ -304,4 +318,11 @@ impl<'o, O: Operation<'o>> Reply<'o, O> { { O::buffer_too_small(self) } + + pub fn block(self, block: u64) -> Done<'o> + where + O: ReplyBlock<'o>, + { + O::block(self, block) + } } |
