postgresql/src/include/storage
Robert Haas f2e6a2ccf1 Add API to check if an existing exclusive lock allows cleanup.
LockBufferForCleanup() acquires a cleanup lock unconditionally, and
ConditionalLockBufferForCleanup() acquires a cleanup lock if it is
possible to do so without waiting; this patch adds a new API,
IsBufferCleanupOK(), which tests whether an exclusive lock already
held happens to be a cleanup lock.  This is possible because a cleanup
lock simply means an exclusive lock plus the assurance any other pins
on the buffer are newer than our own pin.  Therefore, just as the
existing functions decide that the exclusive lock that they've just
taken is a cleanup lock if they observe the pin count to be 1, this
new function allows us to observe that the pin count is 1 on a buffer
we've already locked.

This is useful in situations where a backend definitely wishes to
modify the buffer and also wishes to perform cleanup operations if
possible.  The patch to eliminate heavyweight locking by hash indexes
uses this, and it may have other applications as well.

Amit Kapila, per a suggestion from me.  Some comment adjustments by me
as well.
2016-11-04 09:32:24 -04:00
..
.gitignore When trace_lwlocks is used, identify individual lwlocks by name. 2015-09-11 14:01:39 -04:00
backendid.h Improve the situation for parallel query versus temp relations. 2016-06-09 20:16:11 -04:00
barrier.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
block.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
buf.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
buf_internals.h Fix fallback implementation of pg_atomic_write_u32(). 2016-10-07 16:55:15 -07:00
buffile.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
bufmgr.h Add API to check if an existing exclusive lock allows cleanup. 2016-11-04 09:32:24 -04:00
bufpage.h Rewrite PageIndexDeleteNoCompact into a form that only deletes 1 tuple. 2016-09-09 19:00:59 -04:00
checksum.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
checksum_impl.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
copydir.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
dsm.h Extend dsm API with a new function dsm_unpin_segment. 2016-08-23 14:32:23 -04:00
dsm_impl.h Extend dsm API with a new function dsm_unpin_segment. 2016-08-23 14:32:23 -04:00
fd.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00
freespace.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00
fsm_internals.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
indexfsm.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
ipc.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
item.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
itemid.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
itemptr.h Remove nearly-unused SizeOfIptrData macro. 2016-09-22 14:30:33 -04:00
large_object.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
latch.h Extend framework from commit 53be0b1ad to report latch waits. 2016-10-04 11:01:42 -04:00
lmgr.h Extend relations multiple blocks at a time to improve scalability. 2016-04-08 02:04:46 -04:00
lock.h Extend relations multiple blocks at a time to improve scalability. 2016-04-08 02:04:46 -04:00
lockdefs.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00
lwlock.h Extend framework from commit 53be0b1ad to report latch waits. 2016-10-04 11:01:42 -04:00
off.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_sema.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_shmem.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pmsignal.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pos.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
predicate.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
predicate_internals.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
proc.h Extend framework from commit 53be0b1ad to report latch waits. 2016-10-04 11:01:42 -04:00
procarray.h Create a function to reliably identify which sessions block which others. 2016-02-22 14:31:43 -05:00
proclist.h Once again allow LWLocks to be used within DSM segments. 2016-08-15 18:09:55 -04:00
proclist_types.h Once again allow LWLocks to be used within DSM segments. 2016-08-15 18:09:55 -04:00
procsignal.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
reinit.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
relfilenode.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
s_lock.h Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -04:00
shm_mq.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
shm_toc.h Fix typos. 2016-03-15 18:06:11 -04:00
shmem.h Change API of ShmemAlloc() so it throws error rather than returning NULL. 2016-09-01 10:13:55 -04:00
sinval.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
sinvaladt.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
smgr.h Improve scalability of md.c for large relations. 2016-09-08 17:18:46 -07:00
spin.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
standby.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00
standbydefs.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00