+ /*
+ * Normal log, or a circular non-wrapped log, or a circular
+ * wrapped log which happens to be exactly linear
+ */
+ if (h->maplog_flag_circular == 0 || h->maplog_flag_wrapped == 0 ||
+ ((h->number_of_records % h->file_size_in_records) == 0))
+ (*fp) (h, file_baseva, records_this_file);
+ else
+ {
+ /* "Normal" wrapped circular log */
+ u64 first_chunk_record_index = h->number_of_records &
+ (h->file_size_in_records - 1);
+ u64 first_chunk_number_of_records = records_this_file -
+ first_chunk_record_index;
+ u8 *chunk_baseva = file_baseva +
+ first_chunk_record_index * h->record_size_in_cachelines *
+ h->cacheline_size;
+ (*fp) (h, chunk_baseva, first_chunk_number_of_records);
+ (*fp) (h, file_baseva,
+ records_this_file - first_chunk_number_of_records);
+ }