Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151222876
D45249.id138730.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
925 B
Referenced Files
None
Subscribers
None
D45249.id138730.diff
View Options
diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c
--- a/sys/geom/geom_vfs.c
+++ b/sys/geom/geom_vfs.c
@@ -124,12 +124,12 @@
mp = cdevp->si_mountpt;
if (mp != NULL) {
if (bp->b_iocmd == BIO_READ) {
- if (LK_HOLDER(bp->b_lock.lk_lock) == LK_KERNPROC)
+ if (BUF_DISOWNED(bp))
mp->mnt_stat.f_asyncreads++;
else
mp->mnt_stat.f_syncreads++;
} else if (bp->b_iocmd == BIO_WRITE) {
- if (LK_HOLDER(bp->b_lock.lk_lock) == LK_KERNPROC)
+ if (BUF_DISOWNED(bp))
mp->mnt_stat.f_asyncwrites++;
else
mp->mnt_stat.f_syncwrites++;
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
--- a/sys/sys/buf.h
+++ b/sys/sys/buf.h
@@ -341,6 +341,13 @@
*/
#define BUF_ISLOCKED(bp) \
lockstatus(&(bp)->b_lock)
+
+/*
+ * Check if a buffer lock is currently held by LK_KERNPROC.
+ */
+#define BUF_DISOWNED(bp) \
+ lockmgr_disowned(&(bp)->b_lock)
+
/*
* Free a buffer lock.
*/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 7, 11:13 PM (10 h, 9 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31054455
Default Alt Text
D45249.id138730.diff (925 B)
Attached To
Mode
D45249: buf: define and use BUF_DISOWNED
Attached
Detach File
Event Timeline
Log In to Comment