From 223bba10f3cd044b904fa91cc0271d34faaf700b Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 28 Feb 2007 22:24:28 +0000 Subject: [PATCH] Resurrected is_vnode_removed(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20256 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/drivers/fs_interface.h | 2 ++ src/system/kernel/fs/vfs.cpp | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/headers/os/drivers/fs_interface.h b/headers/os/drivers/fs_interface.h index 23e05ca764..160badcefd 100644 --- a/headers/os/drivers/fs_interface.h +++ b/headers/os/drivers/fs_interface.h @@ -265,6 +265,8 @@ extern status_t get_vnode(mount_id mountID, vnode_id vnodeID, extern status_t put_vnode(mount_id mountID, vnode_id vnodeID); extern status_t remove_vnode(mount_id mountID, vnode_id vnodeID); extern status_t unremove_vnode(mount_id mountID, vnode_id vnodeID); +extern status_t unremove_vnode(mount_id mountID, vnode_id vnodeID); +extern status_t is_vnode_removed(mount_id mountID, vnode_id vnodeID); extern status_t notify_listener(int op, mount_id device, vnode_id parentNode, vnode_id toParentNode, vnode_id node, const char *name); diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp index 3214e0b652..1b4f95bb34 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -2631,6 +2631,26 @@ unremove_vnode(mount_id mountID, vnode_id vnodeID) } +extern "C" status_t +is_vnode_removed(mount_id mountID, vnode_id vnodeID) +{ + struct vnode *vnode; + + mutex_lock(&sVnodeMutex); + + status_t result; + + vnode = lookup_vnode(mountID, vnodeID); + if (vnode) + result = vnode->remove ? 1 : 0; + else + result = B_BAD_VALUE; + + mutex_unlock(&sVnodeMutex); + return result; +} + + // #pragma mark - private VFS API // Functions the VFS exports for other parts of the kernel