summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorChuyan Zhang <me@zcy.moe>2023-11-25 02:13:22 -0800
committerChuyan Zhang <me@zcy.moe>2023-11-25 02:13:22 -0800
commit76ac602c3d79bb39c133c81a38425a77bc0b8b1f (patch)
treea1de9a03d16bd38fc6ab6b9568d2df562a913d96 /src/main.rs
parentb8afa7cfb02b32278e268924e189170496f81c1b (diff)
downloadmyfs-76ac602c3d79bb39c133c81a38425a77bc0b8b1f.tar.gz
myfs-76ac602c3d79bb39c133c81a38425a77bc0b8b1f.zip
Some FUSE callbacks, some POSIX interface implementation
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/main.rs b/src/main.rs
index 2df0a10..e0bfa2e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -30,7 +30,7 @@ struct Args {
allow_root: bool,
}
-const TTL: Duration = Duration::from_secs(1);
+const TTL: Duration = Duration::new(0, 0);
const INODE_PER_BLOCK: usize = BLOCK_SIZE / INODE_SIZE;
/// The design of MyFS is rather simple:
@@ -111,17 +111,11 @@ impl AyaFS {
+ inode_bitmap_block_number
+ inode_block_number
+ 1,
- cached_inodes: BlockCache::new(device.clone(), 256),
- cached_blocks: BlockCache::new(device.clone(), 256),
+ cached_inodes: BlockCache::new(device.clone(), 1024),
+ cached_blocks: BlockCache::new(device.clone(), 8192),
};
- fs.create_inode(
- 0o755,
- InodeMode::IFDIR,
- get_current_uid(),
- get_current_gid(),
- 0,
- );
+ fs.create_directory(0o755, get_current_uid(), get_current_gid(), 0);
fs
}