Deleted Added
full compact
vfs_export.c (42453) vfs_export.c (42957)
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.31 (Berkeley) 5/26/95
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.31 (Berkeley) 5/26/95
39 * $Id: vfs_subr.c,v 1.181 1999/01/08 17:31:17 eivind Exp $
39 * $Id: vfs_subr.c,v 1.182 1999/01/10 01:58:26 eivind Exp $
40 */
41
42/*
43 * External virtual filesystem routines
44 */
45#include "opt_ddb.h"
46
47#include <sys/param.h>

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

58#include <sys/buf.h>
59#include <sys/domain.h>
60#include <sys/dirent.h>
61#include <sys/vmmeter.h>
62
63#include <machine/limits.h>
64
65#include <vm/vm.h>
40 */
41
42/*
43 * External virtual filesystem routines
44 */
45#include "opt_ddb.h"
46
47#include <sys/param.h>

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

58#include <sys/buf.h>
59#include <sys/domain.h>
60#include <sys/dirent.h>
61#include <sys/vmmeter.h>
62
63#include <machine/limits.h>
64
65#include <vm/vm.h>
66#include <vm/vm_param.h>
67#include <vm/vm_prot.h>
66#include <vm/vm_object.h>
67#include <vm/vm_extern.h>
68#include <vm/pmap.h>
69#include <vm/vm_map.h>
68#include <vm/vm_object.h>
69#include <vm/vm_extern.h>
70#include <vm/pmap.h>
71#include <vm/vm_map.h>
72#include <vm/vm_page.h>
70#include <vm/vm_pager.h>
71#include <vm/vnode_pager.h>
72#include <vm/vm_zone.h>
73#include <sys/sysctl.h>
74
75#include <miscfs/specfs/specdev.h>
76
77static MALLOC_DEFINE(M_NETADDR, "Export Host", "Export host address structure");

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

980 */
981 if (time_second == starttime)
982 tsleep(&lbolt, PPAUSE, "syncer", 0);
983 }
984}
985
986/*
987 * Associate a p-buffer with a vnode.
73#include <vm/vm_pager.h>
74#include <vm/vnode_pager.h>
75#include <vm/vm_zone.h>
76#include <sys/sysctl.h>
77
78#include <miscfs/specfs/specdev.h>
79
80static MALLOC_DEFINE(M_NETADDR, "Export Host", "Export host address structure");

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

983 */
984 if (time_second == starttime)
985 tsleep(&lbolt, PPAUSE, "syncer", 0);
986 }
987}
988
989/*
990 * Associate a p-buffer with a vnode.
991 *
992 * Also sets B_PAGING flag to indicate that vnode is not fully associated
993 * with the buffer. i.e. the bp has not been linked into the vnode or
994 * ref-counted.
988 */
989void
990pbgetvp(vp, bp)
991 register struct vnode *vp;
992 register struct buf *bp;
993{
994
995 KASSERT(bp->b_vp == NULL, ("pbgetvp: not free"));
996
997 bp->b_vp = vp;
995 */
996void
997pbgetvp(vp, bp)
998 register struct vnode *vp;
999 register struct buf *bp;
1000{
1001
1002 KASSERT(bp->b_vp == NULL, ("pbgetvp: not free"));
1003
1004 bp->b_vp = vp;
1005 bp->b_flags |= B_PAGING;
998 if (vp->v_type == VBLK || vp->v_type == VCHR)
999 bp->b_dev = vp->v_rdev;
1000 else
1001 bp->b_dev = NODEV;
1002}
1003
1004/*
1005 * Disassociate a p-buffer from a vnode.
1006 */
1007void
1008pbrelvp(bp)
1009 register struct buf *bp;
1010{
1011
1012 KASSERT(bp->b_vp != NULL, ("pbrelvp: NULL"));
1013
1006 if (vp->v_type == VBLK || vp->v_type == VCHR)
1007 bp->b_dev = vp->v_rdev;
1008 else
1009 bp->b_dev = NODEV;
1010}
1011
1012/*
1013 * Disassociate a p-buffer from a vnode.
1014 */
1015void
1016pbrelvp(bp)
1017 register struct buf *bp;
1018{
1019
1020 KASSERT(bp->b_vp != NULL, ("pbrelvp: NULL"));
1021
1022#if !defined(MAX_PERF)
1023 /* XXX REMOVE ME */
1024 if (bp->b_vnbufs.tqe_next != NULL) {
1025 panic(
1026 "relpbuf(): b_vp was probably reassignbuf()d %p %x",
1027 bp,
1028 (int)bp->b_flags
1029 );
1030 }
1031#endif
1014 bp->b_vp = (struct vnode *) 0;
1032 bp->b_vp = (struct vnode *) 0;
1033 bp->b_flags &= ~B_PAGING;
1015}
1016
1034}
1035
1036void
1037pbreassignbuf(bp, newvp)
1038 struct buf *bp;
1039 struct vnode *newvp;
1040{
1041#if !defined(MAX_PERF)
1042 if ((bp->b_flags & B_PAGING) == 0) {
1043 panic(
1044 "pbreassignbuf() on non phys bp %p",
1045 bp
1046 );
1047 }
1048#endif
1049 bp->b_vp = newvp;
1050}
1051
1017/*
1018 * Reassign a buffer from one vnode to another.
1019 * Used to assign file specific control information
1020 * (indirect blocks) to the vnode to which they belong.
1021 */
1022void
1023reassignbuf(bp, newvp)
1024 register struct buf *bp;

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

1029 int delay;
1030 int s;
1031
1032 if (newvp == NULL) {
1033 printf("reassignbuf: NULL");
1034 return;
1035 }
1036
1052/*
1053 * Reassign a buffer from one vnode to another.
1054 * Used to assign file specific control information
1055 * (indirect blocks) to the vnode to which they belong.
1056 */
1057void
1058reassignbuf(bp, newvp)
1059 register struct buf *bp;

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

1064 int delay;
1065 int s;
1066
1067 if (newvp == NULL) {
1068 printf("reassignbuf: NULL");
1069 return;
1070 }
1071
1072#if !defined(MAX_PERF)
1073 /*
1074 * B_PAGING flagged buffers cannot be reassigned because their vp
1075 * is not fully linked in.
1076 */
1077 if (bp->b_flags & B_PAGING)
1078 panic("cannot reassign paging buffer");
1079#endif
1080
1037 s = splbio();
1038 /*
1039 * Delete from old vnode list, if on one.
1040 */
1041 if (bp->b_xflags & (B_VNDIRTY|B_VNCLEAN)) {
1042 oldvp = bp->b_vp;
1043 if (bp->b_xflags & B_VNDIRTY)
1044 listheadp = &oldvp->v_dirtyblkhd;

--- 1784 unchanged lines hidden ---
1081 s = splbio();
1082 /*
1083 * Delete from old vnode list, if on one.
1084 */
1085 if (bp->b_xflags & (B_VNDIRTY|B_VNCLEAN)) {
1086 oldvp = bp->b_vp;
1087 if (bp->b_xflags & B_VNDIRTY)
1088 listheadp = &oldvp->v_dirtyblkhd;

--- 1784 unchanged lines hidden ---