diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-01-03 06:35:19 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-01-03 06:35:19 -0600 |
| commit | bf07291c069028d84b242222d1f89de5e673e636 (patch) | |
| tree | 153c2fd7f540dc2510c4ca2856846b850ec62b89 | |
| parent | dbf62fa4be2025ee041f705f899df6c859e287d2 (diff) | |
Split Attrs::block_size() from Attrs::blocks()
| -rw-r--r-- | examples/ext2.rs | 3 | ||||
| -rw-r--r-- | 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 }) |
