Deleted Added
full compact
vfs_syscalls.c (84323) vfs_syscalls.c (85339)
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_syscalls.c 8.13 (Berkeley) 4/15/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_syscalls.c 8.13 (Berkeley) 4/15/94
39 * $FreeBSD: head/sys/kern/vfs_syscalls.c 84323 2001-10-01 20:01:07Z rwatson $
39 * $FreeBSD: head/sys/kern/vfs_syscalls.c 85339 2001-10-23 01:21:29Z dillon $
40 */
41
42/* For 4.3 integer FS ID compatibility */
43#include "opt_compat.h"
44#include "opt_ffs.h"
45
46#include <sys/param.h>
47#include <sys/systm.h>

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

314 }
315 vp->v_flag |= VMOUNT;
316 mtx_unlock(&vp->v_interlock);
317
318 /*
319 * Allocate and initialize the filesystem.
320 */
321 mp = malloc(sizeof(struct mount), M_MOUNT, M_WAITOK | M_ZERO);
40 */
41
42/* For 4.3 integer FS ID compatibility */
43#include "opt_compat.h"
44#include "opt_ffs.h"
45
46#include <sys/param.h>
47#include <sys/systm.h>

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

314 }
315 vp->v_flag |= VMOUNT;
316 mtx_unlock(&vp->v_interlock);
317
318 /*
319 * Allocate and initialize the filesystem.
320 */
321 mp = malloc(sizeof(struct mount), M_MOUNT, M_WAITOK | M_ZERO);
322 TAILQ_INIT(&mp->mnt_nvnodelist);
322 lockinit(&mp->mnt_lock, PVFS, "vfslock", 0, LK_NOPAUSE);
323 (void)vfs_busy(mp, LK_NOWAIT, 0, td);
324 mp->mnt_op = vfsp->vfc_vfsops;
325 mp->mnt_vfc = vfsp;
326 vfsp->vfc_refcount++;
327 mp->mnt_stat.f_type = vfsp->vfc_typenum;
328 mp->mnt_flag |= vfsp->vfc_flags & MNT_VISFLAGMASK;
329 strncpy(mp->mnt_stat.f_fstypename, fstype, MFSNAMELEN);

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

586 wakeup((caddr_t)mp);
587 return (error);
588 }
589 mtx_lock(&mountlist_mtx);
590 TAILQ_REMOVE(&mountlist, mp, mnt_list);
591 if ((coveredvp = mp->mnt_vnodecovered) != NULL)
592 coveredvp->v_mountedhere = NULL;
593 mp->mnt_vfc->vfc_refcount--;
323 lockinit(&mp->mnt_lock, PVFS, "vfslock", 0, LK_NOPAUSE);
324 (void)vfs_busy(mp, LK_NOWAIT, 0, td);
325 mp->mnt_op = vfsp->vfc_vfsops;
326 mp->mnt_vfc = vfsp;
327 vfsp->vfc_refcount++;
328 mp->mnt_stat.f_type = vfsp->vfc_typenum;
329 mp->mnt_flag |= vfsp->vfc_flags & MNT_VISFLAGMASK;
330 strncpy(mp->mnt_stat.f_fstypename, fstype, MFSNAMELEN);

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

587 wakeup((caddr_t)mp);
588 return (error);
589 }
590 mtx_lock(&mountlist_mtx);
591 TAILQ_REMOVE(&mountlist, mp, mnt_list);
592 if ((coveredvp = mp->mnt_vnodecovered) != NULL)
593 coveredvp->v_mountedhere = NULL;
594 mp->mnt_vfc->vfc_refcount--;
594 if (!LIST_EMPTY(&mp->mnt_vnodelist))
595 if (!TAILQ_EMPTY(&mp->mnt_nvnodelist))
595 panic("unmount: dangling vnode");
596 lockmgr(&mp->mnt_lock, LK_RELEASE | LK_INTERLOCK, &mountlist_mtx, td);
597 lockdestroy(&mp->mnt_lock);
598 if (coveredvp != NULL)
599 vrele(coveredvp);
600 if (mp->mnt_kern_flag & MNTK_MWAIT)
601 wakeup((caddr_t)mp);
602 free((caddr_t)mp, M_MOUNT);

--- 3560 unchanged lines hidden ---
596 panic("unmount: dangling vnode");
597 lockmgr(&mp->mnt_lock, LK_RELEASE | LK_INTERLOCK, &mountlist_mtx, td);
598 lockdestroy(&mp->mnt_lock);
599 if (coveredvp != NULL)
600 vrele(coveredvp);
601 if (mp->mnt_kern_flag & MNTK_MWAIT)
602 wakeup((caddr_t)mp);
603 free((caddr_t)mp, M_MOUNT);

--- 3560 unchanged lines hidden ---