Deleted Added
full compact
union_subr.c (1817) union_subr.c (3396)
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.4 (Berkeley) 2/17/94
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.4 (Berkeley) 2/17/94
38 * $Id$
38 * $Id: union_subr.c,v 1.3 1994/08/02 07:45:44 davidg Exp $
39 */
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/time.h>
44#include <sys/kernel.h>
45#include <sys/vnode.h>
46#include <sys/namei.h>

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

75
76static int
77union_list_lock(ix)
78 int ix;
79{
80
81 if (unvplock[ix] & UN_LOCKED) {
82 unvplock[ix] |= UN_WANT;
39 */
40
41#include <sys/param.h>
42#include <sys/systm.h>
43#include <sys/time.h>
44#include <sys/kernel.h>
45#include <sys/vnode.h>
46#include <sys/namei.h>

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

75
76static int
77union_list_lock(ix)
78 int ix;
79{
80
81 if (unvplock[ix] & UN_LOCKED) {
82 unvplock[ix] |= UN_WANT;
83 sleep((caddr_t) &unvplock[ix], PINOD);
83 (void) tsleep((caddr_t) &unvplock[ix], PINOD, "unllck", 0);
84 return (1);
85 }
86
87 unvplock[ix] |= UN_LOCKED;
88
89 return (0);
90}
91

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

306 else if (curproc && un->un_pid != curproc->p_pid &&
307 un->un_pid > -1 && curproc->p_pid > -1)
308 panic("union: allocvp not lock owner");
309#endif
310 } else {
311 if (un->un_flags & UN_LOCKED) {
312 vrele(UNIONTOV(un));
313 un->un_flags |= UN_WANT;
84 return (1);
85 }
86
87 unvplock[ix] |= UN_LOCKED;
88
89 return (0);
90}
91

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

306 else if (curproc && un->un_pid != curproc->p_pid &&
307 un->un_pid > -1 && curproc->p_pid > -1)
308 panic("union: allocvp not lock owner");
309#endif
310 } else {
311 if (un->un_flags & UN_LOCKED) {
312 vrele(UNIONTOV(un));
313 un->un_flags |= UN_WANT;
314 sleep((caddr_t) &un->un_flags, PINOD);
314 (void) tsleep((caddr_t) &un->un_flags, PINOD, "unalvp", 0);
315 goto loop;
316 }
317 un->un_flags |= UN_LOCKED;
318
319#ifdef DIAGNOSTIC
320 if (curproc)
321 un->un_pid = curproc->p_pid;
322 else

--- 422 unchanged lines hidden ---
315 goto loop;
316 }
317 un->un_flags |= UN_LOCKED;
318
319#ifdef DIAGNOSTIC
320 if (curproc)
321 un->un_pid = curproc->p_pid;
322 else

--- 422 unchanged lines hidden ---