X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;ds=sidebyside;f=os%2Fos-windows.h;h=9edacf335090882d82e53201b01e8cec1bb2b28b;hb=9b8365618309572d8fd2579c8ea3132db89f843f;hp=74c0f9e8e6cb63e07857206e11a81be8bdd006ad;hpb=ecc314ba7c5f02b7e90ac1dfbce1a74cd4e6d6fe;p=fio.git diff --git a/os/os-windows.h b/os/os-windows.h index 74c0f9e8..9edacf33 100644 --- a/os/os-windows.h +++ b/os/os-windows.h @@ -1,7 +1,6 @@ #ifndef FIO_OS_WINDOWS_H #define FIO_OS_WINDOWS_H - #include #include #include @@ -37,8 +36,8 @@ static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes) HANDLE hFile; if (f->hFile == NULL) { - hFile = CreateFile(f->file_name, (GENERIC_READ | GENERIC_WRITE), - (FILE_SHARE_READ | FILE_SHARE_WRITE), NULL, OPEN_EXISTING, 0, NULL); + hFile = CreateFile(f->file_name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, 0, NULL); } else { hFile = f->hFile; } @@ -51,7 +50,6 @@ static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes) *bytes = info.Length.QuadPart; else rc = EIO; - } /* If we were passed a POSIX fd, * close the HANDLE we created via CreateFile */ @@ -66,14 +64,10 @@ static inline int chardev_size(struct fio_file *f, unsigned long long *bytes) return blockdev_size(f, bytes); } -{ - static inline int blockdev_invalidate_cache(struct fio_file *f) { - BOOL bSuccess = FlushFileBuffers(f->hFile); - if (!bSuccess) - log_info("blockdev_invalidate_cache - FlushFileBuffers failed\n"); - + /* There's no way to invalidate the cache in Windows + * so just pretend to succeed */ return 0; } @@ -95,5 +89,4 @@ static inline void os_get_tmpdir(char *path, int len) #define FIO_MADV_FREE MADV_FREE #endif - #endif /* FIO_OS_WINDOWS_H */