* 05/27/97
*/
stack->bts_btentry = bknum;
- pbuf = _bt_getstackbuf(rel, stack, BT_WRITE);
+ pbuf = _bt_getstackbuf(rel, stack);
/*
* Now we can unlock the right child. The left child will be unlocked
*
* Adjusts bts_blkno & bts_offset if changed.
*
- * Returns InvalidBuffer if item not found (should not happen).
+ * Returns write-locked buffer, or InvalidBuffer if item not found
+ * (should not happen).
*/
Buffer
-_bt_getstackbuf(Relation rel, BTStack stack, int access)
+_bt_getstackbuf(Relation rel, BTStack stack)
{
BlockNumber blkno;
OffsetNumber start;
Page page;
BTPageOpaque opaque;
- buf = _bt_getbuf(rel, blkno, access);
+ buf = _bt_getbuf(rel, blkno, BT_WRITE);
page = BufferGetPage(buf);
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
- if (access == BT_WRITE && P_INCOMPLETE_SPLIT(opaque))
+ if (P_INCOMPLETE_SPLIT(opaque))
{
_bt_finish_split(rel, buf, stack->bts_parent);
continue;
* if needed)
*/
stack->bts_btentry = child;
- pbuf = _bt_getstackbuf(rel, stack, BT_WRITE);
+ pbuf = _bt_getstackbuf(rel, stack);
if (pbuf == InvalidBuffer)
elog(ERROR, "failed to re-find parent key in index \"%s\" for deletion target page %u",
RelationGetRelationName(rel), child);
*/
extern bool _bt_doinsert(Relation rel, IndexTuple itup,
IndexUniqueCheck checkUnique, Relation heapRel);
-extern Buffer _bt_getstackbuf(Relation rel, BTStack stack, int access);
+extern Buffer _bt_getstackbuf(Relation rel, BTStack stack);
extern void _bt_finish_split(Relation rel, Buffer bbuf, BTStack stack);
/*