diff options
| author | Alexander Viro <viro@math.psu.edu> | 2002-07-04 08:53:39 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-07-04 08:53:39 -0700 |
| commit | f3ddcd6baa20805fea6fe560471f91b0b24fa2e5 (patch) | |
| tree | d44dd13efbcc7517ec469e59cfdaae9ec9ee3894 /include/linux | |
| parent | 480f41061c3442a39824591c4767ab6bdbe860f9 (diff) | |
[PATCH] raid ->diskop() splitup
* ->diskop() split into individual methods; prototypes cleaned
up. In particular, handling of hot_add_disk() gets mdk_rdev_t * of
the component we are adding as an argument instead of playing the games
with major/minor. Code cleaned up.
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/raid/md_k.h | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 69282d99a9eb..7b02c3c82a33 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -160,16 +160,6 @@ struct mdk_rdev_s int desc_nr; /* descriptor index in the superblock */ }; - -/* - * disk operations in a working array: - */ -#define DISKOP_SPARE_INACTIVE 0 -#define DISKOP_SPARE_WRITE 1 -#define DISKOP_SPARE_ACTIVE 2 -#define DISKOP_HOT_REMOVE_DISK 3 -#define DISKOP_HOT_ADD_DISK 4 - typedef struct mdk_personality_s mdk_personality_t; struct mddev_s @@ -214,18 +204,11 @@ struct mdk_personality_s int (*stop)(mddev_t *mddev); int (*status)(char *page, mddev_t *mddev); int (*error_handler)(mddev_t *mddev, struct block_device *bdev); - -/* - * Some personalities (RAID-1, RAID-5) can have disks hot-added and - * hot-removed. Hot removal is different from failure. (failure marks - * a disk inactive, but the disk is still part of the array) The interface - * to such operations is the 'pers->diskop()' function, can be NULL. - * - * the diskop function can change the pointer pointing to the incoming - * descriptor, but must do so very carefully. (currently only - * SPARE_ACTIVE expects such a change) - */ - int (*diskop) (mddev_t *mddev, mdp_disk_t **descriptor, int state); + int (*hot_add_disk) (mddev_t *mddev, mdp_disk_t *descriptor, mdk_rdev_t *rdev); + int (*hot_remove_disk) (mddev_t *mddev, int number); + int (*spare_write) (mddev_t *mddev, int number); + int (*spare_inactive) (mddev_t *mddev); + int (*spare_active) (mddev_t *mddev, mdp_disk_t **descriptor); int (*sync_request)(mddev_t *mddev, sector_t sector_nr, int go_faster); }; |
