aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-04-26 16:44:36 -0400
committerSage Weil <sage@inktank.com>2013-05-02 00:19:53 -0400
commitb480815a17bc6bfe85d4931c53e5a8fded7f889e (patch)
treec7eb660756db8554fc95bf97fe55aaf155d9b3a2
parentd1cf5788450e1781f63a0626a854fe8309b32cb1 (diff)
rbd: kill __rbd_remove()
The function __rbd_remove() is used in two spots, and it's fairly simple. It combines cleanup of part of the ceph-side state as well as cleaning up the Linux-side state. Just open code it in the two callers and eliminate the function. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
-rw-r--r--drivers/block/rbd.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 98e0b8c3def8..0bae4e74555d 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -4992,12 +4992,6 @@ static void rbd_dev_release(struct device *dev)
4992 module_put(THIS_MODULE); 4992 module_put(THIS_MODULE);
4993} 4993}
4994 4994
4995static void __rbd_remove(struct rbd_device *rbd_dev)
4996{
4997 rbd_remove_all_snaps(rbd_dev);
4998 rbd_bus_del_dev(rbd_dev);
4999}
5000
5001static void rbd_dev_remove_parent(struct rbd_device *rbd_dev) 4995static void rbd_dev_remove_parent(struct rbd_device *rbd_dev)
5002{ 4996{
5003 while (rbd_dev->parent_spec) { 4997 while (rbd_dev->parent_spec) {
@@ -5013,7 +5007,8 @@ static void rbd_dev_remove_parent(struct rbd_device *rbd_dev)
5013 first = second; 5007 first = second;
5014 second = third; 5008 second = third;
5015 } 5009 }
5016 __rbd_remove(second); 5010 rbd_remove_all_snaps(second);
5011 rbd_bus_del_dev(second);
5017 rbd_spec_put(first->parent_spec); 5012 rbd_spec_put(first->parent_spec);
5018 first->parent_spec = NULL; 5013 first->parent_spec = NULL;
5019 first->parent_overlap = 0; 5014 first->parent_overlap = 0;
@@ -5058,8 +5053,8 @@ static ssize_t rbd_remove(struct bus_type *bus,
5058 5053
5059 rbd_dev_remove_parent(rbd_dev); 5054 rbd_dev_remove_parent(rbd_dev);
5060 5055
5061 __rbd_remove(rbd_dev); 5056 rbd_remove_all_snaps(rbd_dev);
5062 5057 rbd_bus_del_dev(rbd_dev);
5063done: 5058done:
5064 mutex_unlock(&ctl_mutex); 5059 mutex_unlock(&ctl_mutex);
5065 5060