From: Jens Axboe Date: Thu, 3 May 2018 15:14:57 +0000 (-0600) Subject: blk-wbt: account any writing command as a write X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=825843b0adb7c95e8cbab35e6fee64980e29ade8;p=linux.git blk-wbt: account any writing command as a write 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 Reviewed-by: Darrick J. Wong Reviewed-by: Omar Sandoval Signed-off-by: Jens Axboe --- diff --git a/block/blk-wbt.c b/block/blk-wbt.c index f92fc84b5e2c4..3e34b41bcefc9 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -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 */