Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b480815a authored by Alex Elder's avatar Alex Elder Committed by Sage Weil
Browse files

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: default avatarAlex Elder <elder@inktank.com>
Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
parent d1cf5788
Loading
Loading
Loading
Loading
+4 −9
Original line number Original line Diff line number Diff line
@@ -4992,12 +4992,6 @@ static void rbd_dev_release(struct device *dev)
	module_put(THIS_MODULE);
	module_put(THIS_MODULE);
}
}


static void __rbd_remove(struct rbd_device *rbd_dev)
{
	rbd_remove_all_snaps(rbd_dev);
	rbd_bus_del_dev(rbd_dev);
}

static void rbd_dev_remove_parent(struct rbd_device *rbd_dev)
static void rbd_dev_remove_parent(struct rbd_device *rbd_dev)
{
{
	while (rbd_dev->parent_spec) {
	while (rbd_dev->parent_spec) {
@@ -5013,7 +5007,8 @@ static void rbd_dev_remove_parent(struct rbd_device *rbd_dev)
			first = second;
			first = second;
			second = third;
			second = third;
		}
		}
		__rbd_remove(second);
		rbd_remove_all_snaps(second);
		rbd_bus_del_dev(second);
		rbd_spec_put(first->parent_spec);
		rbd_spec_put(first->parent_spec);
		first->parent_spec = NULL;
		first->parent_spec = NULL;
		first->parent_overlap = 0;
		first->parent_overlap = 0;
@@ -5058,8 +5053,8 @@ static ssize_t rbd_remove(struct bus_type *bus,


	rbd_dev_remove_parent(rbd_dev);
	rbd_dev_remove_parent(rbd_dev);


	__rbd_remove(rbd_dev);
	rbd_remove_all_snaps(rbd_dev);

	rbd_bus_del_dev(rbd_dev);
done:
done:
	mutex_unlock(&ctl_mutex);
	mutex_unlock(&ctl_mutex);