aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-07-19 10:09:27 -0400
committerSage Weil <sage@inktank.com>2012-07-30 21:15:51 -0400
commit14e7085d8460bf45e7145524a13802f1f4f9d81f (patch)
tree833a6188b29aec61637be04cb81179167371914f /drivers/block
parented63f4fd9a88218ee709e8f57c36c0c5f219a7ad (diff)
rbd: drop rbd_dev parameter in snap functions
Both rbd_register_snap_dev() and __rbd_remove_snap_dev() have rbd_dev parameters that are unused. Remove them. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 34ca5c686b46..9e960c3ce1c4 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -202,8 +202,7 @@ static ssize_t rbd_snap_add(struct device *dev,
202 struct device_attribute *attr, 202 struct device_attribute *attr,
203 const char *buf, 203 const char *buf,
204 size_t count); 204 size_t count);
205static void __rbd_remove_snap_dev(struct rbd_device *rbd_dev, 205static void __rbd_remove_snap_dev(struct rbd_snap *snap);
206 struct rbd_snap *snap);
207 206
208static ssize_t rbd_add(struct bus_type *bus, const char *buf, 207static ssize_t rbd_add(struct bus_type *bus, const char *buf,
209 size_t count); 208 size_t count);
@@ -1702,7 +1701,7 @@ static void __rbd_remove_all_snaps(struct rbd_device *rbd_dev)
1702 struct rbd_snap *next; 1701 struct rbd_snap *next;
1703 1702
1704 list_for_each_entry_safe(snap, next, &rbd_dev->snaps, node) 1703 list_for_each_entry_safe(snap, next, &rbd_dev->snaps, node)
1705 __rbd_remove_snap_dev(rbd_dev, snap); 1704 __rbd_remove_snap_dev(snap);
1706} 1705}
1707 1706
1708/* 1707/*
@@ -2010,15 +2009,13 @@ static struct device_type rbd_snap_device_type = {
2010 .release = rbd_snap_dev_release, 2009 .release = rbd_snap_dev_release,
2011}; 2010};
2012 2011
2013static void __rbd_remove_snap_dev(struct rbd_device *rbd_dev, 2012static void __rbd_remove_snap_dev(struct rbd_snap *snap)
2014 struct rbd_snap *snap)
2015{ 2013{
2016 list_del(&snap->node); 2014 list_del(&snap->node);
2017 device_unregister(&snap->dev); 2015 device_unregister(&snap->dev);
2018} 2016}
2019 2017
2020static int rbd_register_snap_dev(struct rbd_device *rbd_dev, 2018static int rbd_register_snap_dev(struct rbd_snap *snap,
2021 struct rbd_snap *snap,
2022 struct device *parent) 2019 struct device *parent)
2023{ 2020{
2024 struct device *dev = &snap->dev; 2021 struct device *dev = &snap->dev;
@@ -2045,8 +2042,7 @@ static int __rbd_add_snap_dev(struct rbd_device *rbd_dev,
2045 snap->size = rbd_dev->header.snap_sizes[i]; 2042 snap->size = rbd_dev->header.snap_sizes[i];
2046 snap->id = rbd_dev->header.snapc->snaps[i]; 2043 snap->id = rbd_dev->header.snapc->snaps[i];
2047 if (device_is_registered(&rbd_dev->dev)) { 2044 if (device_is_registered(&rbd_dev->dev)) {
2048 ret = rbd_register_snap_dev(rbd_dev, snap, 2045 ret = rbd_register_snap_dev(snap, &rbd_dev->dev);
2049 &rbd_dev->dev);
2050 if (ret < 0) 2046 if (ret < 0)
2051 goto err; 2047 goto err;
2052 } 2048 }
@@ -2111,7 +2107,7 @@ static int __rbd_init_snaps_header(struct rbd_device *rbd_dev)
2111 */ 2107 */
2112 if (rbd_dev->snap_id == old_snap->id) 2108 if (rbd_dev->snap_id == old_snap->id)
2113 rbd_dev->snap_exists = false; 2109 rbd_dev->snap_exists = false;
2114 __rbd_remove_snap_dev(rbd_dev, old_snap); 2110 __rbd_remove_snap_dev(old_snap);
2115 continue; 2111 continue;
2116 } 2112 }
2117 if (old_snap->id == cur_id) { 2113 if (old_snap->id == cur_id) {
@@ -2175,8 +2171,7 @@ static int rbd_bus_add_dev(struct rbd_device *rbd_dev)
2175 goto out; 2171 goto out;
2176 2172
2177 list_for_each_entry(snap, &rbd_dev->snaps, node) { 2173 list_for_each_entry(snap, &rbd_dev->snaps, node) {
2178 ret = rbd_register_snap_dev(rbd_dev, snap, 2174 ret = rbd_register_snap_dev(snap, &rbd_dev->dev);
2179 &rbd_dev->dev);
2180 if (ret < 0) 2175 if (ret < 0)
2181 break; 2176 break;
2182 } 2177 }