]> sourceware.org Git - lvm2.git/commitdiff
Do not scan devices unnecessarily for reseting error counter
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 17 Jan 2011 15:16:55 +0000 (15:16 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 17 Jan 2011 15:16:55 +0000 (15:16 +0000)
For reseting error counter use directly btree cached elements and do not
create whole dev_iterator.

WHATS_NEW
lib/device/dev-cache.c

index df4da73d1bca31f9c33537242be2fea532c92bc6..fdb74b46f266817603ccc7d7be1a329e1854fe5a 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.81 -
 ===================================
+  Do not scan devices unnecessarily in dev_reset_error_count().
   Skip unnecessary lock_vol() call after volume deactivation.
   Extend exec_cmd params to specify, when device sync is needed.
   Replace fs_unlock by sync_local_dev_names to notify local clvmd. (2.02.80)
index 962aa1e004e06202a74051d6fe67bcb8b8c69cdd..8ba8515729e474ba3722d70a57dd74ed30504cd9 100644 (file)
@@ -850,18 +850,14 @@ struct device *dev_iter_get(struct dev_iter *iter)
 
 void dev_reset_error_count(struct cmd_context *cmd)
 {
-       struct dev_iter *iter;
-       struct device *dev;
+       struct dev_iter iter;
 
-       if (!(iter = dev_iter_create(cmd->filter, 0))) {
-               log_error("Resetting device error count failed");
+       if (!_cache.devices)
                return;
-       }
-
-       for (dev = dev_iter_get(iter); dev; dev = dev_iter_get(iter))
-               dev->error_count = 0;
 
-       dev_iter_destroy(iter);
+       iter.current = btree_first(_cache.devices);
+       while (iter.current)
+               _iter_next(&iter)->error_count = 0;
 }
 
 int dev_fd(struct device *dev)
This page took 0.046483 seconds and 5 git commands to generate.