Please find the rebased Patch for Compute MAX LSN.
There was one compilation error as "undefined reference to XLByteLT " as earlier XLogRecPtr was a structure as typedef struct XLogRecPtr { uint32 xlogid; /* log file #, 0 based */ uint32 xrecoff; /* byte offset of location in log file */ } XLogRecPtr; So in order to compare two LSN, there was one macro as XLByteLT to compare both fields. But now XLogRecPtr has been changed as just uint64 and so XLByteLT is removed. So the change done is to replace XLByteLT(*maxlsn, pagelsn) with (*maxlsn < pagelsn).
Muhammad, Can you verify if every thing is okay, then this can be marked as "Ready for Committer"