Fwd: [PATCH] add sysfs reshape_progress for raid5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all

   Send the patch again. Because I don't see them at http://www.spinics.net/lists/raid/

----- Forwarded Message -----
From: "Xiao Ni" <xni@xxxxxxxxxx>
To: linux-raid@xxxxxxxxxxxxxxx
Cc: "Xiao Ni" <xni@xxxxxxxxxx>
Sent: Friday, May 15, 2015 3:08:27 PM
Subject: [PATCH] add sysfs reshape_progress for raid5


Signed-off-by: Xiao Ni <xni@xxxxxxxxxx>
---
 drivers/md/raid5.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 77dfd72..0799793 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -5893,6 +5893,19 @@ raid5_store_stripe_cache_size(struct mddev *mddev, const char *page, size_t len)
 	return err ?: len;
 }
 
+static ssize_t
+reshape_progress_show(struct mddev *mddev, char *page)
+{
+	struct r5conf *conf = mddev->private;
+	if (conf->reshape_progress == MaxSector)
+		return sprintf(page, "max\n");
+	else
+		return sprintf(page, "%llu\n",
+					(unsigned long long)conf->reshape_progress);
+}
+
+static struct md_sysfs_entry raid5_reshape_progress = __ATTR_RO(reshape_progress);
+
 static struct md_sysfs_entry
 raid5_stripecache_size = __ATTR(stripe_cache_size, S_IRUGO | S_IWUSR,
 				raid5_show_stripe_cache_size,
@@ -6122,6 +6135,7 @@ raid5_group_thread_cnt = __ATTR(group_thread_cnt, S_IRUGO | S_IWUSR,
 				raid5_store_group_thread_cnt);
 
 static struct attribute *raid5_attrs[] =  {
+	&raid5_reshape_progress.attr,
 	&raid5_stripecache_size.attr,
 	&raid5_stripecache_active.attr,
 	&raid5_preread_bypass_threshold.attr,
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux