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

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