Andreas Kling
709d168807
FileSystem: Get rid of VFS::resolve_path().
...
The only remaining client was resolve_symbolic_link() which now deals in
custodies instead.
2019-05-30 22:30:29 +02:00
Andreas Kling
874bffc729
FileSystem: Get rid of VFS::absolute_path() and teach Mount about custodies.
2019-05-30 22:30:29 +02:00
Andreas Kling
8e83aac8a3
FileSystem: Get rid of VFS::resolve_path_to_inode() and old_resolve_path().
2019-05-30 22:30:29 +02:00
Andreas Kling
393851418b
FileSystem: Port most of the code over to using custodies.
...
The current working directory is now stored as a custody. Likewise for a
process executable file. This unbreaks /proc/PID/fd which has not been
working since we made the filesystem bigger.
This still needs a bunch of work, for instance when renaming or removing
a file somewhere, we have to update the relevant custody links.
2019-05-30 18:58:59 +02:00
Andreas Kling
4cb87b1753
FileSystem: Add a Custody class that represents a parent/child guardianship.
...
A custody is kind of a directory entry abstraction that represents a single
entry in a parent directory that tells us the name of a child inode.
The idea here is for path resolution to produce a chain of custody objects.
2019-05-30 17:46:08 +02:00
Andreas Kling
8b249bd09b
Kernel+Userland: Implement mknod() syscall and add a /bin/mknod program.
2019-05-03 22:59:58 +02:00
Andreas Kling
475a17fa4b
VFS: Also respect the sticky bit of the new parent in rename().
...
Obviously we should not allow overwriting someone else's files in a sticky
directory either.
2019-04-28 23:34:33 +02:00
Andreas Kling
e4eca17848
VFS: Implement sticky bit behavior for rename() and unlink().
...
Removing entries from a sticky directory is only allowed when you are either
the owner of the entry, or the superuser. :^)
2019-04-28 22:54:30 +02:00
Andreas Kling
d32d85e133
Kernel: Fix rename() sometimes failing to move within the same directory.
...
It was wrong to do a reverse name lookup on the old inode after adding
a new name for it, since we might very well get the new inode instead of
the old one, depending on hash table layouts.
2019-04-27 22:38:51 +02:00
Andreas Kling
ca9ed13643
Kernel: Simplify Device::open().
2019-04-24 02:20:14 +02:00
Andreas Kling
33920df299
AK: Try to use StringViews more for substrings and splitting.
2019-04-16 02:39:16 +02:00
Andreas Kling
13041f894f
Kernel: Start using StringView in the VFS class.
...
The less kmalloc() we can do, the better. Calling kmalloc() disables all
interrupts while it runs, so it's directly affecting responsiveness.
2019-04-15 14:57:27 +02:00
Andreas Kling
3f6408919f
AK: Improve smart pointer ergonomics a bit.
2019-04-14 02:36:06 +02:00
Andreas Kling
37ae00a4dd
Kernel+Userland: Add the rename() syscall along with a basic /bin/mv.
2019-04-07 23:35:26 +02:00
Andreas Kling
644c887594
Kernel: Move FIFO into FileSystem/ and Socket+LocalSocket into Net/.
2019-04-06 20:29:48 +02:00
Andreas Kling
ab43658c55
Kernel: Move devices into Kernel/Devices/.
2019-04-03 12:36:40 +02:00
Andreas Kling
f9864940eb
Kernel: Move FS-related files into Kernel/FileSystem/
2019-04-03 12:25:24 +02:00