+}
+
+/**
+ * @brief Close a mapped log, and update the log header file
+ *
+ * Unmap the current log segments.
+ * Read the log header. Update the number of records, and number of files
+ *
+ * @param[in/out] mm mapped log object
+ */
+void
+clib_maplog_close (clib_maplog_main_t * mm)
+{
+ int i;
+ u64 file_size_in_bytes;
+
+ if (!(mm->flags & CLIB_MAPLOG_FLAG_INIT))
+ return;
+
+ clib_maplog_update_header (mm);
+
+ file_size_in_bytes =
+ mm->file_size_in_records * mm->record_size_in_cachelines *
+ CLIB_CACHE_LINE_BYTES;
+
+ /* unmap current + next segments */
+ for (i = 0; i < 2; i++)
+ {
+ (void) munmap ((u8 *) mm->file_baseva[i], file_size_in_bytes);
+ vec_free (mm->filenames[i]);
+ }