From: Michael Vrable Date: Sun, 19 Sep 2010 18:31:15 +0000 (-0700) Subject: Add cleaner option to rewrite and compact all inodes (but not all data). X-Git-Url: https://git.vrable.net/?a=commitdiff_plain;h=ee9d70dbec3dd064793bb51576dcb9064c2ae470;p=bluesky.git Add cleaner option to rewrite and compact all inodes (but not all data). --- diff --git a/cleaner/cleaner b/cleaner/cleaner index 1e564e8..58292e4 100755 --- a/cleaner/cleaner +++ b/cleaner/cleaner @@ -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)