kernel - Account for file reads that take the VM shortcut
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 18 Sep 2012 18:45:19 +0000 (11:45 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 18 Sep 2012 18:45:19 +0000 (11:45 -0700)
* Account for file reads that take the VM shortcut in hammer's statistics.

sys/vfs/hammer/hammer_vnops.c

index 20277e9..3781748 100644 (file)
@@ -329,6 +329,7 @@ hammer_vop_read(struct vop_read_args *ap)
        int blksize;
        int bigread;
        int got_fstoken;
+       size_t resid;
 
        if (ap->a_vp->v_type != VREG)
                return (EINVAL);
@@ -342,7 +343,9 @@ hammer_vop_read(struct vop_read_args *ap)
         * Attempt to shortcut directly to the VM object using lwbufs.
         * This is much faster than instantiating buffer cache buffers.
         */
+       resid = uio->uio_resid;
        error = vop_helper_read_shortcut(ap);
+       hammer_stats_file_read += resid - uio->uio_resid;
        if (error)
                return (error);
        if (uio->uio_resid == 0)