From f656201188d73cdc2726265f1348f8ffbf7587be Mon Sep 17 00:00:00 2001 From: Mariusz Tkaczyk Date: Thu, 29 Feb 2024 12:52:06 +0100 Subject: mdadm: drop get_required_spare_criteria() Only IMSM implements get_spare_criteria, so load_super() in get_required_spare_criteria() is dead code. It is moved inside metadata handler, because only IMSM implements it. Give possibility to provide devnode to be opened. With that we can hide load_container() used only to fill spare criteria inside handler and simplify implementation in generic code. Add helper function for testing spare criteria in Incremental and error messages. File descriptor in get_spare_criteria_imsm() is always opened on purpose. New functionality added in next patches will require it. For the same reason, function is moved to other place. No functional changes. Signed-off-by: Mariusz Tkaczyk --- mdadm.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'mdadm.h') diff --git a/mdadm.h b/mdadm.h index e8abd730..cbc586f5 100644 --- a/mdadm.h +++ b/mdadm.h @@ -1116,10 +1116,9 @@ extern struct superswitch { * Return spare criteria for array: * - minimum disk size can be used in array; * - sector size can be used in array. - * Return values: 0 - for success and -EINVAL on error. */ - int (*get_spare_criteria)(struct supertype *st, - struct spare_criteria *sc); + mdadm_status_t (*get_spare_criteria)(struct supertype *st, char *mddev_path, + struct spare_criteria *sc); /* Find somewhere to put a bitmap - possibly auto-size it - and * update the metadata to record this. The array may be newly * created, in which case data_size may be updated, or it might -- cgit v1.2.3