mirror of
https://github.com/postgres/postgres.git
synced 2025-07-21 16:02:15 +03:00
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
This commit is contained in:
@ -4700,7 +4700,7 @@ heap_xlog_clean(XLogRecPtr lsn, XLogRecord *record)
|
||||
LockBufferForCleanup(buffer);
|
||||
page = (Page) BufferGetPage(buffer);
|
||||
|
||||
if (XLByteLE(lsn, PageGetLSN(page)))
|
||||
if (lsn <= PageGetLSN(page))
|
||||
{
|
||||
UnlockReleaseBuffer(buffer);
|
||||
return;
|
||||
@ -4770,7 +4770,7 @@ heap_xlog_freeze(XLogRecPtr lsn, XLogRecord *record)
|
||||
return;
|
||||
page = (Page) BufferGetPage(buffer);
|
||||
|
||||
if (XLByteLE(lsn, PageGetLSN(page)))
|
||||
if (lsn <= PageGetLSN(page))
|
||||
{
|
||||
UnlockReleaseBuffer(buffer);
|
||||
return;
|
||||
@ -4854,7 +4854,7 @@ heap_xlog_visible(XLogRecPtr lsn, XLogRecord *record)
|
||||
* XLOG record's LSN, we mustn't mark the page all-visible, because
|
||||
* the subsequent update won't be replayed to clear the flag.
|
||||
*/
|
||||
if (!XLByteLE(lsn, PageGetLSN(page)))
|
||||
if (lsn > PageGetLSN(page))
|
||||
{
|
||||
PageSetAllVisible(page);
|
||||
MarkBufferDirty(buffer);
|
||||
@ -4891,7 +4891,7 @@ heap_xlog_visible(XLogRecPtr lsn, XLogRecord *record)
|
||||
* we did for the heap page. If this results in a dropped bit, no
|
||||
* real harm is done; and the next VACUUM will fix it.
|
||||
*/
|
||||
if (!XLByteLE(lsn, PageGetLSN(BufferGetPage(vmbuffer))))
|
||||
if (lsn > PageGetLSN(BufferGetPage(vmbuffer)))
|
||||
visibilitymap_set(reln, xlrec->block, lsn, vmbuffer,
|
||||
xlrec->cutoff_xid);
|
||||
|
||||
@ -4977,7 +4977,7 @@ heap_xlog_delete(XLogRecPtr lsn, XLogRecord *record)
|
||||
return;
|
||||
page = (Page) BufferGetPage(buffer);
|
||||
|
||||
if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
|
||||
if (lsn <= PageGetLSN(page)) /* changes are applied */
|
||||
{
|
||||
UnlockReleaseBuffer(buffer);
|
||||
return;
|
||||
@ -5072,7 +5072,7 @@ heap_xlog_insert(XLogRecPtr lsn, XLogRecord *record)
|
||||
return;
|
||||
page = (Page) BufferGetPage(buffer);
|
||||
|
||||
if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
|
||||
if (lsn <= PageGetLSN(page)) /* changes are applied */
|
||||
{
|
||||
UnlockReleaseBuffer(buffer);
|
||||
return;
|
||||
@ -5207,7 +5207,7 @@ heap_xlog_multi_insert(XLogRecPtr lsn, XLogRecord *record)
|
||||
return;
|
||||
page = (Page) BufferGetPage(buffer);
|
||||
|
||||
if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
|
||||
if (lsn <= PageGetLSN(page)) /* changes are applied */
|
||||
{
|
||||
UnlockReleaseBuffer(buffer);
|
||||
return;
|
||||
@ -5349,7 +5349,7 @@ heap_xlog_update(XLogRecPtr lsn, XLogRecord *record, bool hot_update)
|
||||
goto newt;
|
||||
page = (Page) BufferGetPage(obuffer);
|
||||
|
||||
if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
|
||||
if (lsn <= PageGetLSN(page)) /* changes are applied */
|
||||
{
|
||||
if (samepage)
|
||||
{
|
||||
@ -5449,7 +5449,7 @@ newt:;
|
||||
return;
|
||||
page = (Page) BufferGetPage(nbuffer);
|
||||
|
||||
if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
|
||||
if (lsn <= PageGetLSN(page)) /* changes are applied */
|
||||
{
|
||||
UnlockReleaseBuffer(nbuffer);
|
||||
if (BufferIsValid(obuffer))
|
||||
@ -5549,7 +5549,7 @@ heap_xlog_lock(XLogRecPtr lsn, XLogRecord *record)
|
||||
return;
|
||||
page = (Page) BufferGetPage(buffer);
|
||||
|
||||
if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
|
||||
if (lsn <= PageGetLSN(page)) /* changes are applied */
|
||||
{
|
||||
UnlockReleaseBuffer(buffer);
|
||||
return;
|
||||
@ -5612,7 +5612,7 @@ heap_xlog_inplace(XLogRecPtr lsn, XLogRecord *record)
|
||||
return;
|
||||
page = (Page) BufferGetPage(buffer);
|
||||
|
||||
if (XLByteLE(lsn, PageGetLSN(page))) /* changes are applied */
|
||||
if (lsn <= PageGetLSN(page)) /* changes are applied */
|
||||
{
|
||||
UnlockReleaseBuffer(buffer);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user