From 6f7e72c0b72a3c4998bc2c46e65cb89c65582812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 6 May 2004 12:31:18 +0000 Subject: [PATCH] Moved the logic from bfs_close() to bfs_free_cookie() - apparently, doing anything in bfs_close() does not really makes sense. Thanks to Ingo for pointing this out. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7429 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../file_systems/bfs/kernel_interface.cpp | 33 ++++++++----------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp b/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp index 78a79ff036..4e2b5d19a3 100644 --- a/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp +++ b/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp @@ -1346,6 +1346,18 @@ static int bfs_close(void *_ns, void *_node, void *_cookie) { FUNCTION(); + if (_ns == NULL || _node == NULL || _cookie == NULL) + return B_BAD_VALUE; + + return B_OK; +} + + +static int +bfs_free_cookie(void *_ns, void *_node, void *_cookie) +{ + FUNCTION(); + if (_ns == NULL || _node == NULL || _cookie == NULL) return B_BAD_VALUE; @@ -1391,26 +1403,6 @@ bfs_close(void *_ns, void *_node, void *_cookie) notify_listener(B_STAT_CHANGED, volume->ID(), 0, 0, inode->ID(), NULL); } - return B_OK; -} - - -static int -bfs_free_cookie(void *_ns, void *_node, void *_cookie) -{ - FUNCTION(); - - if (_ns == NULL || _node == NULL || _cookie == NULL) - return B_BAD_VALUE; - - file_cookie *cookie = (file_cookie *)_cookie; - - Volume *volume = (Volume *)_ns; - Inode *inode = (Inode *)_node; - - if (cookie != NULL) - free(cookie); - if (inode->Flags() & INODE_NO_CACHE) { volume->Pool().ReleaseBuffers(); inode->Node()->flags &= HOST_ENDIAN_TO_BFS_INT32(~INODE_NO_CACHE); @@ -1418,6 +1410,7 @@ bfs_free_cookie(void *_ns, void *_node, void *_cookie) // non-permanent flag which will be removed when the inode is loaded // into memory. } + if (inode->Flags() & INODE_CHKBFS_RUNNING) { // "chkbfs" exited abnormally, so we have to stop it here... FATAL(("check process was aborted!\n"));