Skip to content
  • Christoph Hellwig's avatar
    block: use fdatasync instead of fsync if possible · 6f1953c4
    Christoph Hellwig authored
    
    
    If we are flushing the caches for our image files we only care about the
    data (including the metadata required for accessing it) but not things
    like timestamp updates.  So try to use fdatasync instead of fsync to
    implement the flush operations.
    
    Unfortunately many operating systems still do not support fdatasync,
    so we add a qemu_fdatasync wrapper that uses fdatasync if available
    as per the _POSIX_SYNCHRONIZED_IO feature macro or fsync otherwise.
    
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
    6f1953c4