X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=drivers%2Fmd%2Fraid10.h;h=be7f8d9cfc63f43e90827b38b2d5b1e2bbca224c;hb=9f2c9d12bcc53fcb3b787023723754e84d1aef8b;hp=944b1104d3b447c4437e847ad9e268e5c3fb0715;hpb=11ad2f52826ac6d58d6780d3d8a3e098c88d9142;p=linux-2.6-block.git diff --git a/drivers/md/raid10.h b/drivers/md/raid10.h index 944b1104d3b4..be7f8d9cfc63 100644 --- a/drivers/md/raid10.h +++ b/drivers/md/raid10.h @@ -4,14 +4,17 @@ typedef struct mirror_info mirror_info_t; struct mirror_info { - mdk_rdev_t *rdev; + struct md_rdev *rdev; sector_t head_position; + int recovery_disabled; /* matches + * mddev->recovery_disabled + * when we shouldn't try + * recovering this device. + */ }; -typedef struct r10bio_s r10bio_t; - struct r10_private_data_s { - mddev_t *mddev; + struct mddev *mddev; mirror_info_t *mirrors; int raid_disks; spinlock_t device_lock; @@ -63,7 +66,7 @@ struct r10_private_data_s { /* When taking over an array from a different personality, we store * the new thread here until we fully activate the array. */ - struct mdk_thread_s *thread; + struct md_thread *thread; }; typedef struct r10_private_data_s conf_t; @@ -75,14 +78,14 @@ typedef struct r10_private_data_s conf_t; * for this RAID10 operation, and about their status: */ -struct r10bio_s { +struct r10bio { atomic_t remaining; /* 'have we finished' count, * used from IRQ handlers */ sector_t sector; /* virtual sector number */ int sectors; unsigned long state; - mddev_t *mddev; + struct mddev *mddev; /* * original bio going to /dev/mdx */ @@ -113,10 +116,26 @@ struct r10bio_s { * level, we store IO_BLOCKED in the appropriate 'bios' pointer */ #define IO_BLOCKED ((struct bio*)1) +/* When we successfully write to a known bad-block, we need to remove the + * bad-block marking which must be done from process context. So we record + * the success by setting devs[n].bio to IO_MADE_GOOD + */ +#define IO_MADE_GOOD ((struct bio *)2) + +#define BIO_SPECIAL(bio) ((unsigned long)bio <= 2) /* bits for r10bio.state */ #define R10BIO_Uptodate 0 #define R10BIO_IsSync 1 #define R10BIO_IsRecover 2 #define R10BIO_Degraded 3 +/* Set ReadError on bios that experience a read error + * so that raid10d knows what to do with them. + */ +#define R10BIO_ReadError 4 +/* If a write for this request means we can clear some + * known-bad-block records, we set this flag. + */ +#define R10BIO_MadeGood 5 +#define R10BIO_WriteError 6 #endif