VOP_LOOKUP.9 (3fd5156000420a87f1a9cd6bf787c8dee2261b91) VOP_LOOKUP.9 (b92a189eb9b32f7e9db74343d46434b554a67d04)
1.\" -*- nroff -*-
2.\"
3.\" Copyright (c) 1996 Doug Rabson
4.\"
5.\" All rights reserved.
6.\"
7.\" This program is free software.
8.\"

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

103Look for name in cache, if found, then return name.
104Search for name in directory, goto to found or notfound as appropriate.
105.Ed
106.Pp
107notfound:
108.Bd -filled -offset indent
109If creating or renaming and at end of pathname,
110return
1.\" -*- nroff -*-
2.\"
3.\" Copyright (c) 1996 Doug Rabson
4.\"
5.\" All rights reserved.
6.\"
7.\" This program is free software.
8.\"

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

103Look for name in cache, if found, then return name.
104Search for name in directory, goto to found or notfound as appropriate.
105.Ed
106.Pp
107notfound:
108.Bd -filled -offset indent
109If creating or renaming and at end of pathname,
110return
111.Dv EJUSTRETURN ,
111.Er EJUSTRETURN ,
112leaving info on available slots else return
112leaving info on available slots else return
113.Dv ENOENT .
113.Er ENOENT .
114.Ed
115.Pp
116found:
117.Bd -filled -offset indent
118If at end of path and deleting, return information to allow delete.
119If at end of path and renaming, lock target
120inode and return info to allow rename.
121If not at end, add name to cache; if at end and neither creating
122nor deleting, add name to cache.
123.Ed
124.Sh LOCKS
125The directory,
126.Fa dvp
127should be locked on entry.
128If an error (note: the return value
114.Ed
115.Pp
116found:
117.Bd -filled -offset indent
118If at end of path and deleting, return information to allow delete.
119If at end of path and renaming, lock target
120inode and return info to allow rename.
121If not at end, add name to cache; if at end and neither creating
122nor deleting, add name to cache.
123.Ed
124.Sh LOCKS
125The directory,
126.Fa dvp
127should be locked on entry.
128If an error (note: the return value
129.Dv EJUSTRETURN
129.Er EJUSTRETURN
130is not considered an error)
131is detected, it will be returned locked.
132Otherwise, it will be unlocked unless both
133.Dv LOCKPARENT
134and
135.Dv ISLASTCN
136are specified in
137.Fa cnp->cn_flags .

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

148.Pp
149If the component is not found and the operation is
150.Dv CREATE
151or
152.Dv RENAME ,
153the flag
154.Dv ISLASTCN
155is specified and the operation would succeed, the special return value
130is not considered an error)
131is detected, it will be returned locked.
132Otherwise, it will be unlocked unless both
133.Dv LOCKPARENT
134and
135.Dv ISLASTCN
136are specified in
137.Fa cnp->cn_flags .

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

148.Pp
149If the component is not found and the operation is
150.Dv CREATE
151or
152.Dv RENAME ,
153the flag
154.Dv ISLASTCN
155is specified and the operation would succeed, the special return value
156.Dv EJUSTRETURN
156.Er EJUSTRETURN
157is returned.
158Otherwise, an appropriate error code is returned.
159.Sh PSEUDOCODE
160.Bd -literal
161int
162vop_lookup(struct vnode *dvp,
163 struct vnode **vpp,
164 struct componentname *cnp)

--- 287 unchanged lines hidden ---
157is returned.
158Otherwise, an appropriate error code is returned.
159.Sh PSEUDOCODE
160.Bd -literal
161int
162vop_lookup(struct vnode *dvp,
163 struct vnode **vpp,
164 struct componentname *cnp)

--- 287 unchanged lines hidden ---