summaryrefslogtreecommitdiff
path: root/src/kernel/vfs/request.c
AgeCommit message (Collapse)Author
2024-08-18kernel: basic _sys_setxattr implementationHEADmaindzwdz
2024-08-18kernel/req: support combined kernel and user inputsdzwdz
prep work for setxattr
2024-08-17kernel: immediately fail open() request instead of truncating the pathdzwdz
less error prone
2024-08-17*: getxattrdzwdz
2024-08-17kernel: split the kernel/user inputs in VfsReqdzwdz
I think I've done this refactor in the opposite direction a few years ago. This is mostly meant to prepare me for setxattr, which requires two inputs - coincidentally, one is already going to be a kernel input, and the other will be an user input, so it works out. I also just didn't like the previous way it worked, this feels cleaner.
2024-07-27kernel: don't use pointer types for registers, add proc_savereturndzwdz
2024-07-20*: moving filesdzwdz
2024-07-17kernel: make kmalloc accept a numeric "tag" instead of a freeform descriptiondzwdz
This will both let me save space in the allocation header, and make the debugprint more readable.
2024-07-15kernel: new queue abstractiondzwdz
The postqueue functions remain as-is, as that's a more "specialized" interface. They're mostly wrappers around queue.h, though.
2024-07-14kernel: O(1) ReqQueue insertionsdzwdz
2024-07-14kernel: make the adhoc VfsQueue queues use ReqQueue insteaddzwdz
I'm still not sure if I should use sys/queue.h for this. But yeah, this is more consistent, and it will also let me switch over to O(1) insertions later on.
2024-07-14kernel: rework postqueuedzwdz
Keeping its old name for now to make things easier for myself. This might just be replaced by sys/queue.h soon.
2024-07-12kernel: don't reuse VfsReq allocations for a single processdzwdz
To use the same testing methodology as when I've introduced request slots: before: / $ iostress 1 1000000 0 > /dev/vtty run 0: 2585203 1000000 calls, 0 bytes. avg 2585203 after: / $ iostress 1 1000000 0 > /dev/vtty run 0: 2783171 1000000 calls, 0 bytes. avg 2783171 This is around a 7.7% slowdown - that I hope to fix with a better malloc. While this doesn't really make the code that much simpler, it doesn't feel like the right approach in the first place
2024-07-11kernel: start cleaning up VfsRequestdzwdz
* I'm being more strict about the linked list state to hopefully ensure I'm not leaking any references. * vfsreq_create was renamed to vfsreq_dispatchcopy as that name feels more clear. It copies its argument, and dispatches it. * Requests for user backends are now handled more like requests for kernel backends - there's an accept() function that accepts a request.
2024-07-07kernel/vfs: split vfs_backend_refdown into two functionsdzwdz
2024-05-11kernel: fix null dereference when delegating an nonexistent handledzwdz
2024-05-11kernel: refactor handle management out of proc.cdzwdz
2024-03-13kernel/malloc: slight rework (it's still bad), store more metadatadzwdz
2024-02-23kernel: knock off some simple vfsreq TODOsdzwdz
2023-06-17kernel: fix procfs overflow bug, add safeguard to prevent similar onesdzwdz
2023-01-25kernel: move /mem/alloc to /malloc and linker.ld to arch/amd64/dzwdz
2023-01-25kernel: consolidate some header filesdzwdz
2023-01-25style: typedef structs, shorter namespacesdzwdz
I've wanted to do this for a while, and since I've just had a relatively large refactor commit (pcpy), this is as good of a time as any. Typedefing structs was mostly inspired by Plan 9's coding style. It makes some lines of code much shorter at basically no expense. Everything related to userland kept old-style struct definitions, so as not to force that style onto other people. I also considered changing SCREAMING_ENUM_FIELDS to NicerLookingCamelcase, but I didn't, just in case that'd be confusing.
2023-01-25kernel/virt: replace the virt_cpy api with a more foolproof onedzwdz
2023-01-11kernel: return EPIPE when fs_waiting on a dead filesystemdzwdz
2023-01-06kernel: basic procfsdzwdz
2022-10-08syscall/open: don't check for free handlesdzwdz
doesn't really prevent anything, and makes it harder to test edge cases
2022-10-02syscall/open: add the full suite of READ/WRITE flagsdzwdz
2022-09-20shared: rename ufs_request to better fit its role in userlanddzwdz
The old name could have suggested that it held a response to a request received by fs_wait. The new name is unfortunately very similar to the `struct vfs_request` already used internally in the kernel, but it's better at conveying that it contains a filesystem request yet to be handled. vfs_request - virtual filesystem request (a bad name in hindsight) ufs_request - user filesystem request
2022-09-20user/login: segcmpdzwdz
2022-08-28kernel/vfs: minor vfs_request / vfs_root_register reworkdzwdz
* changed vfs_root_register's name because the _mount didn't add anything * removed the old pointless vfs_backend_tryaccept calls from drivers * because of that, i could remove the vfs_backend globals * replaced the horrible BACKEND_KERN macro * all vfs_backends are now stored on the heap
2022-08-19syscall/fs_wait: return a handle for each requestdzwdz
2022-08-19kernel/proc: abstract away managing handlesdzwdz
2022-08-12vfs: OPEN_RO flag, read-only whitelist entriesdzwdz
2022-08-08kernel/backend: remove the kern.ready() methoddzwdz
2022-08-04do some simple TODOs, organize the rest; general code maintainancedzwdz
2022-08-03kernel: reuse a single allocation for all vfs_requests of a processdzwdz
$ iostress 32 512 0 > /vtty # before 512 calls, 0 bytes. avg 121133 $ iostress 32 512 0 > /vtty # after 512 calls, 0 bytes. avg 103540 103540/121133 = ~85% I think the tiny bit of added complexity is worth it here.
2022-07-29use a shared fs_normslice() function to handle offsetsdzwdz
2022-07-27kernel/vfs: fix assert failure when creating a vfsreq to a dead mountdzwdz
2022-07-26shared: move some headers from shared/ to camellia/dzwdz
2022-07-23init: compile as an elfdzwdz
2022-07-17kernel/virt_cpy: error struct, better error handlingdzwdz
2022-07-16amd64: back at the shell!dzwdz
2022-07-16amd64: barely boot into kernel codedzwdz
2022-07-08syscall/fs_respond: get the file id from the buf argumentdzwdz
Previously, file ids could only be positive integers, so their range was 31 bits - not enough to represent the entire memory. Now, pointers can be safely used as file ids.
2022-07-07kernel: add the vfsreq_finish_short shorthand functiondzwdz
2022-07-07kernel/vfs: delegate support in _syscall_fs_respond!dzwdz
this is big in terms of speed, it avoids a lot of unnecessary context switches
2022-06-29kernel/vfs: add the OPEN_CREATE flagdzwdz
2022-05-06kernel: remove the union in `struct handle`dzwdz
2022-05-06kernel/proc: reorganize the functionsdzwdz