mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-23 23:45:20 +00:00
btrfs-progs: zoned: replace raw ioctl with a helper for device size
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
600d2dba6f
commit
aa56bf3a31
@ -281,8 +281,9 @@ static int report_zones(int fd, const char *file,
|
|||||||
* No need to use btrfs_device_size() here, since it is ensured
|
* No need to use btrfs_device_size() here, since it is ensured
|
||||||
* that the file is block device.
|
* that the file is block device.
|
||||||
*/
|
*/
|
||||||
if (ioctl(fd, BLKGETSIZE64, &device_size) < 0) {
|
device_size = device_get_partition_size_fd(fd);
|
||||||
error("zoned: ioctl(BLKGETSIZE64) failed on %s (%m)", file);
|
if (device_size == 0) {
|
||||||
|
error("zoned: failed to read size of %s: %m", file);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user