From owner-svn-src-head@freebsd.org Thu Aug 11 07:58:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B61BBB6EEC; Thu, 11 Aug 2016 07:58:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2965318ED; Thu, 11 Aug 2016 07:58:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7B7wOKL083955; Thu, 11 Aug 2016 07:58:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7B7wORX083952; Thu, 11 Aug 2016 07:58:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608110758.u7B7wORX083952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 11 Aug 2016 07:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303951 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2016 07:58:25 -0000 Author: markj Date: Thu Aug 11 07:58:23 2016 New Revision: 303951 URL: https://svnweb.freebsd.org/changeset/base/303951 Log: Remove b_pin_count from struct buf. It was added in r153192 for XFS and doesn't appear to have been used for anything else. XFS was disconnected in r241607 and removed entirely in r247631. Reported by: mlaier Reviewed by: imp, kib Differential Revision: https://reviews.freebsd.org/D7468 Modified: head/sys/kern/vfs_bio.c head/sys/kern/vfs_cluster.c head/sys/sys/buf.h Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Thu Aug 11 07:11:15 2016 (r303950) +++ head/sys/kern/vfs_bio.c Thu Aug 11 07:58:23 2016 (r303951) @@ -1479,7 +1479,6 @@ buf_alloc(void) bp->b_npages = 0; bp->b_dirtyoff = bp->b_dirtyend = 0; bp->b_bufobj = NULL; - bp->b_pin_count = 0; bp->b_data = bp->b_kvabase = unmapped_buf; bp->b_fsprivate1 = NULL; bp->b_fsprivate2 = NULL; @@ -1908,9 +1907,6 @@ bufwrite(struct buf *bp) BUF_ASSERT_HELD(bp); - if (bp->b_pin_count > 0) - bunpin_wait(bp); - KASSERT(!(bp->b_vflags & BV_BKGRDINPROG), ("FFS background buffer should not get here %p", bp)); @@ -3123,10 +3119,7 @@ flushbufqueues(struct vnode *lvp, int ta mtx_unlock(&bqlocks[queue]); if (error != 0) continue; - if (bp->b_pin_count > 0) { - BUF_UNLOCK(bp); - continue; - } + /* * BKGRDINPROG can only be set with the buf and bufobj * locks both held. We tolerate a race to clear it here. @@ -3546,19 +3539,6 @@ loop: if ((bp->b_flags & B_VMIO) == 0 || (size > bp->b_kvasize)) { if (bp->b_flags & B_DELWRI) { - /* - * If buffer is pinned and caller does - * not want sleep waiting for it to be - * unpinned, bail out - * */ - if (bp->b_pin_count > 0) { - if (flags & GB_LOCK_NOWAIT) { - bqrelse(bp); - return (NULL); - } else { - bunpin_wait(bp); - } - } bp->b_flags |= B_NOCACHE; bwrite(bp); } else { @@ -4632,41 +4612,6 @@ bufobj_wwait(struct bufobj *bo, int slpf return (error); } -void -bpin(struct buf *bp) -{ - struct mtx *mtxp; - - mtxp = mtx_pool_find(mtxpool_sleep, bp); - mtx_lock(mtxp); - bp->b_pin_count++; - mtx_unlock(mtxp); -} - -void -bunpin(struct buf *bp) -{ - struct mtx *mtxp; - - mtxp = mtx_pool_find(mtxpool_sleep, bp); - mtx_lock(mtxp); - if (--bp->b_pin_count == 0) - wakeup(bp); - mtx_unlock(mtxp); -} - -void -bunpin_wait(struct buf *bp) -{ - struct mtx *mtxp; - - mtxp = mtx_pool_find(mtxpool_sleep, bp); - mtx_lock(mtxp); - while (bp->b_pin_count > 0) - msleep(bp, mtxp, PRIBIO, "bwunpin", 0); - mtx_unlock(mtxp); -} - /* * Set bio_data or bio_ma for struct bio from the struct buf. */ Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Thu Aug 11 07:11:15 2016 (r303950) +++ head/sys/kern/vfs_cluster.c Thu Aug 11 07:58:23 2016 (r303951) @@ -836,12 +836,6 @@ cluster_wbuild(struct vnode *vp, long si --len; continue; } - if (tbp->b_pin_count > 0) { - BUF_UNLOCK(tbp); - ++start_lbn; - --len; - continue; - } bremfree(tbp); tbp->b_flags &= ~B_DONE; @@ -954,14 +948,6 @@ cluster_wbuild(struct vnode *vp, long si } /* - * Do not pull in pinned buffers. - */ - if (tbp->b_pin_count > 0) { - BUF_UNLOCK(tbp); - break; - } - - /* * Ok, it's passed all the tests, * so remove it from the free list * and mark it busy. We will use it. Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Thu Aug 11 07:11:15 2016 (r303950) +++ head/sys/sys/buf.h Thu Aug 11 07:58:23 2016 (r303951) @@ -139,7 +139,6 @@ struct buf { void *b_fsprivate1; void *b_fsprivate2; void *b_fsprivate3; - int b_pin_count; }; #define b_object b_bufobj->bo_object