Add cleaner option to rewrite and compact all inodes (but not all data).
authorMichael Vrable <mvrable@cs.ucsd.edu>
Sun, 19 Sep 2010 18:31:15 +0000 (11:31 -0700)
committerMichael Vrable <mvrable@cs.ucsd.edu>
Sun, 19 Sep 2010 18:31:15 +0000 (11:31 -0700)
cleaner/cleaner

index 1e564e8..58292e4 100755 (executable)
@@ -401,7 +401,7 @@ def rewrite_inode(backend, inode_map, inum, log, copy_data=True):
     log.write(inode, 1)
     inode_map.mark_updated(inum)
 
-def run_cleaner(backend, inode_map, log):
+def run_cleaner(backend, inode_map, log, repack_inodes=False):
     # Determine which segments are poorly utilized and should be cleaned.  We
     # need better heuristics here.
     for (s, u) in sorted(inode_map.util.segments.items()):
@@ -416,7 +416,10 @@ def run_cleaner(backend, inode_map, log):
     # Given that list of segments to clean, scan through those segments to find
     # data which is still live and mark relevant inodes as needing to be
     # rewritten.
-    dirty_inodes = set()
+    if repack_inodes:
+        dirty_inodes = set(inode_map.inodes)
+    else:
+        dirty_inodes = set()
     dirty_inode_data = set()
     for s in inode_map.obsolete_segments:
         filename = backend.loc_to_name(s)