* label_scan should not generally be called a second time,
* so this will usually not be true.
*/
- if (_in_bcache(dev)) {
- _invalidate_fd(scan_bcache, dev->bcache_fd);
- _scan_dev_close(dev);
- }
+ label_scan_invalidate(dev);
};
dev_iter_destroy(iter);
return 0;
}
- dm_list_iterate_items(devl, devs) {
- if (_in_bcache(devl->dev)) {
- _invalidate_fd(scan_bcache, devl->dev->bcache_fd);
- _scan_dev_close(devl->dev);
- }
- }
+ dm_list_iterate_items(devl, devs)
+ label_scan_invalidate(devl->dev);
_scan_list(cmd, f, devs, NULL);
}
dm_list_iterate_items(devl, devs) {
- if (_in_bcache(devl->dev)) {
- _invalidate_fd(scan_bcache, devl->dev->bcache_fd);
- _scan_dev_close(devl->dev);
- }
+ label_scan_invalidate(devl->dev);
/*
* With this flag set, _scan_dev_open() done by
* _scan_list() will do open RW
int failed = 0;
dm_list_iterate_items(devl, devs) {
- if (_in_bcache(devl->dev)) {
- _invalidate_fd(scan_bcache, devl->dev->bcache_fd);
- _scan_dev_close(devl->dev);
- }
+ label_scan_invalidate(devl->dev);
/*
* With this flag set, _scan_dev_open() done by
* _scan_list() will do open EXCL
dm_list_init(&one_dev);
dm_list_add(&one_dev, &devl->list);
- if (_in_bcache(dev)) {
- _invalidate_fd(scan_bcache, dev->bcache_fd);
- _scan_dev_close(dev);
- }
+ label_scan_invalidate(dev);
_scan_list(NULL, NULL, &one_dev, &failed);
{
bcache_unset_last_byte(scan_bcache, dev->bcache_fd);
}
-