-
Notifications
You must be signed in to change notification settings - Fork 0
[TASK] Phase 4.2.2: In-Memory Filesystem (tmpfs) #131
Copy link
Copy link
Open
Labels
component-filesystemVirtual filesystem and storageVirtual filesystem and storagemilestone-4.2Milestone 4.2: Virtual FilesystemMilestone 4.2: Virtual Filesystemphase-4Phase 4: Modern WorkloadsPhase 4: Modern Workloadspriority-highHigh priority - important workHigh priority - important worktype-enhancementFeature enhancementFeature enhancement
Milestone
Description
Metadata
Metadata
Assignees
Labels
component-filesystemVirtual filesystem and storageVirtual filesystem and storagemilestone-4.2Milestone 4.2: Virtual FilesystemMilestone 4.2: Virtual Filesystemphase-4Phase 4: Modern WorkloadsPhase 4: Modern Workloadspriority-highHigh priority - important workHigh priority - important worktype-enhancementFeature enhancementFeature enhancement
Projects
- StatusShow more project fieldsTodo
Overview
Implement
tmpfs: a simple, heap-backed in-memory filesystem that mounts at/. This is the first concreteFilesystemimplementation and validates the VFS layer. All data is lost on reboot — that is expected and correct.Design
Storage Model
Inode impl
lookup(name)-> BTreeMap lookup in Diropen(flags)-> returnsTmpfsFilewrapping a clone of theArc<TmpfsInode>create(name, kind)-> insert newTmpfsInodeinto parent Dirunlink(name)-> remove from parent Dir; drop Arc (freed when last reference gone)readdir()-> iterate BTreeMap keysTmpfsFile read/write
read(buf, offset)-> copycontent[offset..offset+buf.len()]write(buf, offset)-> extend or overwritecontent; update sizeAcceptance Criteria
tmpfsmounts at/during kernel initcreate/lookup/unlinkwork for files and directoriesread/writework for files (arbitrary offset, arbitrary size)readdirreturns correct entriesopencalls within the same boot/hello.txt, write "Hello", open again, read "Hello"/dir/, create/dir/file.txt,readdir("/dir/")returns["file.txt"]"tmpfs: mounted at /","tmpfs: created /hello.txt","tmpfs: read 5 bytes from /hello.txt"Files
kernel/src/fs/tmpfs/mod.rskernel/src/fs/tmpfs/inode.rskernel/src/fs/tmpfs/file.rsDependencies
Filesystem+Inode+Filetraits