Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269251
b: refs/heads/master
c: db298e1
h: refs/heads/master
i:
  269249: 263be06
  269247: b1d800b
v: v3
  • Loading branch information
NeilBrown committed Oct 7, 2011
1 parent 822fd74 commit 7935a98
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 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: 0fc280f606742e8a2969776b2ab11cf6a614d9e1
refs/heads/master: db298e1946c074c83d97f1c959fbc0def2af2c86
17 changes: 14 additions & 3 deletions trunk/drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,29 @@
#define NR_HASH (PAGE_SIZE / sizeof(struct hlist_head))
#define HASH_MASK (NR_HASH - 1)

#define stripe_hash(conf, sect) (&((conf)->stripe_hashtbl[((sect) >> STRIPE_SHIFT) & HASH_MASK]))
static inline struct hlist_head *stripe_hash(raid5_conf_t *conf, sector_t sect)
{
int hash = (sect >> STRIPE_SHIFT) & HASH_MASK;
return &conf->stripe_hashtbl[hash];
}

/* bio's attached to a stripe+device for I/O are linked together in bi_sector
* order without overlap. There may be several bio's per stripe+device, and
* a bio could span several devices.
* When walking this list for a particular stripe+device, we must never proceed
* beyond a bio that extends past this device, as the next bio might no longer
* be valid.
* This macro is used to determine the 'next' bio in the list, given the sector
* This function is used to determine the 'next' bio in the list, given the sector
* of the current stripe+device
*/
#define r5_next_bio(bio, sect) ( ( (bio)->bi_sector + ((bio)->bi_size>>9) < sect + STRIPE_SECTORS) ? (bio)->bi_next : NULL)
static inline struct bio *r5_next_bio(struct bio *bio, sector_t sector)
{
int sectors = bio->bi_size >> 9;
if (bio->bi_sector + sectors < sector + STRIPE_SECTORS)
return bio->bi_next;
else
return NULL;
}
/*
* The following can be used to debug the driver
*/
Expand Down

0 comments on commit 7935a98

Please sign in to comment.