Deleted Added
full compact
union_vnops.c (144620) union_vnops.c (145006)
1/*-
2 * Copyright (c) 1992, 1993, 1994, 1995 Jan-Simon Pendry.
3 * Copyright (c) 1992, 1993, 1994, 1995
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Jan-Simon Pendry.
8 *

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

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)union_vnops.c 8.32 (Berkeley) 6/23/95
1/*-
2 * Copyright (c) 1992, 1993, 1994, 1995 Jan-Simon Pendry.
3 * Copyright (c) 1992, 1993, 1994, 1995
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * Jan-Simon Pendry.
8 *

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

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)union_vnops.c 8.32 (Berkeley) 6/23/95
34 * $FreeBSD: head/sys/fs/unionfs/union_vnops.c 144620 2005-04-04 09:36:26Z jeff $
34 * $FreeBSD: head/sys/fs/unionfs/union_vnops.c 145006 2005-04-13 10:59:09Z jeff $
35 */
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/fcntl.h>
40#include <sys/stat.h>
41#include <sys/kernel.h>
42#include <sys/vnode.h>

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

221 */
222
223 error = VOP_LOOKUP(dvp, &tdvp, cnp);
224 if (error) {
225 UDEBUG(("dvp %p error %d flags %lx\n", dvp, error, cnp->cn_flags));
226 *vpp = NULL;
227 return (error);
228 }
35 */
36
37#include <sys/param.h>
38#include <sys/systm.h>
39#include <sys/fcntl.h>
40#include <sys/stat.h>
41#include <sys/kernel.h>
42#include <sys/vnode.h>

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

221 */
222
223 error = VOP_LOOKUP(dvp, &tdvp, cnp);
224 if (error) {
225 UDEBUG(("dvp %p error %d flags %lx\n", dvp, error, cnp->cn_flags));
226 *vpp = NULL;
227 return (error);
228 }
229
230 /*
231 * The parent directory will have been unlocked, unless this is a
232 * dotdot lookup or if dvp == tdvp (tdvp must be locked).
233 *
234 * We want our dvp to remain locked and ref'd. We also want tdvp
235 * to remain locked and ref'd.
236 */
237 UDEBUG(("parentdir %p result %p flag %lx\n", dvp, tdvp, cnp->cn_flags));
238
229 UDEBUG(("parentdir %p result %p flag %lx\n", dvp, tdvp, cnp->cn_flags));
230
239 if (dvp != tdvp && (cnp->cn_flags & ISDOTDOT))
240 vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td);
241
242 /*
243 * Lastly check if the current node is a mount point in
244 * which case walk up the mount hierarchy making sure not to
245 * bump into the root of the mount tree (ie. dvp != udvp).
246 *
247 * We use dvp as a temporary variable here, it is no longer related
248 * to the dvp above. However, we have to ensure that both *pdvp and
249 * tdvp are locked on return.

--- 1767 unchanged lines hidden ---
231 /*
232 * Lastly check if the current node is a mount point in
233 * which case walk up the mount hierarchy making sure not to
234 * bump into the root of the mount tree (ie. dvp != udvp).
235 *
236 * We use dvp as a temporary variable here, it is no longer related
237 * to the dvp above. However, we have to ensure that both *pdvp and
238 * tdvp are locked on return.

--- 1767 unchanged lines hidden ---