本文整理汇总了C++中VNode::GetParentID方法的典型用法代码示例。如果您正苦于以下问题:C++ VNode::GetParentID方法的具体用法?C++ VNode::GetParentID怎么用?C++ VNode::GetParentID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VNode
的用法示例。
在下文中一共展示了VNode::GetParentID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
// reiserfs_lookup
static status_t
reiserfs_lookup(fs_volume* fs, fs_vnode* _dir, const char *entryName,
ino_t *vnid)
{
// FUNCTION_START();
Volume *volume = (Volume*)fs->private_volume;
VNode *dir = (VNode*)_dir->private_node;
FUNCTION(("dir: (%Ld: %lu, %lu), entry: `%s'\n", dir->GetID(), dir->GetDirID(),
dir->GetObjectID(), entryName));
status_t error = B_OK;
VNode *entryNode = NULL;
// check for non-directories
if (!dir->IsDir()) {
error = B_ENTRY_NOT_FOUND;
// special entries: "." and ".."
} else if (!strcmp(entryName, ".")) {
*vnid = dir->GetID();
if (volume->GetVNode(*vnid, &entryNode) != B_OK)
error = B_BAD_VALUE;
} else if (!strcmp(entryName, "..")) {
*vnid = dir->GetParentID();
if (volume->GetVNode(*vnid, &entryNode) != B_OK)
error = B_BAD_VALUE;
// ordinary entries
} else {
// find the entry
VNode foundNode;
error = volume->FindDirEntry(dir, entryName, &foundNode, true);
// hide non-file/dir/symlink entries, if the user desires that, and
// those entries explicitly set to hidden
if (error == B_OK
&& ((foundNode.IsEsoteric() && volume->GetHideEsoteric())
|| volume->IsNegativeEntry(foundNode.GetID()))) {
error = B_ENTRY_NOT_FOUND;
}
if (error == B_OK) {
*vnid = foundNode.GetID();
error = volume->GetVNode(*vnid, &entryNode);
}
}
// add to the entry cache
if (error == B_OK) {
entry_cache_add(volume->GetID(), dir->GetID(), entryName,
*vnid);
}
RETURN_ERROR(error);
}