@@ -137,7 +137,7 @@ static void vm_extend(Relation rel, BlockNumber vm_nblocks);
137137 * any I/O. Returns true if any bits have been cleared and false otherwise.
138138 */
139139bool
140- visibilitymap_clear (Relation rel , BlockNumber heapBlk , Buffer buf , uint8 flags )
140+ visibilitymap_clear (Relation rel , BlockNumber heapBlk , Buffer vmbuf , uint8 flags )
141141{
142142 BlockNumber mapBlock = HEAPBLK_TO_MAPBLOCK (heapBlk );
143143 int mapByte = HEAPBLK_TO_MAPBYTE (heapBlk );
@@ -152,21 +152,21 @@ visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer buf, uint8 flags)
152152 elog (DEBUG1 , "vm_clear %s %d" , RelationGetRelationName (rel ), heapBlk );
153153#endif
154154
155- if (!BufferIsValid (buf ) || BufferGetBlockNumber (buf ) != mapBlock )
155+ if (!BufferIsValid (vmbuf ) || BufferGetBlockNumber (vmbuf ) != mapBlock )
156156 elog (ERROR , "wrong buffer passed to visibilitymap_clear" );
157157
158- LockBuffer (buf , BUFFER_LOCK_EXCLUSIVE );
159- map = PageGetContents (BufferGetPage (buf ));
158+ LockBuffer (vmbuf , BUFFER_LOCK_EXCLUSIVE );
159+ map = PageGetContents (BufferGetPage (vmbuf ));
160160
161161 if (map [mapByte ] & mask )
162162 {
163163 map [mapByte ] &= ~mask ;
164164
165- MarkBufferDirty (buf );
165+ MarkBufferDirty (vmbuf );
166166 cleared = true;
167167 }
168168
169- LockBuffer (buf , BUFFER_LOCK_UNLOCK );
169+ LockBuffer (vmbuf , BUFFER_LOCK_UNLOCK );
170170
171171 return cleared ;
172172}
@@ -180,43 +180,43 @@ visibilitymap_clear(Relation rel, BlockNumber heapBlk, Buffer buf, uint8 flags)
180180 * shouldn't hold a lock on the heap page while doing that. Then, call
181181 * visibilitymap_set to actually set the bit.
182182 *
183- * On entry, *buf should be InvalidBuffer or a valid buffer returned by
183+ * On entry, *vmbuf should be InvalidBuffer or a valid buffer returned by
184184 * an earlier call to visibilitymap_pin or visibilitymap_get_status on the same
185- * relation. On return, *buf is a valid buffer with the map page containing
185+ * relation. On return, *vmbuf is a valid buffer with the map page containing
186186 * the bit for heapBlk.
187187 *
188188 * If the page doesn't exist in the map file yet, it is extended.
189189 */
190190void
191- visibilitymap_pin (Relation rel , BlockNumber heapBlk , Buffer * buf )
191+ visibilitymap_pin (Relation rel , BlockNumber heapBlk , Buffer * vmbuf )
192192{
193193 BlockNumber mapBlock = HEAPBLK_TO_MAPBLOCK (heapBlk );
194194
195195 /* Reuse the old pinned buffer if possible */
196- if (BufferIsValid (* buf ))
196+ if (BufferIsValid (* vmbuf ))
197197 {
198- if (BufferGetBlockNumber (* buf ) == mapBlock )
198+ if (BufferGetBlockNumber (* vmbuf ) == mapBlock )
199199 return ;
200200
201- ReleaseBuffer (* buf );
201+ ReleaseBuffer (* vmbuf );
202202 }
203- * buf = vm_readbuf (rel , mapBlock , true);
203+ * vmbuf = vm_readbuf (rel , mapBlock , true);
204204}
205205
206206/*
207207 * visibilitymap_pin_ok - do we already have the correct page pinned?
208208 *
209- * On entry, buf should be InvalidBuffer or a valid buffer returned by
209+ * On entry, vmbuf should be InvalidBuffer or a valid buffer returned by
210210 * an earlier call to visibilitymap_pin or visibilitymap_get_status on the same
211211 * relation. The return value indicates whether the buffer covers the
212212 * given heapBlk.
213213 */
214214bool
215- visibilitymap_pin_ok (BlockNumber heapBlk , Buffer buf )
215+ visibilitymap_pin_ok (BlockNumber heapBlk , Buffer vmbuf )
216216{
217217 BlockNumber mapBlock = HEAPBLK_TO_MAPBLOCK (heapBlk );
218218
219- return BufferIsValid (buf ) && BufferGetBlockNumber (buf ) == mapBlock ;
219+ return BufferIsValid (vmbuf ) && BufferGetBlockNumber (vmbuf ) == mapBlock ;
220220}
221221
222222/*
@@ -314,11 +314,11 @@ visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf,
314314 * Are all tuples on heapBlk visible to all or are marked frozen, according
315315 * to the visibility map?
316316 *
317- * On entry, *buf should be InvalidBuffer or a valid buffer returned by an
317+ * On entry, *vmbuf should be InvalidBuffer or a valid buffer returned by an
318318 * earlier call to visibilitymap_pin or visibilitymap_get_status on the same
319- * relation. On return, *buf is a valid buffer with the map page containing
319+ * relation. On return, *vmbuf is a valid buffer with the map page containing
320320 * the bit for heapBlk, or InvalidBuffer. The caller is responsible for
321- * releasing *buf after it's done testing and setting bits.
321+ * releasing *vmbuf after it's done testing and setting bits.
322322 *
323323 * NOTE: This function is typically called without a lock on the heap page,
324324 * so somebody else could change the bit just after we look at it. In fact,
@@ -328,7 +328,7 @@ visibilitymap_set(Relation rel, BlockNumber heapBlk, Buffer heapBuf,
328328 * all concurrency issues!
329329 */
330330uint8
331- visibilitymap_get_status (Relation rel , BlockNumber heapBlk , Buffer * buf )
331+ visibilitymap_get_status (Relation rel , BlockNumber heapBlk , Buffer * vmbuf )
332332{
333333 BlockNumber mapBlock = HEAPBLK_TO_MAPBLOCK (heapBlk );
334334 uint32 mapByte = HEAPBLK_TO_MAPBYTE (heapBlk );
@@ -341,23 +341,23 @@ visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *buf)
341341#endif
342342
343343 /* Reuse the old pinned buffer if possible */
344- if (BufferIsValid (* buf ))
344+ if (BufferIsValid (* vmbuf ))
345345 {
346- if (BufferGetBlockNumber (* buf ) != mapBlock )
346+ if (BufferGetBlockNumber (* vmbuf ) != mapBlock )
347347 {
348- ReleaseBuffer (* buf );
349- * buf = InvalidBuffer ;
348+ ReleaseBuffer (* vmbuf );
349+ * vmbuf = InvalidBuffer ;
350350 }
351351 }
352352
353- if (!BufferIsValid (* buf ))
353+ if (!BufferIsValid (* vmbuf ))
354354 {
355- * buf = vm_readbuf (rel , mapBlock , false);
356- if (!BufferIsValid (* buf ))
355+ * vmbuf = vm_readbuf (rel , mapBlock , false);
356+ if (!BufferIsValid (* vmbuf ))
357357 return false;
358358 }
359359
360- map = PageGetContents (BufferGetPage (* buf ));
360+ map = PageGetContents (BufferGetPage (* vmbuf ));
361361
362362 /*
363363 * A single byte read is atomic. There could be memory-ordering effects
0 commit comments