diff --git a/headers/os/drivers/fs_interface.h b/headers/os/drivers/fs_interface.h index 160badcefd..31e816f7fe 100644 --- a/headers/os/drivers/fs_interface.h +++ b/headers/os/drivers/fs_interface.h @@ -266,7 +266,8 @@ 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 get_vnode_removed(mount_id mountID, vnode_id vnodeID, + bool* removed); 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 b9f00850fd..d91b121f09 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -2632,18 +2632,17 @@ unremove_vnode(mount_id mountID, vnode_id vnodeID) extern "C" status_t -is_vnode_removed(mount_id mountID, vnode_id vnodeID) +get_vnode_removed(mount_id mountID, vnode_id vnodeID, bool* removed) { - struct vnode *vnode; - mutex_lock(&sVnodeMutex); status_t result; - vnode = lookup_vnode(mountID, vnodeID); - if (vnode) - result = vnode->remove ? 1 : 0; - else + if (struct vnode* vnode = lookup_vnode(mountID, vnodeID)) { + if (removed) + *removed = vnode->remove; + result = B_OK; + } else result = B_BAD_VALUE; mutex_unlock(&sVnodeMutex);