Deleted Added
full compact
vfs_export.c (3374) vfs_export.c (3396)
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

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

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94
39 * $Id: vfs_subr.c,v 1.10 1994/10/02 17:35:38 phk Exp $
39 * $Id: vfs_subr.c,v 1.11 1994/10/05 09:48:22 davidg Exp $
40 */
41
42/*
43 * External virtual filesystem routines
44 */
45
46#include <sys/param.h>
47#include <sys/systm.h>

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

103 */
104int
105vfs_lock(mp)
106 register struct mount *mp;
107{
108
109 while(mp->mnt_flag & MNT_MLOCK) {
110 mp->mnt_flag |= MNT_MWAIT;
40 */
41
42/*
43 * External virtual filesystem routines
44 */
45
46#include <sys/param.h>
47#include <sys/systm.h>

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

103 */
104int
105vfs_lock(mp)
106 register struct mount *mp;
107{
108
109 while(mp->mnt_flag & MNT_MLOCK) {
110 mp->mnt_flag |= MNT_MWAIT;
111 sleep((caddr_t)mp, PVFS);
111 (void) tsleep((caddr_t)mp, PVFS, "vfslck", 0);
112 }
113 mp->mnt_flag |= MNT_MLOCK;
114 return (0);
115}
116
117/*
118 * Unlock a locked filesystem.
119 * Panic if filesystem is not locked.

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

138 */
139int
140vfs_busy(mp)
141 register struct mount *mp;
142{
143
144 while(mp->mnt_flag & MNT_MPBUSY) {
145 mp->mnt_flag |= MNT_MPWANT;
112 }
113 mp->mnt_flag |= MNT_MLOCK;
114 return (0);
115}
116
117/*
118 * Unlock a locked filesystem.
119 * Panic if filesystem is not locked.

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

138 */
139int
140vfs_busy(mp)
141 register struct mount *mp;
142{
143
144 while(mp->mnt_flag & MNT_MPBUSY) {
145 mp->mnt_flag |= MNT_MPWANT;
146 sleep((caddr_t)&mp->mnt_flag, PVFS);
146 (void) tsleep((caddr_t)&mp->mnt_flag, PVFS, "vfsbsy", 0);
147 }
148 if (mp->mnt_flag & MNT_UNMOUNT)
149 return (1);
150 mp->mnt_flag |= MNT_MPBUSY;
151 return (0);
152}
153
154/*

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

703 * removed from the free list by getnewvnode. The VXLOCK
704 * flag may not have been set yet because vclean is blocked in
705 * the VOP_LOCK call waiting for the VOP_INACTIVE to complete.
706 */
707 if ((vp->v_flag & VXLOCK) ||
708 (vp->v_usecount == 0 &&
709 vp->v_freelist.tqe_prev == (struct vnode **)0xdeadb)) {
710 vp->v_flag |= VXWANT;
147 }
148 if (mp->mnt_flag & MNT_UNMOUNT)
149 return (1);
150 mp->mnt_flag |= MNT_MPBUSY;
151 return (0);
152}
153
154/*

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

703 * removed from the free list by getnewvnode. The VXLOCK
704 * flag may not have been set yet because vclean is blocked in
705 * the VOP_LOCK call waiting for the VOP_INACTIVE to complete.
706 */
707 if ((vp->v_flag & VXLOCK) ||
708 (vp->v_usecount == 0 &&
709 vp->v_freelist.tqe_prev == (struct vnode **)0xdeadb)) {
710 vp->v_flag |= VXWANT;
711 sleep((caddr_t)vp, PINOD);
711 (void) tsleep((caddr_t)vp, PINOD, "vget", 0);
712 return (1);
713 }
714 if (vp->v_usecount == 0)
715 TAILQ_REMOVE(&vnode_free_list, vp, v_freelist);
716 vp->v_usecount++;
717 if (lockflag)
718 VOP_LOCK(vp);
719 return (0);

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

961
962 if (vp->v_flag & VALIASED) {
963 /*
964 * If a vgone (or vclean) is already in progress,
965 * wait until it is done and return.
966 */
967 if (vp->v_flag & VXLOCK) {
968 vp->v_flag |= VXWANT;
712 return (1);
713 }
714 if (vp->v_usecount == 0)
715 TAILQ_REMOVE(&vnode_free_list, vp, v_freelist);
716 vp->v_usecount++;
717 if (lockflag)
718 VOP_LOCK(vp);
719 return (0);

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

961
962 if (vp->v_flag & VALIASED) {
963 /*
964 * If a vgone (or vclean) is already in progress,
965 * wait until it is done and return.
966 */
967 if (vp->v_flag & VXLOCK) {
968 vp->v_flag |= VXWANT;
969 sleep((caddr_t)vp, PINOD);
969 (void) tsleep((caddr_t)vp, PINOD, "vgall", 0);
970 return;
971 }
972 /*
973 * Ensure that vp will not be vgone'd while we
974 * are eliminating its aliases.
975 */
976 vp->v_flag |= VXLOCK;
977 while (vp->v_flag & VALIASED) {

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

1005 struct vnode *vx;
1006
1007 /*
1008 * If a vgone (or vclean) is already in progress,
1009 * wait until it is done and return.
1010 */
1011 if (vp->v_flag & VXLOCK) {
1012 vp->v_flag |= VXWANT;
970 return;
971 }
972 /*
973 * Ensure that vp will not be vgone'd while we
974 * are eliminating its aliases.
975 */
976 vp->v_flag |= VXLOCK;
977 while (vp->v_flag & VALIASED) {

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

1005 struct vnode *vx;
1006
1007 /*
1008 * If a vgone (or vclean) is already in progress,
1009 * wait until it is done and return.
1010 */
1011 if (vp->v_flag & VXLOCK) {
1012 vp->v_flag |= VXWANT;
1013 sleep((caddr_t)vp, PINOD);
1013 (void) tsleep((caddr_t)vp, PINOD, "vgone", 0);
1014 return;
1015 }
1016 /*
1017 * Clean out the filesystem specific data.
1018 */
1019 vclean(vp, DOCLOSE);
1020 /*
1021 * Delete from old mount point vnode list, if on one.

--- 424 unchanged lines hidden ---
1014 return;
1015 }
1016 /*
1017 * Clean out the filesystem specific data.
1018 */
1019 vclean(vp, DOCLOSE);
1020 /*
1021 * Delete from old mount point vnode list, if on one.

--- 424 unchanged lines hidden ---