mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
um: Use fdatasync() when mapping the UBD FSYNC command
We do not need to update the metadata (atime, mtime, etc) on the UBD file and/or the COW file until UML exits. UBD image mtime is checked in UML only when opening the files. After that they are locked and used exclusively by a single UML instance, so there is no point wasting resources on updating metadata on every sync. We can sync data only. The host will always update mtime if a file has been modified upon closing it. Signed-off-by: Anton Ivanov <anton.ivanov@cambridgegreys.com> Signed-off-by: Richard Weinberger <richard@nod.at>
This commit is contained in:
parent
0b86ce29cf
commit
54ebe4060f
@ -290,7 +290,7 @@ int os_write_file(int fd, const void *buf, int len)
|
||||
|
||||
int os_sync_file(int fd)
|
||||
{
|
||||
int n = fsync(fd);
|
||||
int n = fdatasync(fd);
|
||||
|
||||
if (n < 0)
|
||||
return -errno;
|
||||
|
Loading…
Reference in New Issue
Block a user