summaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
authorGregorKopka <[email protected]>2013-09-19 16:42:17 +0200
committerBrian Behlendorf <[email protected]>2013-09-25 15:29:45 -0700
commitf9f3f1ef983e987a2e09a49c3684405561fed634 (patch)
treed7c90d355ed2cf4e6c5f7f1de5ce59669e7ca75e /module/zfs
parent77831e17385ba822fe70436d862c0e14df5d67b2 (diff)
Removing unneeded mutex for reading vq_pending_tree size
Locking mutex &vq->vq_lock in vdev_mirror_pending is unneeded: * no data is modified * only vq_pending_tree is read * in case garbage is returned (eg. vq_pending_tree being updated while the read is made) the worst case would be that a single read could be queued on a mirror side which more busy than thought The benefit of this change is streamlining of the code path since it is taken for *every* mirror member on *every* read. Signed-off-by: Brian Behlendorf <[email protected]> Closes #1739
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/vdev_mirror.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/module/zfs/vdev_mirror.c b/module/zfs/vdev_mirror.c
index e0884dc3c..e3d772ac2 100644
--- a/module/zfs/vdev_mirror.c
+++ b/module/zfs/vdev_mirror.c
@@ -89,14 +89,7 @@ static const zio_vsd_ops_t vdev_mirror_vsd_ops = {
static int
vdev_mirror_pending(vdev_t *vd)
{
- vdev_queue_t *vq = &vd->vdev_queue;
- int pending;
-
- mutex_enter(&vq->vq_lock);
- pending = avl_numnodes(&vq->vq_pending_tree);
- mutex_exit(&vq->vq_lock);
-
- return (pending);
+ return avl_numnodes(&vd->vdev_queue.vq_pending_tree);
}
static mirror_map_t *