1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-23 21:35:29 +03:00

Do not scan devices unnecessarily for reseting error counter

For reseting error counter use directly btree cached elements and do not
create whole dev_iterator.
This commit is contained in:
Zdenek Kabelac 2011-01-17 15:16:55 +00:00
parent 7a18ae6da4
commit 6789424259
2 changed files with 6 additions and 9 deletions

View File

@ -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)

View 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)