Commit fb56dfef authored by Goldwyn Rodrigues's avatar Goldwyn Rodrigues Committed by NeilBrown

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: default avatarGoldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 8c58f02e
...@@ -2168,11 +2168,12 @@ static void export_rdev(struct md_rdev *rdev) ...@@ -2168,11 +2168,12 @@ static void export_rdev(struct md_rdev *rdev)
kobject_put(&rdev->kobj); kobject_put(&rdev->kobj);
} }
static void kick_rdev_from_array(struct md_rdev *rdev) void md_kick_rdev_from_array(struct md_rdev *rdev)
{ {
unbind_rdev_from_array(rdev); unbind_rdev_from_array(rdev);
export_rdev(rdev); export_rdev(rdev);
} }
EXPORT_SYMBOL_GPL(md_kick_rdev_from_array);
static void export_array(struct mddev *mddev) static void export_array(struct mddev *mddev)
{ {
...@@ -2181,7 +2182,7 @@ static void export_array(struct mddev *mddev) ...@@ -2181,7 +2182,7 @@ static void export_array(struct mddev *mddev)
while (!list_empty(&mddev->disks)) { while (!list_empty(&mddev->disks)) {
rdev = list_first_entry(&mddev->disks, struct md_rdev, rdev = list_first_entry(&mddev->disks, struct md_rdev,
same_set); same_set);
kick_rdev_from_array(rdev); md_kick_rdev_from_array(rdev);
} }
mddev->raid_disks = 0; mddev->raid_disks = 0;
mddev->major_version = 0; mddev->major_version = 0;
...@@ -2476,7 +2477,7 @@ state_store(struct md_rdev *rdev, const char *buf, size_t len) ...@@ -2476,7 +2477,7 @@ state_store(struct md_rdev *rdev, const char *buf, size_t len)
struct mddev *mddev = rdev->mddev; struct mddev *mddev = rdev->mddev;
if (mddev_is_clustered(mddev)) if (mddev_is_clustered(mddev))
md_cluster_ops->metadata_update_start(mddev); md_cluster_ops->metadata_update_start(mddev);
kick_rdev_from_array(rdev); md_kick_rdev_from_array(rdev);
if (mddev->pers) if (mddev->pers)
md_update_sb(mddev, 1); md_update_sb(mddev, 1);
md_new_event(mddev); md_new_event(mddev);
...@@ -3134,7 +3135,7 @@ static void analyze_sbs(struct mddev *mddev) ...@@ -3134,7 +3135,7 @@ static void analyze_sbs(struct mddev *mddev)
"md: fatal superblock inconsistency in %s" "md: fatal superblock inconsistency in %s"
" -- removing from array\n", " -- removing from array\n",
bdevname(rdev->bdev,b)); bdevname(rdev->bdev,b));
kick_rdev_from_array(rdev); md_kick_rdev_from_array(rdev);
} }
super_types[mddev->major_version]. super_types[mddev->major_version].
...@@ -3149,7 +3150,7 @@ static void analyze_sbs(struct mddev *mddev) ...@@ -3149,7 +3150,7 @@ static void analyze_sbs(struct mddev *mddev)
"md: %s: %s: only %d devices permitted\n", "md: %s: %s: only %d devices permitted\n",
mdname(mddev), bdevname(rdev->bdev, b), mdname(mddev), bdevname(rdev->bdev, b),
mddev->max_disks); mddev->max_disks);
kick_rdev_from_array(rdev); md_kick_rdev_from_array(rdev);
continue; continue;
} }
if (rdev != freshest) { if (rdev != freshest) {
...@@ -3158,7 +3159,7 @@ static void analyze_sbs(struct mddev *mddev) ...@@ -3158,7 +3159,7 @@ static void analyze_sbs(struct mddev *mddev)
printk(KERN_WARNING "md: kicking non-fresh %s" printk(KERN_WARNING "md: kicking non-fresh %s"
" from array!\n", " from array!\n",
bdevname(rdev->bdev,b)); bdevname(rdev->bdev,b));
kick_rdev_from_array(rdev); md_kick_rdev_from_array(rdev);
continue; continue;
} }
/* No device should have a Candidate flag /* No device should have a Candidate flag
...@@ -3167,7 +3168,7 @@ static void analyze_sbs(struct mddev *mddev) ...@@ -3167,7 +3168,7 @@ static void analyze_sbs(struct mddev *mddev)
if (test_bit(Candidate, &rdev->flags)) { if (test_bit(Candidate, &rdev->flags)) {
pr_info("md: kicking Cluster Candidate %s from array!\n", pr_info("md: kicking Cluster Candidate %s from array!\n",
bdevname(rdev->bdev, b)); bdevname(rdev->bdev, b));
kick_rdev_from_array(rdev); md_kick_rdev_from_array(rdev);
} }
} }
if (mddev->level == LEVEL_MULTIPATH) { if (mddev->level == LEVEL_MULTIPATH) {
...@@ -5966,7 +5967,7 @@ static int hot_remove_disk(struct mddev *mddev, dev_t dev) ...@@ -5966,7 +5967,7 @@ static int hot_remove_disk(struct mddev *mddev, dev_t dev)
if (rdev->raid_disk >= 0) if (rdev->raid_disk >= 0)
goto busy; goto busy;
kick_rdev_from_array(rdev); md_kick_rdev_from_array(rdev);
md_update_sb(mddev, 1); md_update_sb(mddev, 1);
md_new_event(mddev); md_new_event(mddev);
......
...@@ -671,6 +671,7 @@ extern struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs, ...@@ -671,6 +671,7 @@ extern struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs,
extern void md_unplug(struct blk_plug_cb *cb, bool from_schedule); extern void md_unplug(struct blk_plug_cb *cb, bool from_schedule);
extern void md_reload_sb(struct mddev *mddev); extern void md_reload_sb(struct mddev *mddev);
extern void md_update_sb(struct mddev *mddev, int force); extern void md_update_sb(struct mddev *mddev, int force);
extern void md_kick_rdev_from_array(struct md_rdev * rdev);
static inline int mddev_check_plugged(struct mddev *mddev) static inline int mddev_check_plugged(struct mddev *mddev)
{ {
return !!blk_check_plugged(md_unplug, mddev, return !!blk_check_plugged(md_unplug, mddev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment