Andreas Kling
1e07ead119
Get rid of Ext2FS::is_directory_inode().
...
This was only used for assertions and will be factored out in favor of
Inode metadata checks eventually.
2018-12-24 23:38:15 +01:00
Andreas Kling
04ee693925
Get rid of FS::inode_metadata() since we use Inode::metadata() everywhere.
2018-12-21 17:32:18 +01:00
Andreas Kling
8a71303827
Get rid of FS::read_inode_bytes() and use Inode::read_bytes() everywhere.
2018-12-21 17:28:16 +01:00
Andreas Kling
1f44cd9dd9
Reworked Inode to have a dirty bit and subclass-implemented flush_metadata().
...
This way we can defer disk writes as long as we like. There's no automatic
flushing happening just yet.
2018-12-19 21:56:45 +01:00
Andreas Kling
d506c857ab
Rename CoreInode to Inode.
...
I don't know what I was thinking here. Clearly Inode is the right name.
2018-12-19 21:18:28 +01:00
Andreas Kling
038d8641f9
Implement utime() along with a naive /bin/touch.
...
This synchronous approach to inodes is silly, obviously. I need to rework
it so that the in-memory CoreInode object is the canonical inode, and then
we just need a sync() that flushes pending changes to disk.
2018-12-19 21:14:55 +01:00
Andreas Kling
d824442e3e
Get rid of deprecated_enumerateDirectoryInode.
...
This was a vestige from the pre-CoreInode implementation of Ext2FS.
2018-12-03 00:26:39 +01:00
Andreas Kling
407bb3e76e
Some coding style fixes. I'm getting more comfortable with this style.
2018-12-03 00:20:00 +01:00
Andreas Kling
85b886c2e0
Make it possible to build the Kernel on a macOS host.
...
It still requires an ELF compiler and linker, but at least it builds.
I need to get rid of the "Unix" namespace. This does a lot of that.
2018-12-02 23:34:50 +01:00
Andreas Kling
de4604ac95
Finally hook up the mkdir code to a syscall.
...
Added a /bin/mkdir that makes directories. How very neat :^)
There are various limitations because of missing functionality.
2018-11-18 15:02:16 +01:00
Andreas Kling
2529925fe9
Some more renaming:
...
FileSystem -> FS
SyntheticFileSystem -> SynthFS
ProcFileSystem -> ProcFS
Ext2FileSystem -> Ext2FS
Ext2Inode -> Ext2FSInode
2018-11-15 17:13:10 +01:00
Andreas Kling
eced5f11e3
Add CoreInode::reverse_lookup().
...
Getting the absolute path of an ext2fs inode now uses the lookup cache
which makes it a lot faster.
2018-11-15 17:04:55 +01:00
Andreas Kling
5f434bc00b
Add CoreInode::lookup() for directory lookups.
...
Also add a name-to-inode lookup cache to Ext2Inode. This seems like a great
speedup for filesystem traversal.
2018-11-15 16:38:43 +01:00
Andreas Kling
8fa2d7104a
More VFS cleanup.
2018-11-15 16:04:25 +01:00
Andreas Kling
396a32835b
A pass of style/naming cleanup in VFS.
2018-11-15 15:10:30 +01:00
Andreas Kling
c735c56e4c
More work on CoreInode.
2018-11-13 23:44:54 +01:00
Andreas Kling
26852a8363
Add metadata to CoreInode.
2018-11-13 13:32:16 +01:00
Andreas Kling
10c470e95f
Make page_in_from_vnode 2x faster.
...
...by adding a new class called Ext2Inode that inherits CoreInode.
The idea is that a vnode will wrap a CoreInode rather than InodeIdentifier.
Each CoreInode subclass can keep whatever caches they like.
Right now, Ext2Inode caches the list of block indices since it can be very
expensive to retrieve.
2018-11-13 13:02:39 +01:00
Andreas Kling
83172e6a4b
Rename FileHandle to FileDescriptor.
2018-11-07 11:37:54 +01:00
Andreas Kling
8e640539ef
Add an inode metadata cache to the ext2fs implementation.
2018-10-29 23:45:34 +01:00
Andreas Kling
1d4af51250
Add a VFS::absolutePath(InodeIdentifier).
...
This is pretty inefficient for ext2fs. We walk the entire block group
containing the inode, searching through every directory for an entry
referencing this inode.
It might be a good idea to cache this information somehow. I'm not sure
how often we'll be searching for it.
Obviously there are multiple caching layers missing in the file system.
2018-10-28 12:20:25 +01:00
Andreas Kling
2716a9e2d7
Greatly improve /proc/PID/stack by tracing the ebp frame chain.
...
I also added a generator cache to FileHandle. This way, multiple
reads to a generated file (i.e in a synthfs) can transparently
handle multiple calls to read() without the contents changing
between calls.
The cache is discarded at EOF (or when the FileHandle is destroyed.)
2018-10-27 00:14:24 +02:00
Andreas Kling
9171521752
Integrate ext2 from VFS into Kernel.
2018-10-17 10:57:23 +02:00
Andreas Kling
9cd0a34b5c
BlockDevice -> DiskDevice.
...
BlockDevice was the wrong name for this abstraction, since a block device
is a type of file in a unix system, and we should use that name for that
concept in the fs implementation.
2018-10-16 11:21:49 +02:00
Andreas Kling
f608629704
Implement creating a new directory.
2018-10-16 00:35:03 +02:00
Andreas Kling
47fc6344ac
Support the ext2 directory entry file_type field.
2018-10-15 01:57:57 +02:00
Andreas Kling
9528edab92
Move readEntireInode() up to FileSystem (from ext2.)
...
It's just a wrapper around multiple calls to readInodeBytes() now.
2018-10-15 00:16:14 +02:00
Andreas Kling
1f41a36c52
Add a Unix namespace for foo_t types.
...
This allows me to keep prototyping things on a random desktop machine,
even if that machine has its own ideas about foo_t types.
2018-10-14 22:57:57 +02:00
Andreas Kling
c94044a04a
Work on POSIX-like read() and lseek() support.
2018-10-14 21:19:27 +02:00
Andreas Kling
5a30055157
Import all this stuff into a single repo called Serenity.
2018-10-10 11:53:07 +02:00