Deleted Added
full compact
opensolaris_lookup.c (185029) opensolaris_lookup.c (191990)
1/*-
2 * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c 185029 2008-11-17 20:49:29Z pjd $");
28__FBSDID("$FreeBSD: head/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c 191990 2009-05-11 15:33:26Z attilio $");
29
30#include <sys/param.h>
31#include <sys/kernel.h>
32#include <sys/systm.h>
33#include <sys/pathname.h>
34#include <sys/vfs.h>
35#include <sys/vnode.h>
36

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

61 NDFREE(&nd, NDF_ONLY_PNBUF);
62 vn_lock(startvp, ltype | LK_RETRY);
63 return (error);
64}
65
66int
67traverse(vnode_t **cvpp, int lktype)
68{
29
30#include <sys/param.h>
31#include <sys/kernel.h>
32#include <sys/systm.h>
33#include <sys/pathname.h>
34#include <sys/vfs.h>
35#include <sys/vnode.h>
36

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

61 NDFREE(&nd, NDF_ONLY_PNBUF);
62 vn_lock(startvp, ltype | LK_RETRY);
63 return (error);
64}
65
66int
67traverse(vnode_t **cvpp, int lktype)
68{
69 kthread_t *td = curthread;
70 vnode_t *cvp;
71 vnode_t *tvp;
72 vfs_t *vfsp;
73 int error;
74
75 cvp = *cvpp;
76 tvp = NULL;
77

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

96 vput(cvp);
97 else
98 vrele(cvp);
99
100 /*
101 * The read lock must be held across the call to VFS_ROOT() to
102 * prevent a concurrent unmount from destroying the vfs.
103 */
69 vnode_t *cvp;
70 vnode_t *tvp;
71 vfs_t *vfsp;
72 int error;
73
74 cvp = *cvpp;
75 tvp = NULL;
76

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

95 vput(cvp);
96 else
97 vrele(cvp);
98
99 /*
100 * The read lock must be held across the call to VFS_ROOT() to
101 * prevent a concurrent unmount from destroying the vfs.
102 */
104 error = VFS_ROOT(vfsp, lktype, &tvp, td);
103 error = VFS_ROOT(vfsp, lktype, &tvp);
105 if (error != 0)
106 return (error);
107 cvp = tvp;
108 }
109
110 *cvpp = cvp;
111 return (0);
112}
104 if (error != 0)
105 return (error);
106 cvp = tvp;
107 }
108
109 *cvpp = cvp;
110 return (0);
111}