From ca008fe1710db893e5a8b7a8793ff2c5a0e2d9ee Mon Sep 17 00:00:00 2001 From: phk Date: Mon, 15 Nov 2004 08:12:50 +0000 Subject: Move pbgetvp() and pbrelvp() to vm_pager.c with the rest of the pbuf stuff. --- sys/kern/vfs_subr.c | 46 ---------------------------------------------- sys/vm/vm_pager.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 46 deletions(-) (limited to 'sys') diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index f04fd50..95748df 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1691,52 +1691,6 @@ syncer_shutdown(void *arg, int howto) } /* - * Associate a p-buffer with a vnode. - * - * Also sets B_PAGING flag to indicate that vnode is not fully associated - * with the buffer. i.e. the bp has not been linked into the vnode or - * ref-counted. - */ -void -pbgetvp(vp, bp) - register struct vnode *vp; - register struct buf *bp; -{ - - KASSERT(bp->b_vp == NULL, ("pbgetvp: not free")); - - bp->b_vp = vp; - bp->b_flags |= B_PAGING; - bp->b_bufobj = &vp->v_bufobj; -} - -/* - * Disassociate a p-buffer from a vnode. - */ -void -pbrelvp(bp) - register struct buf *bp; -{ - - KASSERT(bp->b_vp != NULL, ("pbrelvp: NULL")); - KASSERT(bp->b_bufobj != NULL, ("pbrelvp: NULL bufobj")); - - /* XXX REMOVE ME */ - BO_LOCK(bp->b_bufobj); - if (TAILQ_NEXT(bp, b_bobufs) != NULL) { - panic( - "relpbuf(): b_vp was probably reassignbuf()d %p %x", - bp, - (int)bp->b_flags - ); - } - BO_UNLOCK(bp->b_bufobj); - bp->b_vp = NULL; - bp->b_bufobj = NULL; - bp->b_flags &= ~B_PAGING; -} - -/* * Reassign a buffer from one vnode to another. * Used to assign file specific control information * (indirect blocks) to the vnode to which they belong. diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index 5d15827..90cde2d 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -420,3 +420,47 @@ relpbuf(bp, pfreecnt) mtx_unlock(&pbuf_mtx); splx(s); } + +/* + * Associate a p-buffer with a vnode. + * + * Also sets B_PAGING flag to indicate that vnode is not fully associated + * with the buffer. i.e. the bp has not been linked into the vnode or + * ref-counted. + */ +void +pbgetvp(struct vnode *vp, struct buf *bp) +{ + + KASSERT(bp->b_vp == NULL, ("pbgetvp: not free")); + + bp->b_vp = vp; + bp->b_flags |= B_PAGING; + bp->b_bufobj = &vp->v_bufobj; +} + +/* + * Disassociate a p-buffer from a vnode. + */ +void +pbrelvp(struct buf *bp) +{ + + KASSERT(bp->b_vp != NULL, ("pbrelvp: NULL")); + KASSERT(bp->b_bufobj != NULL, ("pbrelvp: NULL bufobj")); + + /* XXX REMOVE ME */ + BO_LOCK(bp->b_bufobj); + if (TAILQ_NEXT(bp, b_bobufs) != NULL) { + panic( + "relpbuf(): b_vp was probably reassignbuf()d %p %x", + bp, + (int)bp->b_flags + ); + } + BO_UNLOCK(bp->b_bufobj); + bp->b_vp = NULL; + bp->b_bufobj = NULL; + bp->b_flags &= ~B_PAGING; +} + -- cgit v1.1