From 9294197a50b16053776c39471120c9660c115460 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Tue, 25 Sep 2018 15:51:13 +1200 Subject: [PATCH 2/2] Remove dsm_resize() and dsm_remap(). An earlier commit disabled them in a way that is friendly to client code (if there is any), for back-branches. This commit removes them completely from future releases. Author: Thomas Munro Reviewed-by: Discussion: https://postgr.es/m/CAA4eK1%2B%3DyAFUvpFoHXFi_gm8YqmXN-TtkFH%2BVYjvDLS6-SFq-Q%40mail.gmail.com --- src/backend/storage/ipc/dsm.c | 20 -------------------- src/backend/storage/ipc/dsm_impl.c | 13 ------------- src/include/storage/dsm.h | 4 +--- src/include/storage/dsm_impl.h | 3 --- 4 files changed, 1 insertion(+), 39 deletions(-) diff --git a/src/backend/storage/ipc/dsm.c b/src/backend/storage/ipc/dsm.c index af1162c6e8..a81e4db435 100644 --- a/src/backend/storage/ipc/dsm.c +++ b/src/backend/storage/ipc/dsm.c @@ -653,26 +653,6 @@ dsm_detach_all(void) &dsm_control_mapped_size, ERROR); } -/* - * Resize an existing shared memory segment. - */ -void * -dsm_resize(dsm_segment *seg, Size size) -{ - elog(ERROR, "dsm_resize not supported"); - return NULL; -} - -/* - * Remap an existing shared memory segment. - */ -void * -dsm_remap(dsm_segment *seg) -{ - elog(ERROR, "dsm_remap not supported"); - return NULL; -} - /* * Detach from a shared memory segment, destroying the segment if we * remove the last reference. diff --git a/src/backend/storage/ipc/dsm_impl.c b/src/backend/storage/ipc/dsm_impl.c index fe581afffb..78154010aa 100644 --- a/src/backend/storage/ipc/dsm_impl.c +++ b/src/backend/storage/ipc/dsm_impl.c @@ -192,19 +192,6 @@ dsm_impl_op(dsm_op op, dsm_handle handle, Size request_size, } } -/* - * Previously we supported resizing DSM segments on some platforms. Since - * the work was never extended to all platforms so that it couldn't be relied - * on in general, and potential bugs were discovered on one one platform - * where we did support it, we decided to remove this. The interface will - * disappear completely in a later release. - */ -bool -dsm_impl_can_resize(void) -{ - return false; -} - #ifdef USE_DSM_POSIX /* * Operating system primitives to support POSIX shared memory. diff --git a/src/include/storage/dsm.h b/src/include/storage/dsm.h index 169de946f7..b4654cb5ca 100644 --- a/src/include/storage/dsm.h +++ b/src/include/storage/dsm.h @@ -33,11 +33,9 @@ extern void dsm_detach_all(void); extern void dsm_set_control_handle(dsm_handle h); #endif -/* Functions that create, update, or remove mappings. */ +/* Functions that create or remove mappings. */ extern dsm_segment *dsm_create(Size size, int flags); extern dsm_segment *dsm_attach(dsm_handle h); -extern void *dsm_resize(dsm_segment *seg, Size size); -extern void *dsm_remap(dsm_segment *seg); extern void dsm_detach(dsm_segment *seg); /* Resource management functions. */ diff --git a/src/include/storage/dsm_impl.h b/src/include/storage/dsm_impl.h index c8adc425fd..9485446c91 100644 --- a/src/include/storage/dsm_impl.h +++ b/src/include/storage/dsm_impl.h @@ -67,9 +67,6 @@ extern bool dsm_impl_op(dsm_op op, dsm_handle handle, Size request_size, void **impl_private, void **mapped_address, Size *mapped_size, int elevel); -/* Some implementations cannot resize segments. Can this one? */ -extern bool dsm_impl_can_resize(void); - /* Implementation-dependent actions required to keep segment until shutdown. */ extern void dsm_impl_pin_segment(dsm_handle handle, void *impl_private, void **impl_private_pm_handle); -- 2.17.0