From: Andre Noll <maan@systemlinux.org>
To: neilb@suse.de
Cc: linux-raid@vger.kernel.org, Andre Noll <maan@systemlinux.org>
Subject: [PATCH 4/9] md: raid0: Represent device offset in sectors.
Date: Mon, 20 Oct 2008 10:56:42 +0200 [thread overview]
Message-ID: <1224493007-1255-5-git-send-email-maan@systemlinux.org> (raw)
In-Reply-To: <1224493007-1255-1-git-send-email-maan@systemlinux.org>
Rename zone->dev_offset to zone->dev_start to make sure all users
have been converted.
---
drivers/md/raid0.c | 9 ++++-----
include/linux/raid/raid0.h | 2 +-
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index fd65d88..b860536 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -167,7 +167,7 @@ static int create_strip_zones (mddev_t *mddev)
zone->dev = conf->strip_zone[i-1].dev + mddev->raid_disks;
printk("raid0: zone %d\n", i);
- zone->dev_offset = current_offset;
+ zone->dev_start = current_offset * 2;
smallest = NULL;
c = 0;
@@ -452,8 +452,7 @@ static int raid0_make_request (struct request_queue *q, struct bio *bio)
x = sector >> chunksect_bits;
tmp_dev = zone->dev[sector_div(x, zone->nb_dev)];
}
- rsect = (((chunk << (chunksect_bits - 1)) + zone->dev_offset)<<1)
- + sect_in_chunk;
+ rsect = (chunk << chunksect_bits) + zone->dev_start + sect_in_chunk;
bio->bi_bdev = tmp_dev->bdev;
bio->bi_sector = rsect + tmp_dev->data_offset;
@@ -490,9 +489,9 @@ static void raid0_status (struct seq_file *seq, mddev_t *mddev)
seq_printf(seq, "%s/", bdevname(
conf->strip_zone[j].dev[k]->bdev,b));
- seq_printf(seq, "] zo=%d do=%d s=%d\n",
+ seq_printf(seq, "] zo=%d ds=%d s=%d\n",
conf->strip_zone[j].zone_offset,
- conf->strip_zone[j].dev_offset,
+ conf->strip_zone[j].dev_start,
conf->strip_zone[j].size);
}
#endif
diff --git a/include/linux/raid/raid0.h b/include/linux/raid/raid0.h
index 1b2dda0..61c3d29 100644
--- a/include/linux/raid/raid0.h
+++ b/include/linux/raid/raid0.h
@@ -6,7 +6,7 @@
struct strip_zone
{
sector_t zone_offset; /* Zone offset in md_dev */
- sector_t dev_offset; /* Zone offset in real dev */
+ sector_t dev_start; /* Zone offset in real dev (in sectors) */
sector_t size; /* Zone size */
int nb_dev; /* # of devices attached to the zone */
mdk_rdev_t **dev; /* Devices attached to the zone */
--
1.5.3.8
next prev parent reply other threads:[~2008-10-20 8:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-20 8:56 [PATCH 0/9] md: Make raid0 use sector-based quantities Andre Noll
2008-10-20 8:56 ` [PATCH 1/9] md: raid0_make_request(): Replace chunksize_bits by chunksect_bits Andre Noll
2008-10-20 8:56 ` [PATCH 2/9] md: raid0_make_request(): Remove local variable chunk_size Andre Noll
2008-10-20 8:56 ` [PATCH 3/9] md: raid0_make_request(): Replace local variable block by sector Andre Noll
2008-10-20 8:56 ` Andre Noll [this message]
2008-10-20 8:56 ` [PATCH 5/9] md: raid0: Represent zone->zone_offset in sectors Andre Noll
2008-10-20 8:56 ` [PATCH 6/9] md: raid0 create_strip_zones(): Make two local variables sector-based Andre Noll
2008-10-20 8:56 ` [PATCH 7/9] md: raid0 create_strip_zones(): Add KERN_INFO/KERN_ERR to printk's Andre Noll
2008-10-20 8:56 ` [PATCH 8/9] md: raid0: Represent the size of strip zones in sectors Andre Noll
2008-10-20 8:56 ` [PATCH 9/9] md: raid0: make hash_spacing and preshift sector-based Andre Noll
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1224493007-1255-5-git-send-email-maan@systemlinux.org \
--to=maan@systemlinux.org \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).