Returns a v-node for a given name in a directory.
int vn_lookup (dvp, vpp, name, vattrp , crp) struct vnode *dvp; struct vnode **vpp; char *name; struct vattr *vattrp; struct ucred *crp;
dvp | Points to the virtual node (v-node) of the directory to be searched. The logical file system verifies that this v-node is of a VDIR type. |
name | Points to a null-terminated character string containing the file name to look up. |
vattrp | Points to a vattr structure. If this pointer is NULL, no action is required of the file system implementation. If it is not NULL, the attributes of the file specified by the name parameter are returned at the address passed in the vattrp parameter. |
vpp | Points to the place to which to return the v-node pointer, if the pointer is found. Otherwise, a null character should be placed in this memory location. |
crp | Points to the cred structure. This structure contains data that the file system can use to validate access permission. |
The vn_lookup entry point is invoked by the logical file system to find a v-node. It is used by the kernel to convert application-given path names to the v-nodes that represent them.
The use count in the v-node specified by the dvp parameter is incremented for this operation, and it is not decremented by the file system implementation.
If the name is found, a pointer to the desired v-node is placed in the memory location specified by the vpp parameter, and the v-node hold count is incremented. (In this case, this entry point returns 0.) If the file name is not found, a null character is placed in the vpp parameter, and the function returns a ENOENT value. Errors are reported with a return code from the /usr/include/sys/errno.h file. Possible errors are usually specific to the particular virtual file system involved.
The vn_lookup entry point can be called from the process environment only.
0 | Indicates success. |
Nonzero return values are returned from the /usr/include/sys/errno.h file to indicate failure.
Virtual File System Overview, Virtual File System Kernel Extensions Overview, Logical File System Overview, Understanding Virtual Nodes (V-nodes) in AIX Kernel Extensions and Device Support Programming Concepts.
List of Virtual File System Operations.