From ec3d2400db15e6911138d88f95cae141a9da2130 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 11 May 2024 20:55:10 +0200 Subject: kernel: remove HANDLE_NULLFS It was a dumb hack that wasn't even necessary - an error when mounting should shadow over the mountpoint anyways. --- src/kernel/handleset.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/kernel/handleset.c') diff --git a/src/kernel/handleset.c b/src/kernel/handleset.c index b52eaa0..a25f5c7 100644 --- a/src/kernel/handleset.c +++ b/src/kernel/handleset.c @@ -55,15 +55,7 @@ hs_findfree(HandleSet *hs, hid_t start) Handle * hs_get(HandleSet *hs, hid_t id) { - if (id == HANDLE_NULLFS) { - // TODO get rid of this stupid hack - static Handle h = (Handle){ - .type = HANDLE_FS_FRONT, - .backend = NULL, - .refcount = 2, /* never free */ - }; - return &h; - } else if (0 <= id && id < HANDLE_MAX) { + if (0 <= id && id < HANDLE_MAX) { return hs->h[id]; } else { return NULL; @@ -107,7 +99,7 @@ Handle * hs_take(HandleSet *hs, hid_t hid) { if (hid < 0 || hid >= HANDLE_MAX) { - return hs_get(hs, hid); // TODO can't this cause HANDLE_NULLFS to be freed? + return NULL; } Handle *h = hs->h[hid]; hs->h[hid] = NULL; -- cgit v1.2.3