Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151324077
D7468.id19195.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D7468.id19195.diff
View Options
Index: sys/kern/vfs_bio.c
===================================================================
--- sys/kern/vfs_bio.c
+++ 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: sys/kern/vfs_cluster.c
===================================================================
--- sys/kern/vfs_cluster.c
+++ 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: sys/sys/buf.h
===================================================================
--- sys/sys/buf.h
+++ 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
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 8, 2:49 PM (1 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31103534
Default Alt Text
D7468.id19195.diff (2 KB)
Attached To
Mode
D7468: Remove b_pin_count from struct buf
Attached
Detach File
Event Timeline
Log In to Comment