Blame SOURCES/0083-manage-move-comment-with-function-description.patch

91179e
From 36a707824eb1dafbb990f5daf1cbbe0e37dbbefb Mon Sep 17 00:00:00 2001
91179e
From: Kinga Tanska <kinga.tanska@intel.com>
91179e
Date: Thu, 5 Jan 2023 06:31:25 +0100
91179e
Subject: [PATCH 83/83] manage: move comment with function description
91179e
91179e
Move the function description from the function body to outside
91179e
to obey kernel coding style.
91179e
91179e
Signed-off-by: Kinga Tanska <kinga.tanska@intel.com>
91179e
Acked-by: Coly Li <colyli@suse.de>
91179e
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
91179e
---
91179e
 Manage.c | 72 ++++++++++++++++++++++++++++++++++----------------------
91179e
 1 file changed, 44 insertions(+), 28 deletions(-)
91179e
91179e
diff --git a/Manage.c b/Manage.c
91179e
index 6184d3f7..fde6aba3 100644
91179e
--- a/Manage.c
91179e
+++ b/Manage.c
91179e
@@ -1327,38 +1327,54 @@ bool is_remove_safe(mdu_array_info_t *array, const int fd, char *devname, const
91179e
 	return is_enough;
91179e
 }
91179e
 
91179e
+/**
91179e
+ * Manage_subdevs() - Execute operation depending on devmode.
91179e
+ *
91179e
+ * @devname: name of the device.
91179e
+ * @fd: file descriptor.
91179e
+ * @devlist: list of sub-devices to manage.
91179e
+ * @verbose: verbose level.
91179e
+ * @test: test flag.
91179e
+ * @update: type of update.
91179e
+ * @force: force flag.
91179e
+ *
91179e
+ * This function executes operation defined by devmode
91179e
+ * for each dev from devlist.
91179e
+ * Devmode can be:
91179e
+ * 'a' - add the device
91179e
+ * 'S' - add the device as a spare - don't try re-add
91179e
+ * 'j' - add the device as a journal device
91179e
+ * 'A' - re-add the device
91179e
+ * 'r' - remove the device: HOT_REMOVE_DISK
91179e
+ *       device can be 'faulty' or 'detached' in which case all
91179e
+ *       matching devices are removed.
91179e
+ * 'f' - set the device faulty SET_DISK_FAULTY
91179e
+ *       device can be 'detached' in which case any device that
91179e
+ *       is inaccessible will be marked faulty.
91179e
+ * 'I' - remove device by using incremental fail
91179e
+ *       which is executed when device is removed surprisingly.
91179e
+ * 'R' - mark this device as wanting replacement.
91179e
+ * 'W' - this device is added if necessary and activated as
91179e
+ *       a replacement for a previous 'R' device.
91179e
+ * -----
91179e
+ * 'w' - 'W' will be changed to 'w' when it is paired with
91179e
+ *       a 'R' device.  If a 'W' is found while walking the list
91179e
+ *       it must be unpaired, and is an error.
91179e
+ * 'M' - this is created by a 'missing' target.  It is a slight
91179e
+ *       variant on 'A'
91179e
+ * 'F' - Another variant of 'A', where the device was faulty
91179e
+ *       so must be removed from the array first.
91179e
+ * 'c' - confirm the device as found (for clustered environments)
91179e
+ *
91179e
+ * For 'f' and 'r', the device can also be a kernel-internal
91179e
+ * name such as 'sdb'.
91179e
+ *
91179e
+ * Return: 0 on success, otherwise 1 or 2.
91179e
+ */
91179e
 int Manage_subdevs(char *devname, int fd,
91179e
 		   struct mddev_dev *devlist, int verbose, int test,
91179e
 		   enum update_opt update, int force)
91179e
 {
91179e
-	/* Do something to each dev.
91179e
-	 * devmode can be
91179e
-	 *  'a' - add the device
91179e
-	 *  'S' - add the device as a spare - don't try re-add
91179e
-	 *  'j' - add the device as a journal device
91179e
-	 *  'A' - re-add the device
91179e
-	 *  'r' - remove the device: HOT_REMOVE_DISK
91179e
-	 *        device can be 'faulty' or 'detached' in which case all
91179e
-	 *	  matching devices are removed.
91179e
-	 *  'f' - set the device faulty SET_DISK_FAULTY
91179e
-	 *        device can be 'detached' in which case any device that
91179e
-	 *	  is inaccessible will be marked faulty.
91179e
-	 *  'R' - mark this device as wanting replacement.
91179e
-	 *  'W' - this device is added if necessary and activated as
91179e
-	 *        a replacement for a previous 'R' device.
91179e
-	 * -----
91179e
-	 *  'w' - 'W' will be changed to 'w' when it is paired with
91179e
-	 *        a 'R' device.  If a 'W' is found while walking the list
91179e
-	 *        it must be unpaired, and is an error.
91179e
-	 *  'M' - this is created by a 'missing' target.  It is a slight
91179e
-	 *        variant on 'A'
91179e
-	 *  'F' - Another variant of 'A', where the device was faulty
91179e
-	 *        so must be removed from the array first.
91179e
-	 *  'c' - confirm the device as found (for clustered environments)
91179e
-	 *
91179e
-	 * For 'f' and 'r', the device can also be a kernel-internal
91179e
-	 * name such as 'sdb'.
91179e
-	 */
91179e
 	mdu_array_info_t array;
91179e
 	unsigned long long array_size;
91179e
 	struct mddev_dev *dv;
91179e
-- 
91179e
2.38.1
91179e