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

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