blk-wbt: account any writing command as a write
authorJens Axboe <axboe@kernel.dk>
Thu, 3 May 2018 15:14:57 +0000 (09:14 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 8 May 2018 21:10:49 +0000 (15:10 -0600)
We currently special case WRITE and FLUSH, but we should really
just include any command with the write bit set. This ensures
that we account DISCARD.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-wbt.c

index f92fc84b5e2c497b77578408c10c22bf37929384..3e34b41bcefc906cf54948e7c683da03a586223f 100644 (file)
@@ -701,7 +701,7 @@ static int wbt_data_dir(const struct request *rq)
 
        if (op == REQ_OP_READ)
                return READ;
-       else if (op == REQ_OP_WRITE || op == REQ_OP_FLUSH)
+       else if (op_is_write(op))
                return WRITE;
 
        /* don't account */