aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gist.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2012-12-28 13:06:15 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2012-12-28 13:06:15 -0300
commit5ab3af46ddd2f2c2b248f1ffdb688b394d4bb387 (patch)
tree6150244dc25064e933170880cab2037a79682f65 /src/backend/access/gist/gist.c
parent24eca7977ed208de33791af8890975ffcf086598 (diff)
downloadpostgresql-5ab3af46ddd2f2c2b248f1ffdb688b394d4bb387.tar.gz
postgresql-5ab3af46ddd2f2c2b248f1ffdb688b394d4bb387.zip
Remove obsolete XLogRecPtr macros
This gets rid of XLByteLT, XLByteLE, XLByteEQ and XLByteAdvance. These were useful for brevity when XLogRecPtrs were split in xlogid/xrecoff; but now that they are simple uint64's, they are just clutter. The only downside to making this change would be ease of backporting patches, but that has been negated by other substantive changes to the involved code anyway. The clarity of simpler expressions makes the change worthwhile. Most of the changes are mechanical, but in a couple of places, the patch author chose to invert the operator sense, making the code flow more logical (and more in line with preceding comments). Author: Andres Freund Eyeballed by Dimitri Fontaine and Alvaro Herrera
Diffstat (limited to 'src/backend/access/gist/gist.c')
-rw-r--r--src/backend/access/gist/gist.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c
index 9c6625bba3a..700e97afc39 100644
--- a/src/backend/access/gist/gist.c
+++ b/src/backend/access/gist/gist.c
@@ -561,8 +561,7 @@ gistdoinsert(Relation r, IndexTuple itup, Size freespace, GISTSTATE *giststate)
}
if (stack->blkno != GIST_ROOT_BLKNO &&
- XLByteLT(stack->parent->lsn,
- GistPageGetOpaque(stack->page)->nsn))
+ stack->parent->lsn < GistPageGetOpaque(stack->page)->nsn)
{
/*
* Concurrent split detected. There's no guarantee that the
@@ -620,7 +619,7 @@ gistdoinsert(Relation r, IndexTuple itup, Size freespace, GISTSTATE *giststate)
xlocked = true;
stack->page = (Page) BufferGetPage(stack->buffer);
- if (!XLByteEQ(PageGetLSN(stack->page), stack->lsn))
+ if (PageGetLSN(stack->page) != stack->lsn)
{
/* the page was changed while we unlocked it, retry */
continue;
@@ -708,8 +707,8 @@ gistdoinsert(Relation r, IndexTuple itup, Size freespace, GISTSTATE *giststate)
*/
}
else if (GistFollowRight(stack->page) ||
- XLByteLT(stack->parent->lsn,
- GistPageGetOpaque(stack->page)->nsn))
+ stack->parent->lsn <
+ GistPageGetOpaque(stack->page)->nsn)
{
/*
* The page was split while we momentarily unlocked the
@@ -794,7 +793,7 @@ gistFindPath(Relation r, BlockNumber child, OffsetNumber *downlinkoffnum)
if (GistFollowRight(page))
elog(ERROR, "concurrent GiST page split was incomplete");
- if (top->parent && XLByteLT(top->parent->lsn, GistPageGetOpaque(page)->nsn) &&
+ if (top->parent && top->parent->lsn < GistPageGetOpaque(page)->nsn &&
GistPageGetOpaque(page)->rightlink != InvalidBlockNumber /* sanity check */ )
{
/*
@@ -864,7 +863,8 @@ gistFindCorrectParent(Relation r, GISTInsertStack *child)
parent->page = (Page) BufferGetPage(parent->buffer);
/* here we don't need to distinguish between split and page update */
- if (child->downlinkoffnum == InvalidOffsetNumber || !XLByteEQ(parent->lsn, PageGetLSN(parent->page)))
+ if (child->downlinkoffnum == InvalidOffsetNumber ||
+ parent->lsn != PageGetLSN(parent->page))
{
/* parent is changed, look child in right links until found */
OffsetNumber i,