diff options
author | Goldwyn Rodrigues <rgoldwyn@suse.de> | 2015-04-14 11:43:24 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2015-04-21 17:59:39 -0400 |
commit | fb56dfef4e31f214cfbfa0eb8a1949591c20b118 (patch) | |
tree | 62421135b80e9abc3f2668e38db57a71ead02480 | |
parent | 8c58f02e244d5b35fa38aa308007715d4957d4c7 (diff) |
md: Export and rename kick_rdev_from_array
This export is required for clustering module in order to
co-ordinate remove/readd a rdev from all nodes.
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r-- | drivers/md/md.c | 17 | ||||
-rw-r--r-- | drivers/md/md.h | 1 |
2 files changed, 10 insertions, 8 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index eb6f92e57ab6..bc1e43014292 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -2168,11 +2168,12 @@ static void export_rdev(struct md_rdev *rdev) | |||
2168 | kobject_put(&rdev->kobj); | 2168 | kobject_put(&rdev->kobj); |
2169 | } | 2169 | } |
2170 | 2170 | ||
2171 | static void kick_rdev_from_array(struct md_rdev *rdev) | 2171 | void md_kick_rdev_from_array(struct md_rdev *rdev) |
2172 | { | 2172 | { |
2173 | unbind_rdev_from_array(rdev); | 2173 | unbind_rdev_from_array(rdev); |
2174 | export_rdev(rdev); | 2174 | export_rdev(rdev); |
2175 | } | 2175 | } |
2176 | EXPORT_SYMBOL_GPL(md_kick_rdev_from_array); | ||
2176 | 2177 | ||
2177 | static void export_array(struct mddev *mddev) | 2178 | static void export_array(struct mddev *mddev) |
2178 | { | 2179 | { |
@@ -2181,7 +2182,7 @@ static void export_array(struct mddev *mddev) | |||
2181 | while (!list_empty(&mddev->disks)) { | 2182 | while (!list_empty(&mddev->disks)) { |
2182 | rdev = list_first_entry(&mddev->disks, struct md_rdev, | 2183 | rdev = list_first_entry(&mddev->disks, struct md_rdev, |
2183 | same_set); | 2184 | same_set); |
2184 | kick_rdev_from_array(rdev); | 2185 | md_kick_rdev_from_array(rdev); |
2185 | } | 2186 | } |
2186 | mddev->raid_disks = 0; | 2187 | mddev->raid_disks = 0; |
2187 | mddev->major_version = 0; | 2188 | mddev->major_version = 0; |
@@ -2476,7 +2477,7 @@ state_store(struct md_rdev *rdev, const char *buf, size_t len) | |||
2476 | struct mddev *mddev = rdev->mddev; | 2477 | struct mddev *mddev = rdev->mddev; |
2477 | if (mddev_is_clustered(mddev)) | 2478 | if (mddev_is_clustered(mddev)) |
2478 | md_cluster_ops->metadata_update_start(mddev); | 2479 | md_cluster_ops->metadata_update_start(mddev); |
2479 | kick_rdev_from_array(rdev); | 2480 | md_kick_rdev_from_array(rdev); |
2480 | if (mddev->pers) | 2481 | if (mddev->pers) |
2481 | md_update_sb(mddev, 1); | 2482 | md_update_sb(mddev, 1); |
2482 | md_new_event(mddev); | 2483 | md_new_event(mddev); |
@@ -3134,7 +3135,7 @@ static void analyze_sbs(struct mddev *mddev) | |||
3134 | "md: fatal superblock inconsistency in %s" | 3135 | "md: fatal superblock inconsistency in %s" |
3135 | " -- removing from array\n", | 3136 | " -- removing from array\n", |
3136 | bdevname(rdev->bdev,b)); | 3137 | bdevname(rdev->bdev,b)); |
3137 | kick_rdev_from_array(rdev); | 3138 | md_kick_rdev_from_array(rdev); |
3138 | } | 3139 | } |
3139 | 3140 | ||
3140 | super_types[mddev->major_version]. | 3141 | super_types[mddev->major_version]. |
@@ -3149,7 +3150,7 @@ static void analyze_sbs(struct mddev *mddev) | |||
3149 | "md: %s: %s: only %d devices permitted\n", | 3150 | "md: %s: %s: only %d devices permitted\n", |
3150 | mdname(mddev), bdevname(rdev->bdev, b), | 3151 | mdname(mddev), bdevname(rdev->bdev, b), |
3151 | mddev->max_disks); | 3152 | mddev->max_disks); |
3152 | kick_rdev_from_array(rdev); | 3153 | md_kick_rdev_from_array(rdev); |
3153 | continue; | 3154 | continue; |
3154 | } | 3155 | } |
3155 | if (rdev != freshest) { | 3156 | if (rdev != freshest) { |
@@ -3158,7 +3159,7 @@ static void analyze_sbs(struct mddev *mddev) | |||
3158 | printk(KERN_WARNING "md: kicking non-fresh %s" | 3159 | printk(KERN_WARNING "md: kicking non-fresh %s" |
3159 | " from array!\n", | 3160 | " from array!\n", |
3160 | bdevname(rdev->bdev,b)); | 3161 | bdevname(rdev->bdev,b)); |
3161 | kick_rdev_from_array(rdev); | 3162 | md_kick_rdev_from_array(rdev); |
3162 | continue; | 3163 | continue; |
3163 | } | 3164 | } |
3164 | /* No device should have a Candidate flag | 3165 | /* No device should have a Candidate flag |
@@ -3167,7 +3168,7 @@ static void analyze_sbs(struct mddev *mddev) | |||
3167 | if (test_bit(Candidate, &rdev->flags)) { | 3168 | if (test_bit(Candidate, &rdev->flags)) { |
3168 | pr_info("md: kicking Cluster Candidate %s from array!\n", | 3169 | pr_info("md: kicking Cluster Candidate %s from array!\n", |
3169 | bdevname(rdev->bdev, b)); | 3170 | bdevname(rdev->bdev, b)); |
3170 | kick_rdev_from_array(rdev); | 3171 | md_kick_rdev_from_array(rdev); |
3171 | } | 3172 | } |
3172 | } | 3173 | } |
3173 | if (mddev->level == LEVEL_MULTIPATH) { | 3174 | if (mddev->level == LEVEL_MULTIPATH) { |
@@ -5966,7 +5967,7 @@ static int hot_remove_disk(struct mddev *mddev, dev_t dev) | |||
5966 | if (rdev->raid_disk >= 0) | 5967 | if (rdev->raid_disk >= 0) |
5967 | goto busy; | 5968 | goto busy; |
5968 | 5969 | ||
5969 | kick_rdev_from_array(rdev); | 5970 | md_kick_rdev_from_array(rdev); |
5970 | md_update_sb(mddev, 1); | 5971 | md_update_sb(mddev, 1); |
5971 | md_new_event(mddev); | 5972 | md_new_event(mddev); |
5972 | 5973 | ||
diff --git a/drivers/md/md.h b/drivers/md/md.h index 6dc0ce09f50c..d98c0d764d8f 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h | |||
@@ -671,6 +671,7 @@ extern struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs, | |||
671 | extern void md_unplug(struct blk_plug_cb *cb, bool from_schedule); | 671 | extern void md_unplug(struct blk_plug_cb *cb, bool from_schedule); |
672 | extern void md_reload_sb(struct mddev *mddev); | 672 | extern void md_reload_sb(struct mddev *mddev); |
673 | extern void md_update_sb(struct mddev *mddev, int force); | 673 | extern void md_update_sb(struct mddev *mddev, int force); |
674 | extern void md_kick_rdev_from_array(struct md_rdev * rdev); | ||
674 | static inline int mddev_check_plugged(struct mddev *mddev) | 675 | static inline int mddev_check_plugged(struct mddev *mddev) |
675 | { | 676 | { |
676 | return !!blk_check_plugged(md_unplug, mddev, | 677 | return !!blk_check_plugged(md_unplug, mddev, |