]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/miscfs/specfs/spec_vnops.c
xnu-344.tar.gz
[apple/xnu.git] / bsd / miscfs / specfs / spec_vnops.c
index 81b836085dc1b5cb8bdc9531a07acb3507543514..52eea7f8115fb3ef3652f3643beb7d0379bf4522 100644 (file)
@@ -73,6 +73,7 @@
 #include <miscfs/specfs/specdev.h>
 #include <vfs/vfs_support.h>
 
+#include <sys/kdebug.h>
 
 struct vnode *speclisth[SPECHSZ];
 
@@ -589,8 +590,28 @@ spec_strategy(ap)
                struct buf *a_bp;
        } */ *ap;
 {
-       (*bdevsw[major(ap->a_bp->b_dev)].d_strategy)(ap->a_bp);
-       return (0);
+        struct buf *bp;
+
+        bp = ap->a_bp;
+
+        if (kdebug_enable) {
+            int    code = 0;
+
+            if (bp->b_flags & B_READ)
+                code |= DKIO_READ;
+            if (bp->b_flags & B_ASYNC)
+                code |= DKIO_ASYNC;
+
+            if (bp->b_flags & B_META)
+                code |= DKIO_META;
+            else if (bp->b_flags & (B_PGIN | B_PAGEOUT))
+                code |= DKIO_PAGING;
+
+            KERNEL_DEBUG_CONSTANT(FSDBG_CODE(DBG_DKRW, code) | DBG_FUNC_NONE,
+                                bp, bp->b_dev, bp->b_blkno, bp->b_bcount, 0);
+        }
+        (*bdevsw[major(bp->b_dev)].d_strategy)(bp);
+        return (0);
 }
 
 /*