Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F174875013
D25965.id75443.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
D25965.id75443.diff
View Options
Index: sys/kern/vfs_subr.c
===================================================================
--- sys/kern/vfs_subr.c
+++ sys/kern/vfs_subr.c
@@ -206,15 +206,6 @@
SYSCTL_COUNTER_U64(_vfs, OID_AUTO, recycles_free, CTLFLAG_RD, &recycles_free_count,
"Number of free vnodes recycled to meet vnode cache targets");
-/*
- * Various variables used for debugging the new implementation of
- * reassignbuf().
- * XXX these are probably of (very) limited utility now.
- */
-static int reassignbufcalls;
-SYSCTL_INT(_vfs, OID_AUTO, reassignbufcalls, CTLFLAG_RW | CTLFLAG_STATS,
- &reassignbufcalls, 0, "Number of calls to reassignbuf");
-
static counter_u64_t deferred_inact;
SYSCTL_COUNTER_U64(_vfs, OID_AUTO, deferred_inact, CTLFLAG_RD, &deferred_inact,
"Number of times inactive processing was deferred");
@@ -2265,13 +2256,16 @@
buf_vlist_remove(struct buf *bp)
{
struct bufv *bv;
+ b_xflags_t flags;
+
+ flags = bp->b_xflags;
KASSERT(bp->b_bufobj != NULL, ("No b_bufobj %p", bp));
ASSERT_BO_WLOCKED(bp->b_bufobj);
- KASSERT((bp->b_xflags & (BX_VNDIRTY|BX_VNCLEAN)) !=
- (BX_VNDIRTY|BX_VNCLEAN),
- ("buf_vlist_remove: Buf %p is on two lists", bp));
- if (bp->b_xflags & BX_VNDIRTY)
+ KASSERT((flags & (BX_VNDIRTY | BX_VNCLEAN)) != 0 &&
+ (flags & (BX_VNDIRTY | BX_VNCLEAN)) != (BX_VNDIRTY | BX_VNCLEAN),
+ ("%s: buffer %p has invalid queue state", __func__, bp));
+ if ((flags & BX_VNDIRTY) != 0)
bv = &bp->b_bufobj->bo_dirty;
else
bv = &bp->b_bufobj->bo_clean;
@@ -2400,10 +2394,7 @@
vp = bp->b_vp; /* XXX */
bo = bp->b_bufobj;
BO_LOCK(bo);
- if (bp->b_xflags & (BX_VNDIRTY | BX_VNCLEAN))
- buf_vlist_remove(bp);
- else
- panic("brelvp: Buffer %p not on queue.", bp);
+ buf_vlist_remove(bp);
if ((bo->bo_flag & BO_ONWORKLST) && bo->bo_dirty.bv_cnt == 0) {
bo->bo_flag &= ~BO_ONWORKLST;
mtx_lock(&sync_mtx);
@@ -2732,25 +2723,16 @@
vp = bp->b_vp;
bo = bp->b_bufobj;
- ++reassignbufcalls;
+
+ KASSERT((bp->b_flags & B_PAGING) == 0,
+ ("%s: cannot reassign paging buffer %p", __func__, bp));
CTR3(KTR_BUF, "reassignbuf(%p) vp %p flags %X",
bp, bp->b_vp, bp->b_flags);
- /*
- * B_PAGING flagged buffers cannot be reassigned because their vp
- * is not fully linked in.
- */
- if (bp->b_flags & B_PAGING)
- panic("cannot reassign paging buffer");
- /*
- * Delete from old vnode list, if on one.
- */
BO_LOCK(bo);
- if (bp->b_xflags & (BX_VNDIRTY | BX_VNCLEAN))
- buf_vlist_remove(bp);
- else
- panic("reassignbuf: Buffer %p not on queue.", bp);
+ buf_vlist_remove(bp);
+
/*
* If dirty, put on list of dirty buffers; otherwise insert onto list
* of clean buffers.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Oct 7, 5:10 PM (9 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40361760
Default Alt Text
D25965.id75443.diff (2 KB)
Attached To
Mode
D25965: Clean up reassignbuf() a bit.
Attached
Detach File
Event Timeline
Log In to Comment