Skip to content

Commit

Permalink
block: fix the count of PGPGOUT for WRITE_SAME
Browse files Browse the repository at this point in the history
The vm counters is counted in sectors, so we should do the conversation
in submit_bio.

Fixes: 74d4699 ("block: replace bi_bdev with a gendisk pointer and partitions index")
Cc: [email protected]
Reviewed-by: Omar Sandoval <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Jiufei Xue <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Jiufei Xue authored and axboe committed Mar 1, 2018
1 parent f3bc78d commit 7c5a0dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2434,7 +2434,7 @@ blk_qc_t submit_bio(struct bio *bio)
unsigned int count;

if (unlikely(bio_op(bio) == REQ_OP_WRITE_SAME))
count = queue_logical_block_size(bio->bi_disk->queue);
count = queue_logical_block_size(bio->bi_disk->queue) >> 9;
else
count = bio_sectors(bio);

Expand Down

0 comments on commit 7c5a0dc

Please sign in to comment.