1/* 2 * Copyright (c) 1994 Jan-Simon Pendry 3 * Copyright (c) 1994 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 * --- 21 unchanged lines hidden (view full) --- 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * @(#)union_subr.c 8.20 (Berkeley) 5/20/95 |
38 * $FreeBSD: head/sys/fs/unionfs/union_subr.c 103314 2002-09-14 09:02:28Z njl $ |
39 */ 40 41#include <sys/param.h> 42#include <sys/systm.h> 43#include <sys/fcntl.h> 44#include <sys/file.h> 45#include <sys/filedesc.h> 46#include <sys/kernel.h> --- 391 unchanged lines hidden (view full) --- 438 * scenario is un being under dvp. 439 */ 440 441 if (dvp && un->un_vnode != dvp) { 442 struct vnode *scan = un->un_vnode; 443 444 do { 445 scan = VTOUNION(scan)->un_pvp; |
446 } while (scan && scan->v_op == union_vnodeop_p && 447 scan != dvp); |
448 if (scan != dvp) { 449 /* 450 * our new un is above dvp (we never saw dvp 451 * while moving up the tree). 452 */ 453 VREF(dvp); 454 VOP_UNLOCK(dvp, 0, td); 455 error = vn_lock(un->un_vnode, LK_EXCLUSIVE, td); --- 85 unchanged lines hidden (view full) --- 541 if (union_list_lock(hash)) 542 goto loop; 543 } 544 545 /* 546 * Create new node rather then replace old node 547 */ 548 |
549 error = getnewvnode("union", mp, union_vnodeop_p, vpp); |
550 if (error) { 551 /* 552 * If an error occurs clear out vnodes. 553 */ 554 if (lowervp) 555 vrele(lowervp); 556 if (uppervp) 557 vrele(uppervp); --- 810 unchanged lines hidden --- |