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