From 2dc0a8b31704495f79a83e986587e18d555e4eaf Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Tue, 18 Jun 2002 04:16:28 -0700 Subject: [PATCH] md 10 of 22 - Remove nb_dev from mddev_s The nb_dev field is not needed. Most uses are the test if it is zero or not, and they can be replaced by tests on the emptiness of the disks list. Other uses are for iterating through devices in numerical order and it makes the code clearer (IMO) to unroll the devices into an array first (which has to be done at some stage anyway) and then walk that array. This makes ITERATE_RDEV_ORDERED un-necessary. Also remove the "name" field which is never used. --- include/linux/raid/md.h | 1 - include/linux/raid/md_k.h | 9 --------- 2 files changed, 10 deletions(-) (limited to 'include/linux/raid') diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index cb6332482af2..c5516ee0c732 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h @@ -82,7 +82,6 @@ extern int md_do_sync(mddev_t *mddev, mdp_disk_t *spare); extern void md_done_sync(mddev_t *mddev, int blocks, int ok); extern void md_sync_acct(kdev_t dev, unsigned long nr_sectors); extern void md_recover_arrays (void); -extern int md_check_ordering (mddev_t *mddev); extern int md_notify_reboot(struct notifier_block *this, unsigned long code, void *x); extern int md_error (mddev_t *mddev, struct block_device *bdev); diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 5734a0275ee7..69466cd714e7 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -196,14 +196,12 @@ struct mddev_s mdk_personality_t *pers; int __minor; mdp_super_t *sb; - int nb_dev; struct list_head disks; int sb_dirty; int ro; unsigned long curr_resync; /* blocks scheduled */ unsigned long resync_mark; /* a recent timestamp */ unsigned long resync_mark_cnt;/* blocks written at resync_mark */ - char *name; int recovery_running; struct semaphore reconfig_sem; struct semaphore recovery_sem; @@ -280,13 +278,6 @@ extern mdp_disk_t *get_spare(mddev_t *mddev); #define ITERATE_RDEV(mddev,rdev,tmp) \ ITERATE_RDEV_GENERIC((mddev)->disks,same_set,rdev,tmp) -/* - * Same as above, but assumes that the device has rdev->desc_nr numbered - * from 0 to mddev->nb_dev, and iterates through rdevs in ascending order. - */ -#define ITERATE_RDEV_ORDERED(mddev,rdev,i) \ - for (i = 0; rdev = find_rdev_nr(mddev, i), i < mddev->nb_dev; i++) - /* * Iterates through all 'RAID managed disks' -- cgit v1.2.3