Commit graph

17 commits

Author SHA1 Message Date
Andreas Kling
6b581aff77 Kernel: Make a copy of the dirty inode list before iterating in sync(). 2019-02-28 21:51:59 +01:00
Andreas Kling
60d0a48be5 Kernel: Use KResult in link(). 2019-02-27 15:31:26 +01:00
Andreas Kling
5b27f11b97 Kernel: Use KResult in unlink() and rmdir(). 2019-02-27 14:11:25 +01:00
Andreas Kling
1d2529b4a1 Add chown() syscall and a simple /bin/chown program. 2019-02-27 12:32:53 +01:00
Andreas Kling
9624b54703 More moving towards using signed types.
I'm still feeling this out, but I am starting to like the general idea.
2019-02-25 22:06:55 +01:00
Andreas Kling
5af4e622b9 Kernel: Add KResult and KResultOr<T> classes.
The idea here is to combine a potential syscall error code with an arbitrary
type in the case of success. I feel like this will end up much less error
prone than returning some arbitrary type that kinda sorta has bool semantics
(but sometimes not really) and passing the error through an out-param.

This patch only converts a few syscalls to using it. More to come.
2019-02-25 20:50:22 +01:00
Andreas Kling
2cfcbdc735 AK: Add Retained<T>, like RetainPtr, but never null.
Also use some Clang attribute wizardry to get a warning for use-after-move.
2019-02-25 12:43:52 +01:00
Andreas Kling
5582a0a254 Kernel: When a lock is busy, donate remaining process ticks to lock holder.
Since we know who's holding the lock, and we're gonna have to yield anyway,
we can just ask the scheduler to donate any remaining ticks to that process.
2019-02-07 11:14:58 +01:00
Andreas Kling
4df92709c8 Kernel: Add proper locking to SynthFS and stop disabling interrupts. 2019-02-07 10:47:11 +01:00
Andreas Kling
b5e5541cbc Kernel: Remove an unnecessary InterruptDisabler in SynthFS. 2019-02-07 10:42:00 +01:00
Andreas Kling
ffab6897aa Big, possibly complete sweep of naming changes. 2019-01-31 17:31:23 +01:00
Andreas Kling
6b88025dda Remove the last remaining #ifndef SERENITY blocks. 2019-01-31 02:56:54 +01:00
Andreas Kling
c30e2c8d44 Implement basic chmod() syscall and /bin/chmod helper.
Only raw octal modes are supported right now.
This patch also changes mode_t from 32-bit to 16-bit to match the on-disk
type used by Ext2FS.

I also ran into EPERM being errno=0 which was confusing, so I inserted an
ESUCCESS in its place.
2019-01-29 04:55:08 +01:00
Andreas Kling
c95228b128 Add support for removing directories.
It's really only supported in Ext2FS since SynthFS doesn't really want you
mucking around with its files. This is pretty neat though :^)

I ran into some trouble with HashMap while working on this but opted to work
around it and leave that for a separate investigation.
2019-01-28 04:16:01 +01:00
Andreas Kling
8bb18fdc56 Kernel: Get rid of Unix namespace.
This is no longer needed as the Kernel can stand on its own legs now
and there won't be any conflict with host system data types.
2019-01-23 06:57:00 +01:00
Andreas Kling
730c14e647 VFS: Rename FS::id() to fsid() for consistency. 2019-01-23 05:39:11 +01:00
Andreas Kling
754037874c Move VFS sources into Kernel/. 2019-01-23 05:14:00 +01:00
Renamed from VirtualFileSystem/SyntheticFileSystem.cpp (Browse further)