summaryrefslogtreecommitdiff
path: root/src/kernel/vfs
diff options
context:
space:
mode:
authordzwdz2024-03-13 22:33:38 +0100
committerdzwdz2024-03-13 22:46:47 +0100
commit72f55421fb61b750512f324d284b30e3e67e36e0 (patch)
tree8933dc013580a2440730644807a03606c6805547 /src/kernel/vfs
parente47412d940db4e9be2d05608272e30f560a275d0 (diff)
kernel/malloc: slight rework (it's still bad), store more metadata
Diffstat (limited to 'src/kernel/vfs')
-rw-r--r--src/kernel/vfs/mount.c4
-rw-r--r--src/kernel/vfs/procfs.c4
-rw-r--r--src/kernel/vfs/request.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/kernel/vfs/mount.c b/src/kernel/vfs/mount.c
index c153c69..adf9b8c 100644
--- a/src/kernel/vfs/mount.c
+++ b/src/kernel/vfs/mount.c
@@ -10,8 +10,8 @@ VfsMount *vfs_mount_seed(void) {
}
void vfs_root_register(const char *path, void (*accept)(VfsReq *)) {
- VfsBackend *backend = kmalloc(sizeof *backend);
- VfsMount *mount = kmalloc(sizeof *mount);
+ VfsBackend *backend = kmalloc(sizeof *backend, "root bck");
+ VfsMount *mount = kmalloc(sizeof *mount, "root mnt");
*backend = (VfsBackend) {
.is_user = false,
.usehcnt = 1,
diff --git a/src/kernel/vfs/procfs.c b/src/kernel/vfs/procfs.c
index 4bacaf7..79dfdc0 100644
--- a/src/kernel/vfs/procfs.c
+++ b/src/kernel/vfs/procfs.c
@@ -73,7 +73,7 @@ openpath(const char *path, size_t len, Proc *root)
return NULL;
}
- h = kmalloc(sizeof *h);
+ h = kmalloc(sizeof *h, "proc fd");
h->gid = gid;
h->type = type;
return h;
@@ -182,7 +182,7 @@ isdigit(int c) {
VfsBackend *
procfs_backend(Proc *proc)
{
- VfsBackend *be = kzalloc(sizeof(VfsBackend));
+ VfsBackend *be = kzalloc(sizeof(VfsBackend), "kern fs");
*be = (VfsBackend) {
.is_user = false,
.provhcnt = 1,
diff --git a/src/kernel/vfs/request.c b/src/kernel/vfs/request.c
index 3a42c2a..21eecb8 100644
--- a/src/kernel/vfs/request.c
+++ b/src/kernel/vfs/request.c
@@ -13,11 +13,11 @@ void vfsreq_create(VfsReq req_) {
if (req_.caller) {
proc_setstate(req_.caller, PS_WAITS4FS);
if (!req_.caller->reqslot)
- req_.caller->reqslot = kmalloc(sizeof *req);
+ req_.caller->reqslot = kmalloc(sizeof *req, "reqslot");
req = req_.caller->reqslot;
/* (re)using a single allocation for all request a process makes */
} else {
- req = kmalloc(sizeof *req);
+ req = kmalloc(sizeof *req, "reqanon");
}
memcpy(req, &req_, sizeof *req);
if (req->backend) {