mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
block: use fdatasync instead of fsync if possible
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: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
e900a7b748
commit
6f1953c4c1
4 changed files with 19 additions and 2 deletions
|
@ -114,6 +114,7 @@ int stristart(const char *str, const char *val, const char **ptr);
|
|||
int qemu_strnlen(const char *s, int max_len);
|
||||
time_t mktimegm(struct tm *tm);
|
||||
int qemu_fls(int i);
|
||||
int qemu_fdatasync(int fd);
|
||||
|
||||
/* path.c */
|
||||
void init_paths(const char *prefix);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue