|
|
@@ -68,9 +68,11 @@ static u16 nvmet_get_smart_log_nsid(struct nvmet_req *req,
|
|
|
goto out;
|
|
|
|
|
|
host_reads = part_stat_read(ns->bdev->bd_part, ios[READ]);
|
|
|
- data_units_read = part_stat_read(ns->bdev->bd_part, sectors[READ]);
|
|
|
+ data_units_read = DIV_ROUND_UP(part_stat_read(ns->bdev->bd_part,
|
|
|
+ sectors[READ]), 1000);
|
|
|
host_writes = part_stat_read(ns->bdev->bd_part, ios[WRITE]);
|
|
|
- data_units_written = part_stat_read(ns->bdev->bd_part, sectors[WRITE]);
|
|
|
+ data_units_written = DIV_ROUND_UP(part_stat_read(ns->bdev->bd_part,
|
|
|
+ sectors[WRITE]), 1000);
|
|
|
|
|
|
put_unaligned_le64(host_reads, &slog->host_reads[0]);
|
|
|
put_unaligned_le64(data_units_read, &slog->data_units_read[0]);
|
|
|
@@ -98,11 +100,11 @@ static u16 nvmet_get_smart_log_all(struct nvmet_req *req,
|
|
|
if (!ns->bdev)
|
|
|
continue;
|
|
|
host_reads += part_stat_read(ns->bdev->bd_part, ios[READ]);
|
|
|
- data_units_read +=
|
|
|
- part_stat_read(ns->bdev->bd_part, sectors[READ]);
|
|
|
+ data_units_read += DIV_ROUND_UP(
|
|
|
+ part_stat_read(ns->bdev->bd_part, sectors[READ]), 1000);
|
|
|
host_writes += part_stat_read(ns->bdev->bd_part, ios[WRITE]);
|
|
|
- data_units_written +=
|
|
|
- part_stat_read(ns->bdev->bd_part, sectors[WRITE]);
|
|
|
+ data_units_written += DIV_ROUND_UP(
|
|
|
+ part_stat_read(ns->bdev->bd_part, sectors[WRITE]), 1000);
|
|
|
|
|
|
}
|
|
|
rcu_read_unlock();
|