]>
git.proxmox.com Git - ceph.git/blob - ceph/src/pmdk/src/libpmem2/persist_windows.c
1 // SPDX-License-Identifier: BSD-3-Clause
2 /* Copyright 2019-2020, Intel Corporation */
5 * persist_windows.c -- Windows-specific part of persist implementation
13 #include "pmem2_utils.h"
16 * pmem2_flush_file_buffers_os -- flush CPU and OS file caches for the given
20 pmem2_flush_file_buffers_os(struct pmem2_map
*map
, const void *addr
, size_t len
,
23 ASSERTeq(map
->source
.type
, PMEM2_SOURCE_HANDLE
);
25 if (FlushViewOfFile(addr
, len
) == FALSE
) {
26 ERR("!!FlushViewOfFile");
27 return pmem2_lasterror_to_err();
30 if (FlushFileBuffers(map
->source
.value
.handle
) == FALSE
) {
31 ERR("!!FlushFileBuffers");
32 return pmem2_lasterror_to_err();