diff options
author | Keith Bostic <keith@wiredtiger.com> | 2016-03-26 18:09:32 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2016-03-26 18:09:32 -0400 |
commit | 9240bb3d52c4b0c724c78be268540bc12f54d3d2 (patch) | |
tree | 217ecbbd5cca713444434b6b6d5f86bf65c29d71 | |
parent | af008788393783f59d501bcb5c0b6465c5eb8a3b (diff) | |
download | mongo-9240bb3d52c4b0c724c78be268540bc12f54d3d2.tar.gz |
WT-2330: in-memory configurations should not create on-disk collection files
Remove Linux-specific preload and memory-mapping code from the block
manager.
Get rid of the block-manager calls to posix_fadvise(), support ENOTSUP
returns up the stack from the underlying support. General reworking of
block preload/discard code to stop attempts whenever ENOTSUP is return
on a handle.
Remove block manager handle open tests of cache-max and dirty-cache-max
configuration conflicts with specifying direct I/O, lacking posix_fadvise
and lacking sync_file_range. We can't know in the block manager what the
underlying layer can do, and also, the old code was wrong, direct I/O is
set on a file type basis, so testing against a specific handle open isn't
correct.
Inline the block-header-size function, we call it a lot and it's simply
returning a size.
-rw-r--r-- | dist/s_define.list | 1 | ||||
-rw-r--r-- | dist/s_string.ok | 3 | ||||
-rw-r--r-- | src/block/block_map.c | 8 | ||||
-rw-r--r-- | src/block/block_open.c | 29 | ||||
-rw-r--r-- | src/block/block_read.c | 72 | ||||
-rw-r--r-- | src/block/block_write.c | 56 | ||||
-rw-r--r-- | src/btree/bt_discard.c | 3 | ||||
-rw-r--r-- | src/include/block.h | 14 | ||||
-rw-r--r-- | src/include/extern.h | 7 | ||||
-rw-r--r-- | src/include/msvc.h | 11 | ||||
-rw-r--r-- | src/os_posix/os_inmemory.c | 2 | ||||
-rw-r--r-- | src/os_posix/os_map.c | 60 | ||||
-rw-r--r-- | src/os_posix/os_posix.c | 19 | ||||
-rw-r--r-- | src/os_win/os_map.c | 12 | ||||
-rw-r--r-- | src/os_win/os_win.c | 6 |
15 files changed, 181 insertions, 122 deletions
diff --git a/dist/s_define.list b/dist/s_define.list index e3f0dc7f181..c9777c86675 100644 --- a/dist/s_define.list +++ b/dist/s_define.list @@ -16,6 +16,7 @@ WIN32_LEAN_AND_MEAN WT_ATOMIC_CAS WT_ATOMIC_FUNC WT_BLOCK_DESC_SIZE +WT_BLOCK_HEADER_SIZE WT_CACHE_LINE_ALIGNMENT WT_COMPILER_TYPE_ALIGN WT_CONN_CHECK_PANIC diff --git a/dist/s_string.ok b/dist/s_string.ok index 17b5d54c7a1..ba826339b9f 100644 --- a/dist/s_string.ok +++ b/dist/s_string.ok @@ -77,6 +77,7 @@ DESC DHANDLE DNE DOI +DONTNEED DUPLICATEV DbCursor DbEnv @@ -189,6 +190,7 @@ LoadLoad LockFile Lookaside Lookup +MADV MALLOC MEM MEMALIGN @@ -338,6 +340,7 @@ Vixie Vo VxWorks WAL +WILLNEED WIREDTIGER WRLSN WRNOLOCK diff --git a/src/block/block_map.c b/src/block/block_map.c index b60623a37d8..c21ca9cfa19 100644 --- a/src/block/block_map.c +++ b/src/block/block_map.c @@ -42,14 +42,6 @@ __wt_block_map( return (0); /* - * Turn off mapping when direct I/O is configured for the file, the - * Linux open(2) documentation says applications should avoid mixing - * mmap(2) of files with direct I/O to the same files. - */ - if (block->fh->direct_io) - return (0); - - /* * Turn off mapping if the application configured a cache size maximum, * we can't control how much of the cache size we use in that case. */ diff --git a/src/block/block_open.c b/src/block/block_open.c index fd0e60bba45..0fef6ad0e66 100644 --- a/src/block/block_open.c +++ b/src/block/block_open.c @@ -196,36 +196,10 @@ __wt_block_open(WT_SESSION_IMPL *session, /* Configuration: optional OS buffer cache maximum size. */ WT_ERR(__wt_config_gets(session, cfg, "os_cache_max", &cval)); block->os_cache_max = (size_t)cval.val; -#ifdef HAVE_POSIX_FADVISE - if (conn->direct_io && block->os_cache_max) - WT_ERR_MSG(session, EINVAL, - "os_cache_max not supported in combination with direct_io"); -#else - if (block->os_cache_max) - WT_ERR_MSG(session, EINVAL, - "os_cache_max not supported if posix_fadvise not " - "available"); -#endif /* Configuration: optional immediate write scheduling flag. */ WT_ERR(__wt_config_gets(session, cfg, "os_cache_dirty_max", &cval)); block->os_cache_dirty_max = (size_t)cval.val; -#ifdef HAVE_SYNC_FILE_RANGE - if (conn->direct_io && block->os_cache_dirty_max) - WT_ERR_MSG(session, EINVAL, - "os_cache_dirty_max not supported in combination with " - "direct_io"); -#else - if (block->os_cache_dirty_max) { - /* - * Ignore any setting if it is not supported. - */ - block->os_cache_dirty_max = 0; - WT_ERR(__wt_verbose(session, WT_VERB_BLOCK, - "os_cache_dirty_max ignored when sync_file_range not " - "available")); - } -#endif /* Open the underlying file handle. */ WT_ERR(__wt_open(session, filename, WT_FILE_TYPE_DATA, 0, &block->fh)); @@ -236,6 +210,9 @@ __wt_block_open(WT_SESSION_IMPL *session, /* Set the file extension information. */ block->extend_len = conn->data_extend_len; + /* Set the preload availability. */ + block->preload_available = true; + /* Initialize the live checkpoint's lock. */ WT_ERR(__wt_spin_init(session, &block->live_lock, "block manager")); diff --git a/src/block/block_read.c b/src/block/block_read.c index 9386974238d..d0522e155fc 100644 --- a/src/block/block_read.c +++ b/src/block/block_read.c @@ -26,33 +26,41 @@ __wt_bm_preload( WT_UNUSED(addr_size); block = bm->block; - /* - * Turn off pre-load when direct I/O is configured for the file, - * the kernel cache isn't interesting. - */ - if (block->fh->direct_io) - return (0); - WT_STAT_FAST_CONN_INCR(session, block_preload); - /* Crack the cookie. */ - WT_RET(__wt_block_buffer_to_addr(block, addr, &offset, &size, &cksum)); - - /* Check for a mapped block. */ - mapped = bm->map != NULL && offset + size <= (wt_off_t)bm->maplen; - if (mapped) - return (__wt_mmap_preload( - session, (uint8_t *)bm->map + offset, size)); + /* Preload the block. */ + if (block->preload_available) { + /* Crack the cookie. */ + WT_RET(__wt_block_buffer_to_addr( + block, addr, &offset, &size, &cksum)); + + mapped = bm->map != NULL && + offset + size <= (wt_off_t)bm->maplen; + if (mapped) + ret = __wt_mmap_preload(session, + block->fh, (uint8_t *)bm->map + offset, size); + else + ret = __wt_posix_fadvise(session, + block->fh, (wt_off_t)offset, + (wt_off_t)size, POSIX_FADV_WILLNEED); + if (ret == 0) + return (0); -#ifdef HAVE_POSIX_FADVISE - if (__wt_posix_fadvise(session, block->fh, - (wt_off_t)offset, (wt_off_t)size, POSIX_FADV_WILLNEED) == 0) - return (0); -#endif + /* Ignore ENOTSUP, but don't try again. */ + if (ret != ENOTSUP) + return (ret); + block->preload_available = false; + } - WT_RET(__wt_scr_alloc(session, size, &tmp)); - ret = __wt_block_read_off(session, block, tmp, offset, size, cksum); + /* + * If preload isn't supported, do it the slow way; don't call the + * underlying read routine directly, we don't know for certain if + * this is a mapped range. + */ + WT_RET(__wt_scr_alloc(session, 0, &tmp)); + ret = __wt_bm_read(bm, session, tmp, addr, addr_size); __wt_scr_free(session, &tmp); + return (ret); } @@ -82,7 +90,9 @@ __wt_bm_read(WT_BM *bm, WT_SESSION_IMPL *session, if (mapped) { buf->data = (uint8_t *)bm->map + offset; buf->size = size; - WT_RET(__wt_mmap_preload(session, buf->data, buf->size)); + if (block->preload_available) + WT_RET(__wt_mmap_preload( + session, block->fh, buf->data, buf->size)); WT_STAT_FAST_CONN_INCR(session, block_map_read); WT_STAT_FAST_CONN_INCRV(session, block_byte_map_read, size); @@ -100,21 +110,9 @@ __wt_bm_read(WT_BM *bm, WT_SESSION_IMPL *session, /* Read the block. */ WT_RET(__wt_block_read_off(session, block, buf, offset, size, cksum)); -#ifdef HAVE_POSIX_FADVISE /* Optionally discard blocks from the system's buffer cache. */ - if (block->os_cache_max != 0 && - (block->os_cache += size) > block->os_cache_max) { - WT_DECL_RET; - - block->os_cache = 0; - /* Ignore EINVAL - some file systems don't support the flag. */ - if ((ret = __wt_posix_fadvise(session, block->fh, - (wt_off_t)0, (wt_off_t)0, POSIX_FADV_DONTNEED)) != 0 && - ret != EINVAL) - WT_RET_MSG( - session, ret, "%s: posix_fadvise", block->name); - } -#endif + WT_RET(__wt_block_discard(session, block, (size_t)size)); + return (0); } diff --git a/src/block/block_write.c b/src/block/block_write.c index a56893aee23..d6599d81a8e 100644 --- a/src/block/block_write.c +++ b/src/block/block_write.c @@ -9,28 +9,47 @@ #include "wt_internal.h" /* - * __wt_block_header -- - * Return the size of the block-specific header. + * __wt_block_truncate -- + * Truncate the file. */ -u_int -__wt_block_header(WT_BLOCK *block) +int +__wt_block_truncate(WT_SESSION_IMPL *session, WT_BLOCK *block, wt_off_t len) { - WT_UNUSED(block); + WT_RET(__wt_ftruncate(session, block->fh, len)); + + block->size = block->extend_size = len; - return ((u_int)WT_BLOCK_HEADER_SIZE); + return (0); } /* - * __wt_block_truncate -- - * Truncate the file. + * __wt_block_discard -- + * Discard blocks from the system buffer cache. */ int -__wt_block_truncate(WT_SESSION_IMPL *session, WT_BLOCK *block, wt_off_t len) +__wt_block_discard(WT_SESSION_IMPL *session, WT_BLOCK *block, size_t added_size) { - WT_RET(__wt_ftruncate(session, block->fh, len)); + WT_DECL_RET; - block->size = block->extend_size = len; + if (block->os_cache_max == 0) + return (0); + + /* + * We're racing on the addition, but I'm not willing to serialize on it + * in the standard read path with more evidence it's needed. + */ + if ((block->os_cache += added_size) <= block->os_cache_max) + return (0); + block->os_cache = 0; + WT_ERR(__wt_posix_fadvise(session, block->fh, + (wt_off_t)0, (wt_off_t)0, POSIX_FADV_DONTNEED)); + return (0); + +err: /* Ignore ENOTSUP, but don't try again. */ + if (ret != ENOTSUP) + return (ret); + block->os_cache_max = 0; return (0); } @@ -330,17 +349,10 @@ __wt_block_write_off(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_RET(__wt_fsync(session, fh, false)); } #endif -#ifdef HAVE_POSIX_FADVISE - /* Optionally discard blocks from the system buffer cache. */ - if (block->os_cache_max != 0 && - (block->os_cache += align_size) > block->os_cache_max) { - block->os_cache = 0; - if ((ret = __wt_posix_fadvise(session, fh, - (wt_off_t)0, (wt_off_t)0, POSIX_FADV_DONTNEED)) != 0) - WT_RET_MSG( - session, ret, "%s: posix_fadvise", block->name); - } -#endif + + /* Optionally discard blocks from the buffer cache. */ + WT_RET(__wt_block_discard(session, block, align_size)); + WT_STAT_FAST_CONN_INCR(session, block_write); WT_STAT_FAST_CONN_INCRV(session, block_byte_write, align_size); diff --git a/src/btree/bt_discard.c b/src/btree/bt_discard.c index 1f739c9572e..5983c7e4f18 100644 --- a/src/btree/bt_discard.c +++ b/src/btree/bt_discard.c @@ -134,7 +134,8 @@ __wt_page_out(WT_SESSION_IMPL *session, WT_PAGE **pagep) if (F_ISSET_ATOMIC(page, WT_PAGE_DISK_ALLOC)) __wt_overwrite_and_free_len(session, dsk, dsk->mem_size); if (F_ISSET_ATOMIC(page, WT_PAGE_DISK_MAPPED)) - (void)__wt_mmap_discard(session, dsk, dsk->mem_size); + (void)__wt_mmap_discard( + session, S2BT(session)->bm->block->fh, dsk, dsk->mem_size); __wt_overwrite_and_free(session, page); } diff --git a/src/include/block.h b/src/include/block.h index cdcf82cde11..76891e1e5f6 100644 --- a/src/include/block.h +++ b/src/include/block.h @@ -222,9 +222,9 @@ struct __wt_block { WT_FH *fh; /* Backing file handle */ wt_off_t size; /* File size */ - wt_off_t extend_size; /* File extended size */ wt_off_t extend_len; /* File extend chunk size */ + bool preload_available; /* File pages can be preloaded. */ /* Configuration information, set when the file is opened. */ uint32_t allocfirst; /* Allocation is first-fit */ @@ -404,3 +404,15 @@ __wt_block_header_byteswap(WT_BLOCK_HEADER *blk) */ #define WT_BLOCK_COMPRESS_SKIP 64 #define WT_BLOCK_ENCRYPT_SKIP WT_BLOCK_HEADER_BYTE_SIZE + +/* + * __wt_block_header -- + * Return the size of the block-specific header. + */ +static inline u_int +__wt_block_header(WT_BLOCK *block) +{ + WT_UNUSED(block); + + return ((u_int)WT_BLOCK_HEADER_SIZE); +} diff --git a/src/include/extern.h b/src/include/extern.h index 02bcb863b20..ca3f19c14f1 100644 --- a/src/include/extern.h +++ b/src/include/extern.h @@ -73,8 +73,8 @@ extern int __wt_block_verify_end(WT_SESSION_IMPL *session, WT_BLOCK *block); extern int __wt_verify_ckpt_load( WT_SESSION_IMPL *session, WT_BLOCK *block, WT_BLOCK_CKPT *ci); extern int __wt_verify_ckpt_unload(WT_SESSION_IMPL *session, WT_BLOCK *block); extern int __wt_block_verify_addr(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size); -extern u_int __wt_block_header(WT_BLOCK *block); extern int __wt_block_truncate(WT_SESSION_IMPL *session, WT_BLOCK *block, wt_off_t len); +extern int __wt_block_discard(WT_SESSION_IMPL *session, WT_BLOCK *block, size_t added_size); extern int __wt_block_write_size(WT_SESSION_IMPL *session, WT_BLOCK *block, size_t *sizep); extern int __wt_block_write(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, uint8_t *addr, size_t *addr_sizep, bool data_cksum); extern int __wt_block_write_off(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, wt_off_t *offsetp, uint32_t *sizep, uint32_t *cksump, bool data_cksum, bool caller_locked); @@ -741,8 +741,9 @@ extern int __wt_getopt( const char *progname, int nargc, char *const *nargv, con extern int __wt_malloc(WT_SESSION_IMPL *session, size_t bytes_to_allocate, void *retp); extern int __wt_map_error_rdonly(int error); extern int __wt_mmap(WT_SESSION_IMPL *session, WT_FH *fh, void *mapp, size_t *lenp, void **mappingcookie); -extern int __wt_mmap_discard(WT_SESSION_IMPL *session, void *p, size_t size); -extern int __wt_mmap_preload(WT_SESSION_IMPL *session, const void *p, size_t size); +extern int __wt_mmap_discard(WT_SESSION_IMPL *session, WT_FH *fh, void *p, size_t size); +extern int __wt_mmap_preload( WT_SESSION_IMPL *session, WT_FH *fh, const void *p, size_t size); +extern int __wt_mmap_preload_madvise( WT_SESSION_IMPL *session, WT_FH *fh, const void *p, size_t size); extern int __wt_munmap(WT_SESSION_IMPL *session, WT_FH *fh, void *map, size_t len, void **mappingcookie); extern int __wt_once(void (*init_routine)(void)); extern int __wt_open(WT_SESSION_IMPL *session, const char *name, uint32_t file_type, uint32_t flags, WT_FH **fhp); diff --git a/src/include/msvc.h b/src/include/msvc.h index d5be5bd8c60..222c24c3bc6 100644 --- a/src/include/msvc.h +++ b/src/include/msvc.h @@ -17,6 +17,17 @@ #define WT_SIZET_FMT "Iu" /* size_t format string */ /* + * The Windows fadvise calls will return ENOTSUP, but the WiredTiger code + * currently uses POSIX flags in the API. + */ +#ifndef POSIX_FADV_DONTNEED +#define POSIX_FADV_DONTNEED 0 +#endif +#ifndef POSIX_FADV_WILLNEED +#define POSIX_FADV_WILLNEED 0 +#endif + +/* * Add MSVC-specific attributes and pragmas to types and function declarations. */ #define WT_COMPILER_TYPE_ALIGN(x) __declspec(align(x)) diff --git a/src/os_posix/os_inmemory.c b/src/os_posix/os_inmemory.c index 3ca1e99378b..4d5b35e1499 100644 --- a/src/os_posix/os_inmemory.c +++ b/src/os_posix/os_inmemory.c @@ -173,7 +173,7 @@ __im_handle_advise(WT_SESSION_IMPL *session, WT_UNUSED(offset); WT_UNUSED(len); WT_UNUSED(advice); - return (0); + return (ENOTSUP); } /* diff --git a/src/os_posix/os_map.c b/src/os_posix/os_map.c index 03daba698a8..bb0757d1595 100644 --- a/src/os_posix/os_map.c +++ b/src/os_posix/os_map.c @@ -25,6 +25,14 @@ __wt_mmap(WT_SESSION_IMPL *session, WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_IN_MEMORY)); /* + * Mapping isn't possible if direct I/O configured for the file, the + * Linux open(2) documentation says applications should avoid mixing + * mmap(2) of files with direct I/O to the same files. + */ + if (fh->direct_io) + return (ENOTSUP); + + /* * There's no locking here to prevent the underlying file from changing * underneath us, our caller needs to ensure consistency of the mapped * region vs. any other file activity. @@ -51,24 +59,24 @@ __wt_mmap(WT_SESSION_IMPL *session, return (0); } +#ifdef HAVE_POSIX_MADVISE /* - * __wt_mmap_preload -- + * __wt_mmap_preload_madvise -- * Cause a section of a memory map to be faulted in. */ int -__wt_mmap_preload(WT_SESSION_IMPL *session, const void *p, size_t size) +__wt_mmap_preload_madvise( + WT_SESSION_IMPL *session, WT_FH *fh, const void *p, size_t size) { -#ifdef HAVE_POSIX_MADVISE - /* Linux requires the address be aligned to a 4KB boundary. */ WT_BM *bm; WT_CONNECTION_IMPL *conn; WT_DECL_RET; void *blk; - WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_IN_MEMORY)); - conn = S2C(session); bm = S2BT(session)->bm; + + /* Linux requires the address be aligned to a 4KB boundary. */ blk = (void *)((uintptr_t)p & ~(uintptr_t)(conn->page_size - 1)); size += WT_PTRDIFF(p, blk); @@ -90,14 +98,30 @@ __wt_mmap_preload(WT_SESSION_IMPL *session, const void *p, size_t size) if (size > (size_t)conn->page_size && (ret = posix_madvise(blk, size, POSIX_MADV_WILLNEED)) != 0) - WT_RET_MSG(session, ret, "posix_madvise will need"); + WT_RET_MSG(session, ret, + "%s: posix_madvise: POSIX_MADV_WILLNEED", fh->name); + return (0); +} +#endif + +/* + * __wt_mmap_preload -- + * Cause a section of a memory map to be faulted in. + */ +int +__wt_mmap_preload( + WT_SESSION_IMPL *session, WT_FH *fh, const void *p, size_t size) +{ + WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_IN_MEMORY)); + +#ifdef HAVE_POSIX_MADVISE + return (__wt_mmap_preload_madvise(session, fh, p, size)); #else - WT_UNUSED(session); + WT_UNUSED(fh); WT_UNUSED(p); WT_UNUSED(size); + return (ENOTSUP); #endif - - return (0); } /* @@ -105,28 +129,30 @@ __wt_mmap_preload(WT_SESSION_IMPL *session, const void *p, size_t size) * Discard a chunk of the memory map. */ int -__wt_mmap_discard(WT_SESSION_IMPL *session, void *p, size_t size) +__wt_mmap_discard(WT_SESSION_IMPL *session, WT_FH *fh, void *p, size_t size) { + WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_IN_MEMORY)); + #ifdef HAVE_POSIX_MADVISE - /* Linux requires the address be aligned to a 4KB boundary. */ WT_CONNECTION_IMPL *conn; WT_DECL_RET; void *blk; - WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_IN_MEMORY)); - conn = S2C(session); + + /* Linux requires the address be aligned to a 4KB boundary. */ blk = (void *)((uintptr_t)p & ~(uintptr_t)(conn->page_size - 1)); size += WT_PTRDIFF(p, blk); if ((ret = posix_madvise(blk, size, POSIX_MADV_DONTNEED)) != 0) - WT_RET_MSG(session, ret, "posix_madvise don't need"); + WT_RET_MSG(session, ret, + "%s: posix_madvise: POSIX_MADV_DONTNEED", fh->name); #else - WT_UNUSED(session); + WT_UNUSED(fh); WT_UNUSED(p); WT_UNUSED(size); #endif - return (0); + return (ENOTSUP); } /* diff --git a/src/os_posix/os_posix.c b/src/os_posix/os_posix.c index c6c03ca7502..a89cf13a760 100644 --- a/src/os_posix/os_posix.c +++ b/src/os_posix/os_posix.c @@ -247,9 +247,24 @@ __posix_handle_advise(WT_SESSION_IMPL *session, #if defined(HAVE_POSIX_FADVISE) WT_DECL_RET; + /* + * Refuse pre-load when direct I/O is configured for the file, the + * kernel cache isn't interesting. + */ + if (advice == POSIX_MADV_WILLNEED && fh->direct_io) + return (ENOTSUP); + WT_SYSCALL_RETRY(posix_fadvise(fh->fd, offset, len, advice), ret); if (ret == 0) return (0); + + /* + * Treat EINVAL as not-supported, some systems don't support some flags. + * Quietly fail, callers expect not-supported failures. + */ + if (ret == EINVAL) + return (ENOTSUP); + WT_RET_MSG(session, ret, "%s: handle-advise: posix_fadvise", fh->name); #else WT_UNUSED(session); @@ -257,7 +272,9 @@ __posix_handle_advise(WT_SESSION_IMPL *session, WT_UNUSED(offset); WT_UNUSED(len); WT_UNUSED(advice); - return (0); + + /* Quietly fail, callers expect not-supported failures. */ + return (ENOTSUP); #endif } diff --git a/src/os_win/os_map.c b/src/os_win/os_map.c index 74fb3c4ecb4..b56929ce0e5 100644 --- a/src/os_win/os_map.c +++ b/src/os_win/os_map.c @@ -59,13 +59,15 @@ __wt_mmap(WT_SESSION_IMPL *session, * Cause a section of a memory map to be faulted in. */ int -__wt_mmap_preload(WT_SESSION_IMPL *session, const void *p, size_t size) +__wt_mmap_preload( + WT_SESSION_IMPL *session, WT_FH *fh, const void *p, size_t size) { WT_UNUSED(session); + WT_UNUSED(fh); WT_UNUSED(p); WT_UNUSED(size); - return (0); + return (ENOTSUP); } /* @@ -73,12 +75,14 @@ __wt_mmap_preload(WT_SESSION_IMPL *session, const void *p, size_t size) * Discard a chunk of the memory map. */ int -__wt_mmap_discard(WT_SESSION_IMPL *session, void *p, size_t size) +__wt_mmap_discard(WT_SESSION_IMPL *session, WT_FH *fh, void *p, size_t size) { WT_UNUSED(session); + WT_UNUSED(fh); WT_UNUSED(p); WT_UNUSED(size); - return (0); + + return (ENOTSUP); } /* diff --git a/src/os_win/os_win.c b/src/os_win/os_win.c index 88ca187ae4b..3d7a71deb03 100644 --- a/src/os_win/os_win.c +++ b/src/os_win/os_win.c @@ -162,10 +162,14 @@ static int __win_handle_advise(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset, wt_off_t len, int advice) { + WT_UNUSED(session); + WT_UNUSED(fh); WT_UNUSED(offset); WT_UNUSED(len); WT_UNUSED(advice); - WT_RET_MSG(session, ENOTSUP, "%s: handle-advise", fh->name); + + /* Quietly fail, callers expect not-supported failures. */ + return (ENOTSUP); } /* |