diff options
| author | Neil Brown <neilb@cse.unsw.edu.au> | 2002-08-22 21:26:52 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-08-22 21:26:52 -0700 |
| commit | acd8a264eb7be3192c73bfe1f7873d52302c5d10 (patch) | |
| tree | e34e17887f71480a45e9c55943d064c03627fc89 /include/linux/raid | |
| parent | f39afb8238f18d4b1b157ea31c4306003227dafd (diff) | |
[PATCH] md: Make spare handling simple ... personalities know less
1/ Personalities only know about raid_disks devices.
Some might be not in_sync and so cannot be read from,
but must be written to.
- change MD_SB_DISKS to ->raid_disks
- add tests for .write_only
2/ rdev->raid_disk is now -1 for spares. desc_nr is maintained
by analyse_sbs and sync_sbs.
3/ spare_inactive method is subsumed into hot_remove_disk
spare_writable is subsumed into hot_add_disk.
hot_add_disk decides which slot a new device will hold.
4/ spare_active now finds all non-in_sync devices and marks them
in_sync.
5/ faulty devices are removed by the md recovery thread as soon
as they are idle. Any spares that are available are then added.
Diffstat (limited to 'include/linux/raid')
| -rw-r--r-- | include/linux/raid/md_k.h | 7 | ||||
| -rw-r--r-- | include/linux/raid/raid1.h | 2 | ||||
| -rw-r--r-- | include/linux/raid/raid5.h | 1 |
3 files changed, 1 insertions, 9 deletions
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 4fb0e1a51155..49fe38181bfb 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -207,7 +207,7 @@ struct mddev_s int in_sync; /* know to not need resync */ struct semaphore reconfig_sem; atomic_t active; - mdk_rdev_t *spare; + int spares; int degraded; /* whether md should consider * adding a spare @@ -231,8 +231,6 @@ struct mdk_personality_s int (*error_handler)(mddev_t *mddev, mdk_rdev_t *rdev); int (*hot_add_disk) (mddev_t *mddev, mdk_rdev_t *rdev); int (*hot_remove_disk) (mddev_t *mddev, int number); - int (*spare_write) (mddev_t *mddev); - int (*spare_inactive) (mddev_t *mddev); int (*spare_active) (mddev_t *mddev); int (*sync_request)(mddev_t *mddev, sector_t sector_nr, int go_faster); }; @@ -277,9 +275,6 @@ extern mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr); #define ITERATE_RDEV_PENDING(rdev,tmp) \ ITERATE_RDEV_GENERIC(pending_raid_disks,rdev,tmp) -#define xchg_values(x,y) do { __typeof__(x) __tmp = x; \ - x = y; y = __tmp; } while (0) - typedef struct mdk_thread_s { void (*run) (void *data); void *data; diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h index 63328b2ca370..7e7cf996d865 100644 --- a/include/linux/raid/raid1.h +++ b/include/linux/raid/raid1.h @@ -14,7 +14,6 @@ struct mirror_info { */ int operational; int write_only; - int spare; }; typedef struct r1bio_s r1bio_t; @@ -27,7 +26,6 @@ struct r1_private_data_s { int last_used; sector_t next_seq_sect; mdk_thread_t *thread; - mirror_info_t *spare; spinlock_t device_lock; /* for use when syncing mirrors: */ diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h index 25d6f677fd9c..5e63e608b5eb 100644 --- a/include/linux/raid/raid5.h +++ b/include/linux/raid/raid5.h @@ -195,7 +195,6 @@ struct disk_info { mdk_rdev_t *rdev; int operational; int write_only; - int spare; }; struct raid5_private_data { |
