diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2021-04-14 19:52:26 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-06-25 10:54:13 +0200 |
commit | 18473467d55a20d643b6c9b3a52de42f705b4d35 (patch) | |
tree | c24a98cb7bafaacc30695d5d274df0de24433547 /block/copy-on-read.c | |
parent | 24b36e9813ec15da7db62e3b3621730710c5f020 (diff) |
file-posix: try BLKSECTGET on block devices too, do not round to power of 2
bs->sg is only true for character devices, but block devices can also
be used with scsi-block and scsi-generic. Unfortunately BLKSECTGET
returns bytes in an int for /dev/sgN devices, and sectors in a short
for block devices, so account for that in the code.
The maximum transfer also need not be a power of 2 (for example I have
seen disks with 1280 KiB maximum transfer) so there's no need to pass
the result through pow2floor.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'block/copy-on-read.c')
0 files changed, 0 insertions, 0 deletions