* exists, lookup returns both the target and its parent directory locked.
* When creating or renaming and LOCKPARENT is specified, the target may
* not be ".". When deleting and LOCKPARENT is specified, the target may
* exists, lookup returns both the target and its parent directory locked.
* When creating or renaming and LOCKPARENT is specified, the target may
* not be ".". When deleting and LOCKPARENT is specified, the target may
- * be "."., but the caller must check to ensure it does an vrele and iput
- * instead of two iputs.
+ * be "."., but the caller must check to ensure it does an vrele and vput
+ * instead of two vputs.
int numdirpasses; /* strategy for directory search */
doff_t endsearch; /* offset to end directory search */
doff_t prevoff; /* prev entry dp->i_offset */
int numdirpasses; /* strategy for directory search */
doff_t endsearch; /* offset to end directory search */
doff_t prevoff; /* prev entry dp->i_offset */
struct vnode *tdp; /* returned by VFS_VGET */
doff_t enduseful; /* pointer past last used dir slot */
u_long bmask; /* block offset mask */
struct vnode *tdp; /* returned by VFS_VGET */
doff_t enduseful; /* pointer past last used dir slot */
u_long bmask; /* block offset mask */
* directory because we may need it again if a symbolic link
* is relative to the current directory. Instead we save it
* unlocked as "pdp". We must get the target inode before unlocking
* directory because we may need it again if a symbolic link
* is relative to the current directory. Instead we save it
* unlocked as "pdp". We must get the target inode before unlocking
* work if the file system has any hard links other than ".."
* that point backwards in the directory structure.
*/
* work if the file system has any hard links other than ".."
* that point backwards in the directory structure.
*/
*vpp = tdp;
} else if (dp->i_number == dp->i_ino) {
VREF(vdp); /* we want ourself, ie "." */
*vpp = tdp;
} else if (dp->i_number == dp->i_ino) {
VREF(vdp); /* we want ourself, ie "." */
if (error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp))
return (error);
if (!lockparent || !(flags & ISLASTCN))
if (error = VFS_VGET(vdp->v_mount, dp->i_ino, &tdp))
return (error);
if (!lockparent || !(flags & ISLASTCN))
/*
* Check if source directory is in the path of the target directory.
* Target is supplied locked, source is unlocked.
/*
* Check if source directory is in the path of the target directory.
* Target is supplied locked, source is unlocked.
*/
int
ufs_checkpath(source, target, cred)
struct inode *source, *target;
struct ucred *cred;
{
*/
int
ufs_checkpath(source, target, cred)
struct inode *source, *target;
struct ucred *cred;
{
error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf,
sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE,
IO_NODELOCKED, cred, (int *)0, (struct proc *)0);
error = vn_rdwr(UIO_READ, vp, (caddr_t)&dirbuf,
sizeof (struct dirtemplate), (off_t)0, UIO_SYSSPACE,
IO_NODELOCKED, cred, (int *)0, (struct proc *)0);