All of lore.kernel.org
 help / color / mirror / Atom feed
* Subject:[PATCH 003:013]: raid0: raid0_size to support reshape
@ 2009-06-16 21:53 raz ben yehuda
  0 siblings, 0 replies; only message in thread
From: raz ben yehuda @ 2009-06-16 21:53 UTC (permalink / raw)
  To: linux raid, Neil Brown

have raid0_size sum only In_sync disks

 raid0.c |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

Signed-off-by: razb <raziebe@gmail.com>
---
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 8870acc..6160374 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -296,15 +296,18 @@ static int raid0_mergeable_bvec(struct request_queue *q,
 
 static sector_t raid0_size(mddev_t *mddev, sector_t sectors, int raid_disks)
 {
-	sector_t array_sectors = 0;
+	int i;
 	mdk_rdev_t *rdev;
+	sector_t array_sectors = 0;
+	raid0_conf_t *conf = mddev->private;
+	mdk_rdev_t **devlist = conf->devlist;
 
-	WARN_ONCE(sectors || raid_disks,
-		  "%s does not support generic reshape\n", __func__);
-
-	list_for_each_entry(rdev, &mddev->disks, same_set)
-		array_sectors += rdev->sectors;
-
+	for (i = 0; i < mddev->raid_disks; i++) {
+		rdev = devlist[i];
+		/* in reshape, spare disk is not in sync */
+		if (test_bit(In_sync, &rdev->flags))
+			array_sectors += rdev->sectors;
+	}
 	return array_sectors;
 }
 




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-16 21:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-16 21:53 Subject:[PATCH 003:013]: raid0: raid0_size to support reshape raz ben yehuda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.