Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319462
b: refs/heads/master
c: 1df0548
h: refs/heads/master
v: v3
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Jul 27, 2012
1 parent e412304 commit f435216
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f14fa693c93078444b5e95d7cad78ead0383ad50
refs/heads/master: 1df05483d758ea43abc375869fbe06be506ba827
9 changes: 3 additions & 6 deletions trunk/drivers/md/dm-stripe.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ struct stripe {
struct stripe_c {
uint32_t stripes;
int stripes_shift;
sector_t stripes_mask;

/* The size of this target / num. stripes */
sector_t stripe_width;
Expand Down Expand Up @@ -163,10 +162,8 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)

if (stripes & (stripes - 1))
sc->stripes_shift = -1;
else {
sc->stripes_shift = ffs(stripes) - 1;
sc->stripes_mask = ((sector_t) stripes) - 1;
}
else
sc->stripes_shift = __ffs(stripes);

ti->split_io = chunk_size;
ti->num_flush_requests = stripes;
Expand Down Expand Up @@ -218,7 +215,7 @@ static void stripe_map_sector(struct stripe_c *sc, sector_t sector,
if (sc->stripes_shift < 0)
*stripe = sector_div(chunk, sc->stripes);
else {
*stripe = chunk & sc->stripes_mask;
*stripe = chunk & (sc->stripes - 1);
chunk >>= sc->stripes_shift;
}

Expand Down

0 comments on commit f435216

Please sign in to comment.