You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/*
* We couldn't figure it out by using a specialized ioctl,
* so do binary search to find the size of the device.
*/
low = 0LL;
for (high = 1024LL; !ntfs_device_offset_valid(dev, high); high <<= 1)
low = high;
while (low < high - 1LL) {
const s64 mid = (low + high) / 2;
if (!ntfs_device_offset_valid(dev, mid))
low = mid;
else
high = mid;
}
dev->d_ops->seek(dev, 0LL, SEEK_SET);
For calculation size of device if passed file instead of device (https://github.com/tuxera/ntfs-3g/blob/edge/libntfs-3g/device.c#L599):
But there is IO callback stat(https://github.com/tuxera/ntfs-3g/blob/edge/include/ntfs-3g/device.h#L113) whose contains size of file.
So we can call this callback for avoid count of random read.
The text was updated successfully, but these errors were encountered: