vfs_lookup.c (09c817ba36db7c3a4ff5e25ac55816ca181a403d) vfs_lookup.c (e4b4bbb665e36adb8e79b1c5c7946be0ba80b9f1)
1/*-
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 189 unchanged lines hidden (view full) ---

198 ndp->ni_rootdir = fdp->fd_rdir;
199 ndp->ni_topdir = fdp->fd_jdir;
200
201 dp = NULL;
202 if (cnp->cn_pnbuf[0] != '/') {
203 if (ndp->ni_startdir != NULL) {
204 dp = ndp->ni_startdir;
205 error = 0;
1/*-
2 * Copyright (c) 1982, 1986, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 189 unchanged lines hidden (view full) ---

198 ndp->ni_rootdir = fdp->fd_rdir;
199 ndp->ni_topdir = fdp->fd_jdir;
200
201 dp = NULL;
202 if (cnp->cn_pnbuf[0] != '/') {
203 if (ndp->ni_startdir != NULL) {
204 dp = ndp->ni_startdir;
205 error = 0;
206 } else if (ndp->ni_dirfd != AT_FDCWD)
206 } else if (ndp->ni_dirfd != AT_FDCWD) {
207 if (cnp->cn_flags & AUDITVNODE1)
208 AUDIT_ARG_ATFD1(ndp->ni_dirfd);
209 if (cnp->cn_flags & AUDITVNODE2)
210 AUDIT_ARG_ATFD2(ndp->ni_dirfd);
207 error = fgetvp(td, ndp->ni_dirfd, &dp);
211 error = fgetvp(td, ndp->ni_dirfd, &dp);
212 }
208 if (error != 0 || dp != NULL) {
209 FILEDESC_SUNLOCK(fdp);
210 if (error == 0 && dp->v_type != VDIR) {
211 vfslocked = VFS_LOCK_GIANT(dp->v_mount);
212 vrele(dp);
213 VFS_UNLOCK_GIANT(vfslocked);
214 error = ENOTDIR;
215 }

--- 986 unchanged lines hidden ---
213 if (error != 0 || dp != NULL) {
214 FILEDESC_SUNLOCK(fdp);
215 if (error == 0 && dp->v_type != VDIR) {
216 vfslocked = VFS_LOCK_GIANT(dp->v_mount);
217 vrele(dp);
218 VFS_UNLOCK_GIANT(vfslocked);
219 error = ENOTDIR;
220 }

--- 986 unchanged lines hidden ---