• M
    block/raw-posix: Try both FIEMAP and SEEK_HOLE · 4f11aa8a
    Max Reitz 提交于
    The current version of raw-posix always uses ioctl(FS_IOC_FIEMAP) if
    FIEMAP is available; lseek with SEEK_HOLE/SEEK_DATA are not even
    compiled in in this case. However, there may be implementations which
    support the latter but not the former (e.g., NFSv4.2) as well as vice
    versa.
    
    To cover both cases, try FIEMAP first (as this will return -ENOTSUP if
    not supported instead of returning a failsafe value (everything
    allocated as a single extent)) and if that does not work, fall back to
    SEEK_HOLE/SEEK_DATA.
    Signed-off-by: NMax Reitz <mreitz@redhat.com>
    Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
    4f11aa8a
raw-posix.c 61.1 KB