Confusing comment in xlog.c or am I missing something? - Mailing list pgsql-hackers

From Amit Langote
Subject Confusing comment in xlog.c or am I missing something?
Date
Msg-id 1367471818906-5754010.post@n5.nabble.com
Whole thread Raw
Responses Re: Confusing comment in xlog.c or am I missing something?  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
I was just going through the xlog.c and I came across following which
confused me:

Given,

src/include/access/xlogdefs.h

#define XLogSegsPerFile (((uint32) 0xffffffff) / XLogSegSize)
#define XLogFileSize    (XLogSegsPerFile * XLogSegSize)

Also,
typedef struct XLogRecPtr{        uint32          xlogid;                 /* log file #, 0 based */        uint32
  xrecoff;                /* byte offset of location
 
in log file */} XLogRecPtr;


Check for crossing of xlog "segment" boundary?

src/include/access/trasam/xlog.c

/* Check for crossing of xlog segment boundary */
if (RecPtr->xrecoff >= XLogFileSize)
{       (RecPtr->xlogid)++;       RecPtr->xrecoff = 0;
}

Is that xlog "file" boundary or am I missing something?



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Confusing-comment-in-xlog-c-or-am-I-missing-something-tp5754010.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Recovery target 'immediate'
Next
From: Heikki Linnakangas
Date:
Subject: Re: Confusing comment in xlog.c or am I missing something?