aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/freespace/freespace.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-03-29 12:44:19 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-03-29 12:44:19 -0400
commit2b1759e2675fc01d6945c9a5fa65c7d7121212f7 (patch)
tree2f6492f365b542e75b5131d8ca4e6a5864661890 /src/backend/storage/freespace/freespace.c
parenta063baaced273e955e088ba5979dcc6ec5cd92e6 (diff)
downloadpostgresql-2b1759e2675fc01d6945c9a5fa65c7d7121212f7.tar.gz
postgresql-2b1759e2675fc01d6945c9a5fa65c7d7121212f7.zip
Remove unnecessary BufferGetPage() calls in fsm_vacuum_page().
Just noticed that these were quite redundant, since we're holding the page address in a local variable anyway, and we have pin on the buffer throughout. Also improve a comment.
Diffstat (limited to 'src/backend/storage/freespace/freespace.c')
-rw-r--r--src/backend/storage/freespace/freespace.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/storage/freespace/freespace.c b/src/backend/storage/freespace/freespace.c
index fd18c851140..65c4e74999f 100644
--- a/src/backend/storage/freespace/freespace.c
+++ b/src/backend/storage/freespace/freespace.c
@@ -866,7 +866,7 @@ fsm_vacuum_page(Relation rel, FSMAddress addr,
if (fsm_get_avail(page, slot) != child_avail)
{
LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE);
- fsm_set_avail(BufferGetPage(buf), slot, child_avail);
+ fsm_set_avail(page, slot, child_avail);
MarkBufferDirtyHint(buf, false);
LockBuffer(buf, BUFFER_LOCK_UNLOCK);
}
@@ -874,12 +874,13 @@ fsm_vacuum_page(Relation rel, FSMAddress addr,
}
/* Now get the maximum value on the page, to return to caller */
- max_avail = fsm_get_max_avail(BufferGetPage(buf));
+ max_avail = fsm_get_max_avail(page);
/*
* Reset the next slot pointer. This encourages the use of low-numbered
* pages, increasing the chances that a later vacuum can truncate the
- * relation.
+ * relation. We don't bother with a lock here, nor with marking the page
+ * dirty if it wasn't already, since this is just a hint.
*/
((FSMPage) PageGetContents(page))->fp_next_slot = 0;