block: make rq sector size accessible for block stats
[linux-2.6-block.git] / block / blk-iolatency.c
index d973c38ee4fd65b502af755e491e1a4bb830c0c3..c128d50cb4107969cab6460e3447b93f7c54553f 100644 (file)
@@ -725,7 +725,7 @@ int blk_iolatency_init(struct request_queue *q)
                return -ENOMEM;
 
        rqos = &blkiolat->rqos;
-       rqos->id = RQ_QOS_CGROUP;
+       rqos->id = RQ_QOS_LATENCY;
        rqos->ops = &blkcg_iolatency_ops;
        rqos->q = q;
 
@@ -917,6 +917,9 @@ static size_t iolatency_pd_stat(struct blkg_policy_data *pd, char *buf,
        unsigned long long avg_lat;
        unsigned long long cur_win;
 
+       if (!blkcg_debug_stats)
+               return 0;
+
        if (iolat->ssd)
                return iolatency_ssd_stat(iolat, buf, size);
 
@@ -931,11 +934,13 @@ static size_t iolatency_pd_stat(struct blkg_policy_data *pd, char *buf,
 }
 
 
-static struct blkg_policy_data *iolatency_pd_alloc(gfp_t gfp, int node)
+static struct blkg_policy_data *iolatency_pd_alloc(gfp_t gfp,
+                                                  struct request_queue *q,
+                                                  struct blkcg *blkcg)
 {
        struct iolatency_grp *iolat;
 
-       iolat = kzalloc_node(sizeof(*iolat), gfp, node);
+       iolat = kzalloc_node(sizeof(*iolat), gfp, q->node);
        if (!iolat)
                return NULL;
        iolat->stats = __alloc_percpu_gfp(sizeof(struct latency_stat),