From 01970c282823173e9db54d8a3a9c64116fe37c4c Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 14 Dec 2017 12:20:00 +0000 Subject: [PATCH] filesys: use the getmode helper in i_deref instead Cleans up a bit, uses 8bit compares and saves us another 26 bytes --- Kernel/filesys.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Kernel/filesys.c b/Kernel/filesys.c index 56d5ee1d..b2378e20 100644 --- a/Kernel/filesys.c +++ b/Kernel/filesys.c @@ -787,14 +787,14 @@ int8_t uf_alloc(void) void i_deref(inoptr ino) { - uint16_t mode = ino->c_node.i_mode & F_MASK; + uint8_t mode = getmode(ino); magic(ino); if(!ino->c_refs) panic(PANIC_INODE_FREED); - if (mode == F_PIPE) + if (mode == MODE_R(F_PIPE)) wakeup((char *)ino); /* If the inode has no links and no refs, it must have @@ -804,7 +804,7 @@ void i_deref(inoptr ino) /* SN (mcy) */ - if (mode == F_REG || mode == F_DIR || mode == F_PIPE) + if (mode == MODE_R(F_REG) || mode == MODE_R(F_DIR) || mode == MODE_R(F_PIPE)) f_trunc(ino); /* If the inode was modified, we must write it to disk. */ -- 2.34.1