Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110464
b: refs/heads/master
c: 5b99c2f
h: refs/heads/master
v: v3
  • Loading branch information
Jens Axboe committed Oct 9, 2008
1 parent f3d548a commit c486f2d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 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: 960e739d9e9f1c2346d8bdc65299ee2e1ed42218
refs/heads/master: 5b99c2ffa980528a197f26c7d876cceeccce8dd5
12 changes: 6 additions & 6 deletions trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(256)));
#endif

/*
* We maintain a biased count of active stripes in the bottom 8 bits of
* bi_phys_segments, and a count of processed stripes in the upper 8 bits
* We maintain a biased count of active stripes in the bottom 16 bits of
* bi_phys_segments, and a count of processed stripes in the upper 16 bits
*/
static inline int raid5_bi_phys_segments(struct bio *bio)
{
return bio->bi_phys_segments & 0xff;
return bio->bi_phys_segments & 0xffff;
}

static inline int raid5_bi_hw_segments(struct bio *bio)
{
return (bio->bi_phys_segments >> 8) & 0xff;
return (bio->bi_phys_segments >> 16) & 0xffff;
}

static inline int raid5_dec_bi_phys_segments(struct bio *bio)
Expand All @@ -126,13 +126,13 @@ static inline int raid5_dec_bi_hw_segments(struct bio *bio)
unsigned short val = raid5_bi_hw_segments(bio);

--val;
bio->bi_phys_segments = (val << 8) | raid5_bi_phys_segments(bio);
bio->bi_phys_segments = (val << 16) | raid5_bi_phys_segments(bio);
return val;
}

static inline void raid5_set_bi_hw_segments(struct bio *bio, unsigned int cnt)
{
bio->bi_phys_segments = raid5_bi_phys_segments(bio) || (cnt << 8);
bio->bi_phys_segments = raid5_bi_phys_segments(bio) || (cnt << 16);
}

static inline int raid6_next_disk(int disk, int raid_disks)
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/bio.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ struct bio {
/* Number of segments in this BIO after
* physical address coalescing is performed.
*/
unsigned short bi_phys_segments;
unsigned int bi_phys_segments;

unsigned int bi_size; /* residual I/O count */

Expand Down

0 comments on commit c486f2d

Please sign in to comment.