src/backend/access/hash/hashpage.c
Buffer
_hash_getinitbuf(Relation rel, BlockNumber blkno)
{
	Buffer		buf;

	if (blkno == P_NEW)
		elog(ERROR, "hash AM does not use P_NEW");

	buf = ReadBufferExtended(rel, MAIN_FORKNUM, blkno, RBM_ZERO_AND_LOCK,
							 NULL);

	/* ref count and lock type are correct */

	/* initialize the page */
	_hash_pageinit(BufferGetPage(buf), BufferGetPageSize(buf));

	return buf;
}
/*
 *	_hash_getinitbuf() -- Get and initialize a buffer by block number.
 *
 *		This must be used only to fetch pages that are known to be before
 *		the index's filesystem EOF, but are to be filled from scratch.
 *		_hash_pageinit() is applied automatically.  Otherwise it has
 *		effects similar to _hash_getbuf() with access = HASH_WRITE.
 *
 *		When this routine returns, a write lock is set on the
 *		requested buffer and its reference count has been incremented
 *		(ie, the buffer is "locked and pinned").
 *
 *		P_NEW is disallowed because this routine can only be used
 *		to access pages that are known to be before the filesystem EOF.
 *		Extending the index should be done with _hash_getnewbuf.
 */
- Get and initialize a buffer by block number.
This must be used only to fetch pages that are known to be before
the index's filesystem EOF, but are to be filled from scratch.
_hash_pageinit() is applied automatically.  Otherwise it has
effects similar to _hash_getbuf() with access = HASH_WRITE.

When this routine returns, a write lock is set on the
requested buffer and its reference count has been incremented
.

P_NEW is disallowed because this routine can only be used
to access pages that are known to be before the filesystem EOF.
Extending the index should be done with _hash_getnewbuf.
- Get and initialize a buffer by block number . This must be used only to fetch pages that are known to be before the index ' s filesystem EOF but are to be filled from scratch . _hash_pageinit () is applied automatically . Otherwise it has effects similar to _hash_getbuf () with access = HASH_WRITE . When this routine returns a write lock is set on the requested buffer and its reference count has been incremented . P_NEW is disallowed because this routine can only be used to access pages that are known to be before the filesystem EOF . Extending the index should be done with _hash_getnewbuf .
Buffer
_hash_getinitbuf(Relation rel, BlockNumber blkno)
{
	Buffer		buf;
	if (blkno == P_NEW)
		elog(ERROR, "hash AM does not use P_NEW");
	buf = ReadBufferExtended(rel, MAIN_FORKNUM, blkno, RBM_ZERO_AND_LOCK,
							 NULL);
	_hash_pageinit(BufferGetPage(buf), BufferGetPageSize(buf));
	return buf;
}
Buffer _hash_getinitbuf ( Relation rel , BlockNumber blkno ) { Buffer buf ; if ( blkno == P_NEW ) elog ( ERROR , " " ) ; buf = ReadBufferExtended ( rel , MAIN_FORKNUM , blkno , RBM_ZERO_AND_LOCK , NULL ) ; _hash_pageinit ( BufferGetPage ( buf ) , BufferGetPageSize ( buf ) ) ; return buf ; }
_hash_getinitbuf() -- Get and initialize a buffer by block number.
_hash_getinitbuf () -- Get and initialize a buffer by block number .
/* ref count and lock type are correct */ /* initialize the page */