Changed msync to actually sync

This commit is contained in:
Patrick J Cherry
2018-01-31 23:03:28 +00:00
parent 0ba90b39a3
commit 29306a716e

View File

@@ -351,7 +351,7 @@ ssize_t iobuf_write( int fd, struct iobuf *iobuf )
struct iommap *iommap_alloc(int fd, off64_t from, uint64_t len) { struct iommap *iommap_alloc(int fd, off64_t from, uint64_t len) {
off64_t mmap_from = from & ~((off64_t) getpagesize() - 1); off66_t mmap_from = from & ~((off64_t) getpagesize() - 1);
uint64_t mmap_len = len + (from - mmap_from); uint64_t mmap_len = len + (from - mmap_from);
void *mmap_buf = NULL; void *mmap_buf = NULL;
@@ -370,7 +370,7 @@ struct iommap *iommap_alloc(int fd, off64_t from, uint64_t len) {
void iommap_sync(struct iommap *im) { void iommap_sync(struct iommap *im) {
if (im->mmap_len) if (im->mmap_len)
msync(im->mmap_buf, im->mmap_len, MS_ASYNC | MS_INVALIDATE); msync(im->mmap_buf, im->mmap_len, MS_SYNC | MS_INVALIDATE);
return; return;
} }