1 /* LBS: An LFS-inspired filesystem backup system
2 * Copyright (C) 2007 Michael Vrable
4 * Handling of metadata written to backup snapshots. This manages the writing
5 * of file metadata into new backup snapshots, including breaking the metadata
6 * log apart across separate objects. Eventually this should include unified
7 * handling of the statcache, and re-use of metadata between snapshots.
10 #ifndef _LBS_METADATA_H
11 #define _LBS_METADATA_H
22 /* Metadata for a single inode, ready to be written out. */
28 class MetadataWriter {
30 MetadataWriter(TarSegmentStore *store, const char *path,
31 const char *snapshot_name, const char *snapshot_scheme);
32 void add(const std::string& path, dictionary info);
33 ObjectReference close();
36 void metadata_flush();
38 // Where are objects eventually written to?
39 TarSegmentStore *store;
41 // File descriptors for reading/writing local statcache data
42 std::string statcache_path, statcache_tmp_path;
45 // Metadata not yet written out to the segment store
47 std::list<MetadataItem> items;
48 std::ostringstream metadata_root;
51 #endif // _LBS_METADATA_H