mirror of
https://gitee.com/openharmony/third_party_f2fs-tools
synced 2025-02-06 02:46:13 +00:00
mkfs: Make HDIO_GETGEO ioctl optional
Some block devices don't implement HDIO_GETGEP ioctl; loop device being a notable example. Without this patch, it's not possible to make a f2fs on a file mounted over a loop device. Signed-off-by: Ezequiel Garcia <ezequiel@free-electrons.com>
This commit is contained in:
parent
807776acbf
commit
07b815d395
@ -262,11 +262,10 @@ static int8_t f2fs_get_device_info()
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ioctl(fd, HDIO_GETGEO, &geom) < 0) {
|
||||
printf("\n\tError: Cannot get the device geometry\n");
|
||||
return -1;
|
||||
}
|
||||
f2fs_params.start_sector = geom.start;
|
||||
if (ioctl(fd, HDIO_GETGEO, &geom) < 0)
|
||||
f2fs_params.start_sector = 0;
|
||||
else
|
||||
f2fs_params.start_sector = geom.start;
|
||||
}
|
||||
else {
|
||||
printf("\n\n\tError: Volume type is not supported!!!\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user