diff options
author | Susan LoVerso <sue@wiredtiger.com> | 2016-01-25 12:07:27 -0500 |
---|---|---|
committer | Susan LoVerso <sue@wiredtiger.com> | 2016-01-25 12:07:27 -0500 |
commit | 7880038b807a530b347e213e9d773960c45c6df0 (patch) | |
tree | 0d3345a768935250a7cd0d99613f8220f64697b6 /src/include/log.i | |
parent | d3f0af2aaa9ae0b624193ee314287f1b2490bb71 (diff) | |
download | mongo-7880038b807a530b347e213e9d773960c45c6df0.tar.gz |
WT-2215 Use 32-bit LSN file and offsets. Set LSNs as a 64-bit value.
Diffstat (limited to 'src/include/log.i')
-rw-r--r-- | src/include/log.i | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/include/log.i b/src/include/log.i index fcdbc72c388..993c405818e 100644 --- a/src/include/log.i +++ b/src/include/log.i @@ -16,25 +16,14 @@ static inline int __wt_log_cmp(WT_LSN *lsn1, WT_LSN *lsn2); static inline int __wt_log_cmp(WT_LSN *lsn1, WT_LSN *lsn2) { - WT_LSN l1, l2; + uint64_t l1, l2; /* * Read LSNs into local variables so that we only read each field * once and all comparisons are on the same values. */ - l1 = *(volatile WT_LSN *)lsn1; - l2 = *(volatile WT_LSN *)lsn2; + l1 = ((volatile WT_LSN *)lsn1)->u.file_offset; + l2 = ((volatile WT_LSN *)lsn2)->u.file_offset; - /* - * If the file numbers are different we don't need to compare the - * offset. - */ - if (l1.file != l2.file) - return (l1.file < l2.file ? -1 : 1); - /* - * If the file numbers are the same, compare the offset. - */ - if (l1.offset != l2.offset) - return (l1.offset < l2.offset ? -1 : 1); - return (0); + return (l1 < l2 ? -1 : (l1 > l2 ? 1 : 0)); } |