Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6057c21

Browse files
committed
"Pin", rather than "keep", dynamic shared memory mappings and segments.
Nobody seemed concerned about this naming when it originally went in,but there's a pending patch that implements the opposite ofdsm_keep_mapping, and the term "unkeep" was judged unpalatable."unpin" has existing precedent in the PostgreSQL code base, and theEnglish language, so use this terminology instead.Per discussion, back-patch to 9.4.
1 parent7912f9b commit6057c21

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

‎src/backend/storage/ipc/dsm.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* facilities provided by dsm_impl.h and dsm_impl.c, mappings and segments
99
* created using this module will be cleaned up automatically. Mappings
1010
* will be removed when the resource owner under which they were created
11-
* is cleaned up, unlessdsm_keep_mapping() is used, in which case they
11+
* is cleaned up, unlessdsm_pin_mapping() is used, in which case they
1212
* have session lifespan. Segments will be removed when there are no
1313
* remaining mappings, or at postmaster shutdown in any case. After a
1414
* hard postmaster crash, remaining segments will be removed, if they
@@ -786,7 +786,7 @@ dsm_detach(dsm_segment *seg)
786786
* only.
787787
*/
788788
void
789-
dsm_keep_mapping(dsm_segment*seg)
789+
dsm_pin_mapping(dsm_segment*seg)
790790
{
791791
if (seg->resowner!=NULL)
792792
{
@@ -804,11 +804,11 @@ dsm_keep_mapping(dsm_segment *seg)
804804
*
805805
* Note that this function does not arrange for the current process to
806806
* keep the segment mapped indefinitely; if that behavior is desired,
807-
*dsm_keep_mapping() should be used from each process that needs to
807+
*dsm_pin_mapping() should be used from each process that needs to
808808
* retain the mapping.
809809
*/
810810
void
811-
dsm_keep_segment(dsm_segment*seg)
811+
dsm_pin_segment(dsm_segment*seg)
812812
{
813813
/*
814814
* Bump reference count for this segment in shared memory. This will
@@ -819,7 +819,7 @@ dsm_keep_segment(dsm_segment *seg)
819819
dsm_control->item[seg->control_slot].refcnt++;
820820
LWLockRelease(DynamicSharedMemoryControlLock);
821821

822-
dsm_impl_keep_segment(seg->handle,seg->impl_private);
822+
dsm_impl_pin_segment(seg->handle,seg->impl_private);
823823
}
824824

825825
/*

‎src/backend/storage/ipc/dsm_impl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ dsm_impl_mmap(dsm_op op, dsm_handle handle, Size request_size,
996996
* do anything to receive the handle; Windows transfers it automatically.
997997
*/
998998
void
999-
dsm_impl_keep_segment(dsm_handlehandle,void*impl_private)
999+
dsm_impl_pin_segment(dsm_handlehandle,void*impl_private)
10001000
{
10011001
switch (dynamic_shared_memory_type)
10021002
{

‎src/include/storage/dsm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ extern void *dsm_remap(dsm_segment *seg);
3636
externvoiddsm_detach(dsm_segment*seg);
3737

3838
/* Resource management functions. */
39-
externvoiddsm_keep_mapping(dsm_segment*seg);
40-
externvoiddsm_keep_segment(dsm_segment*seg);
39+
externvoiddsm_pin_mapping(dsm_segment*seg);
40+
externvoiddsm_pin_segment(dsm_segment*seg);
4141
externdsm_segment*dsm_find_mapping(dsm_handleh);
4242

4343
/* Informational functions. */

‎src/include/storage/dsm_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ extern bool dsm_impl_op(dsm_op op, dsm_handle handle, Size request_size,
7373
externbooldsm_impl_can_resize(void);
7474

7575
/* Implementation-dependent actions required to keep segment until shudown. */
76-
externvoiddsm_impl_keep_segment(dsm_handlehandle,void*impl_private);
76+
externvoiddsm_impl_pin_segment(dsm_handlehandle,void*impl_private);
7777

7878
#endif/* DSM_IMPL_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp