From bf07291c069028d84b242222d1f89de5e673e636 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Mon, 3 Jan 2022 06:35:19 -0600 Subject: Split Attrs::block_size() from Attrs::blocks() --- examples/ext2.rs | 3 ++- src/fuse/io.rs | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/ext2.rs b/examples/ext2.rs index 4c62a3f..b51c9e5 100644 --- a/examples/ext2.rs +++ b/examples/ext2.rs @@ -472,7 +472,8 @@ impl Known for Resolved { Gid::from_raw(inode.i_gid.into()), ) .mode(Mode::from_bits_truncate(inode.i_mode.into())) - .blocks(inode.i_blocks.into(), 512) + .blocks(inode.i_blocks.into()) + .block_size(512) .times(access, modify, create) .links(inode.i_links_count.into()); diff --git a/src/fuse/io.rs b/src/fuse/io.rs index 727a83f..f3dc5b1 100644 --- a/src/fuse/io.rs +++ b/src/fuse/io.rs @@ -230,9 +230,16 @@ impl Attrs { } #[must_use] - pub fn blocks(self, blocks: u64, block_size: u32) -> Self { + pub fn blocks(self, blocks: u64) -> Self { Attrs(proto::Attrs { blocks, + ..self.0 + }) + } + + #[must_use] + pub fn block_size(self, block_size: u32) -> Self { + Attrs(proto::Attrs { blksize: block_size, ..self.0 }) -- cgit v1.2.3