]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/linux/blk-cgroup.h
Merge branch 'for-4.8/core' of git://git.kernel.dk/linux-block
[karo-tx-linux.git] / include / linux / blk-cgroup.h
index c02e669945e9279bceb796eb9a1adb938ebf863b..f77150a4a96aca88e2508e18a50973877a8cd0c4 100644 (file)
@@ -590,25 +590,26 @@ static inline void blkg_rwstat_exit(struct blkg_rwstat *rwstat)
 /**
  * blkg_rwstat_add - add a value to a blkg_rwstat
  * @rwstat: target blkg_rwstat
- * @rw: mask of REQ_{WRITE|SYNC}
+ * @op: REQ_OP
+ * @op_flags: rq_flag_bits
  * @val: value to add
  *
  * Add @val to @rwstat.  The counters are chosen according to @rw.  The
  * caller is responsible for synchronizing calls to this function.
  */
 static inline void blkg_rwstat_add(struct blkg_rwstat *rwstat,
-                                  int rw, uint64_t val)
+                                  int op, int op_flags, uint64_t val)
 {
        struct percpu_counter *cnt;
 
-       if (rw & REQ_WRITE)
+       if (op_is_write(op))
                cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_WRITE];
        else
                cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_READ];
 
        __percpu_counter_add(cnt, val, BLKG_STAT_CPU_BATCH);
 
-       if (rw & REQ_SYNC)
+       if (op_flags & REQ_SYNC)
                cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_SYNC];
        else
                cnt = &rwstat->cpu_cnt[BLKG_RWSTAT_ASYNC];
@@ -713,9 +714,9 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q,
 
        if (!throtl) {
                blkg = blkg ?: q->root_blkg;
-               blkg_rwstat_add(&blkg->stat_bytes, bio->bi_rw,
+               blkg_rwstat_add(&blkg->stat_bytes, bio_op(bio), bio->bi_rw,
                                bio->bi_iter.bi_size);
-               blkg_rwstat_add(&blkg->stat_ios, bio->bi_rw, 1);
+               blkg_rwstat_add(&blkg->stat_ios, bio_op(bio), bio->bi_rw, 1);
        }
 
        rcu_read_unlock();