Skip to contentSkip to conversation

add sysfs reshape_progress for raid5

PATCH New Xiao Ni 1 participant 1 message May 20, 2015 1 message not in the archive MD RAID

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Xiao Ni

author
#1 lore raw

PATCH 1/1 add sysfs reshape_progress for raid5

Hi all

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

----- Forwarded Message -----
From: "Xiao Ni" <[email protected]>
To: [email protected]
Cc: "Xiao Ni" <[email protected]>
Sent: Friday, May 15, 2015 3:08:27 PM
Subject: [PATCH] add sysfs reshape_progress for raid5

---
 drivers/md/raid5.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
drivers/md/raid5.c +14 -0
index 77dfd72..0799793 100644
@@ -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,
Signature · 1 line
1.7.1