Skip to contentSkip to conversation

main - activate: device_is_usable

PATCH Zdenek Kabelac 1 participant 1 message Dec 20, 2021

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=65236ee7226930bcbabac0d2dc1979a90bcf2d19
Commit:        65236ee7226930bcbabac0d2dc1979a90bcf2d19
Parent:        5a78979b68c4ae822c3f9bcc7ba662c7aa727b40
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Wed Dec 15 11:26:21 2021 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Dec 20 16:13:28 2021 +0100

activate: device_is_usable

Move checking of usable uuid into separate function and pass in also cmd context.

---
 lib/activate/activate.c     |   2 +-
 lib/activate/activate.h     |   2 +-
 lib/activate/dev_manager.c  | 113 ++++++++++++++++++++++++--------------------
 lib/filters/filter-usable.c |   2 +-
 4 files changed, 66 insertions(+), 53 deletions(-)
lib/activate/activate.c +1 -1
index 52ec02e2c..9d1fe8ebe 100644
@@ -413,7 +413,7 @@ int add_areas_line(struct dev_manager *dm, struct lv_segment *seg,
 {
         return 0;
 }
-int device_is_usable(struct device *dev, struct dev_usable_check_params check, int *is_lv)
+int device_is_usable(struct cmd_context *cmd, struct device *dev, struct dev_usable_check_params check, int *is_lv)
 {
         return 0;
 }
lib/activate/activate.h +1 -1
index edd385aef..6133e6d97 100644
@@ -254,7 +254,7 @@ struct dev_usable_check_params {
  * Returns 1 if mapped device is not suspended, blocked or
  * is using a reserved name.
  */
-int device_is_usable(struct device *dev, struct dev_usable_check_params check, int *is_lv);
+int device_is_usable(struct cmd_context *cmd, struct device *dev, struct dev_usable_check_params check, int *is_lv);
 
 /*
  * Declaration moved here from fs.h to keep header fs.h hidden
lib/activate/dev_manager.c +63 -50

155 lines not on this page · raw message

lib/filters/filter-usable.c +1 -1
index 062fb6c74..d7bdf115e 100644
@@ -87,7 +87,7 @@ static int _passes_usable_filter(struct cmd_context *cmd, struct dev_filter *f,
 			break;
 		}
 
-		if (!(r = device_is_usable(dev, ucp, &is_lv))) {
+		if (!(r = device_is_usable(cmd, dev, ucp, &is_lv))) {
 			if (is_lv)
 				dev->filtered_flags |= DEV_FILTERED_IS_LV;
 			else