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

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