<dec f='src/src/sys/ufs/ufs/ufs_extern.h' l='76' type='int ufs_lookup(void * )'/>
<use f='src/src/sys/ufs/ffs/ffs_vnops.c' l='107' u='r'/>
<use f='src/src/sys/ufs/ffs/ffs_vnops.c' l='107' u='r'/>
<use f='src/src/sys/ufs/ffs/ffs_vnops.c' l='107' u='r'/>
<use f='src/src/sys/ufs/ffs/ffs_vnops.c' l='107' u='r'/>
<use f='src/src/sys/ufs/ufs/ufs_extattr.c' l='501' u='c' c='ufs_extattr_lookup'/>
<def f='src/src/sys/ufs/ufs/ufs_lookup.c' l='291' ll='700' type='int ufs_lookup(void * v)'/>
<doc f='src/src/sys/ufs/ufs/ufs_lookup.c' l='258'>/*
 * Convert a component of a pathname into a pointer to a locked inode.
 * This is a very central and rather complicated routine.
 * If the file system is not maintained in a strict tree hierarchy,
 * this can result in a deadlock situation (see comments in code below).
 *
 * The cnp-&gt;cn_nameiop argument is LOOKUP, CREATE, RENAME, or DELETE depending
 * on whether the name is to be looked up, created, renamed, or deleted.
 * When CREATE, RENAME, or DELETE is specified, information usable in
 * creating, renaming, or deleting a directory entry may be calculated.
 * If flag has LOCKPARENT or&apos;ed into it and the target of the pathname
 * exists, lookup returns both the target and its parent directory locked.
 * When creating or renaming and LOCKPARENT is specified, the target may
 * not be &quot;.&quot;.  When deleting and LOCKPARENT is specified, the target may
 * be &quot;.&quot;., but the caller must check to ensure it does an vrele and vput
 * instead of two vputs.
 *
 * Overall outline of ufs_lookup:
 *
 *	check accessibility of directory
 *	look for name in cache, if found, then if at end of path
 *	  and deleting or creating, drop it, else return name
 *	search for name in directory, to found or notfound
 * notfound:
 *	if creating, return locked directory, leaving info on available slots
 *	else return error
 * found:
 *	if at end of path and deleting, return information to allow delete
 *	if at end of path and rewriting (RENAME and LOCKPARENT), lock target
 *	  inode and return info to allow rewrite
 *	if not at end, add name to cache; if at end and neither creating
 *	  nor deleting, add name to cache
 */</doc>
