Index: head/sys/kern/vfs_bio.c =================================================================== --- head/sys/kern/vfs_bio.c +++ head/sys/kern/vfs_bio.c @@ -1479,7 +1479,6 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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. */ Index: head/sys/kern/vfs_cluster.c =================================================================== --- head/sys/kern/vfs_cluster.c +++ head/sys/kern/vfs_cluster.c @@ -836,12 +836,6 @@ --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 @@ } /* - * 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. Index: head/sys/sys/buf.h =================================================================== --- head/sys/sys/buf.h +++ head/sys/sys/buf.h @@ -139,7 +139,6 @@ void *b_fsprivate1; void *b_fsprivate2; void *b_fsprivate3; - int b_pin_count; }; #define b_object b_bufobj->bo_object