diff options
Diffstat (limited to 'sys/geom/geom_vfs.c')
-rw-r--r-- | sys/geom/geom_vfs.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/sys/geom/geom_vfs.c b/sys/geom/geom_vfs.c index 92f1ad2..eda4b75 100644 --- a/sys/geom/geom_vfs.c +++ b/sys/geom/geom_vfs.c @@ -102,14 +102,10 @@ g_vfs_done(struct bio *bip) /* * Collect statistics on synchronous and asynchronous read * and write counts for disks that have associated filesystems. - * Since this run by the g_up thread it is single threaded and - * we do not need to use atomic increments on the counters. */ bp = bip->bio_caller2; vp = bp->b_vp; - if (vp == NULL) { - mp = NULL; - } else { + if (vp != NULL) { /* * If not a disk vnode, use its associated mount point * otherwise use the mountpoint associated with the disk. @@ -122,20 +118,20 @@ g_vfs_done(struct bio *bip) mp = vp->v_mount; else mp = cdevp->si_mountpt; - VI_UNLOCK(vp); - } - if (mp != NULL) { - if (bp->b_iocmd == BIO_WRITE) { - if (LK_HOLDER(bp->b_lock.lk_lock) == LK_KERNPROC) - mp->mnt_stat.f_asyncwrites++; - else - mp->mnt_stat.f_syncwrites++; - } else { - if (LK_HOLDER(bp->b_lock.lk_lock) == LK_KERNPROC) - mp->mnt_stat.f_asyncreads++; - else - mp->mnt_stat.f_syncreads++; + if (mp != NULL) { + if (bp->b_iocmd == BIO_READ) { + if (LK_HOLDER(bp->b_lock.lk_lock) == LK_KERNPROC) + 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) + mp->mnt_stat.f_asyncwrites++; + else + mp->mnt_stat.f_syncwrites++; + } } + VI_UNLOCK(vp); } cp = bip->bio_from; @@ -260,6 +256,7 @@ g_vfs_open(struct vnode *vp, struct g_consumer **cpp, const char *fsname, int wr vnode_create_vobject(vp, pp->mediasize, curthread); *cpp = cp; cp->private = vp; + cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; bo->bo_ops = g_vfs_bufops; bo->bo_private = cp; bo->bo_bsize = pp->sectorsize; |