From 47a54bea537dbe733209005d80334716d137a31a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 28 Aug 2005 20:08:32 +0000 Subject: [PATCH] Rootfs now starts with 1 for the first inode ID. Instead of -1, vnode_path_to_vnode() now returns the ID of the starting vnode when it doesn't need to traverse the path at all. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14081 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/fs/rootfs.c | 2 +- src/system/kernel/fs/vfs.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/kernel/fs/rootfs.c b/src/system/kernel/fs/rootfs.c index 9abc49b58f..703ac2592c 100644 --- a/src/system/kernel/fs/rootfs.c +++ b/src/system/kernel/fs/rootfs.c @@ -313,7 +313,7 @@ rootfs_mount(mount_id id, const char *device, uint32 flags, const char *args, return B_NO_MEMORY; fs->id = id; - fs->next_vnode_id = 0; + fs->next_vnode_id = 1; err = mutex_init(&fs->lock, "rootfs_mutex"); if (err < B_OK) diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp index 46be3a07a2..31a1da0de5 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -1338,7 +1338,7 @@ vnode_path_to_vnode(struct vnode *vnode, char *path, bool traverseLeafLink, int count, struct vnode **_vnode, vnode_id *_parentID, int *_type) { status_t status = 0; - vnode_id lastParentID = -1; + vnode_id lastParentID = vnode->id; int type = 0; FUNCTION(("vnode_path_to_vnode(vnode = %p, path = %s)\n", vnode, path));