mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
Remove dsm_resize() and dsm_remap().
These interfaces were never used in core, didn't handle failure of posix_fallocate() correctly and weren't supported on all platforms. We agreed to remove them in 12. Author: Thomas Munro Reported-by: Andres Freund Discussion: https://postgr.es/m/CAA4eK1%2B%3DyAFUvpFoHXFi_gm8YqmXN-TtkFH%2BVYjvDLS6-SFq-Q%40mail.gmail.com
This commit is contained in:
@@ -653,38 +653,6 @@ dsm_detach_all(void)
|
||||
&dsm_control_mapped_size, ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
* Resize an existing shared memory segment.
|
||||
*
|
||||
* This may cause the shared memory segment to be remapped at a different
|
||||
* address. For the caller's convenience, we return the mapped address.
|
||||
*/
|
||||
void *
|
||||
dsm_resize(dsm_segment *seg, Size size)
|
||||
{
|
||||
Assert(seg->control_slot != INVALID_CONTROL_SLOT);
|
||||
dsm_impl_op(DSM_OP_RESIZE, seg->handle, size, &seg->impl_private,
|
||||
&seg->mapped_address, &seg->mapped_size, ERROR);
|
||||
return seg->mapped_address;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remap an existing shared memory segment.
|
||||
*
|
||||
* This is intended to be used when some other process has extended the
|
||||
* mapping using dsm_resize(), but we've still only got the initial
|
||||
* portion mapped. Since this might change the address at which the
|
||||
* segment is mapped, we return the new mapped address.
|
||||
*/
|
||||
void *
|
||||
dsm_remap(dsm_segment *seg)
|
||||
{
|
||||
dsm_impl_op(DSM_OP_ATTACH, seg->handle, 0, &seg->impl_private,
|
||||
&seg->mapped_address, &seg->mapped_size, ERROR);
|
||||
|
||||
return seg->mapped_address;
|
||||
}
|
||||
|
||||
/*
|
||||
* Detach from a shared memory segment, destroying the segment if we
|
||||
* remove the last reference.
|
||||
|
||||
Reference in New Issue
Block a user