Skip to contentSkip to conversation

Move persistent filter dump to more appropriate place.

PATCH New Milan Broz 1 participant 1 message Nov 24, 2009

lore
Share & tools
lore

Milan Broz

author
#0 lore raw

PATCH 1/1 Move persistent filter dump to more appropriate place.

After context_refresh is cache empty, the cache flush does nothing.

Call it after lvmcache full rescan if running from log lived process.

---
 lib/cache/lvmcache.c       |    8 ++++++++
 lib/commands/toolcontext.c |    7 -------
 2 files changed, 8 insertions(+), 7 deletions(-)
lib/cache/lvmcache.c +8 -0
index bfb714c..672b4b1 100644
@@ -20,6 +20,7 @@
 #include "locking.h"
 #include "metadata.h"
 #include "filter.h"
+#include "filter-persistent.h"
 #include "memlock.h"
 #include "str_list.h"
 #include "format-text.h"
@@ -533,6 +534,13 @@ int lvmcache_label_scan(struct cmd_context *cmd, int full_scan)
 			goto out;
 	}
 
+	/*
+	 * If we are a long-lived process, write out the updated persistent
+	 * device cache for the benefit of short-lived processes.
+	 */
+	if (full_scan == 2 && cmd->is_long_lived && cmd->dump_filter)
+		persistent_filter_dump(cmd->filter);
+
 	r = 1;
 
       out:
lib/commands/toolcontext.c +0 -7
index 721c2cf..80b6f8f 100644
@@ -1291,13 +1291,6 @@ int refresh_toolcontext(struct cmd_context *cmd)
 	if (!_init_segtypes(cmd))
 		return 0;
 
-	/*
-	 * If we are a long-lived process, write out the updated persistent
-	 * device cache for the benefit of short-lived processes.
-	 */
-	if (cmd->is_long_lived && cmd->dump_filter)
-		persistent_filter_dump(cmd->filter);
-
 	cmd->config_valid = 1;
 
 	reset_lvm_errno(1);
Signature · 1 line
1.6.5.3