aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-11-16 10:29:16 -0500
committerAlex Elder <elder@inktank.com>2012-12-20 11:56:44 -0500
commitc3e946ce7276faf0b302acd25c7b874edbeba661 (patch)
tree8352894ced729e1eb0397574c5508f0e9a61a192
parentc89ce05e0c5a01a256100ac6a6019f276bdd1ca6 (diff)
rbd: get rid of rbd_{get,put}_dev()
The functions rbd_get_dev() and rbd_put_dev() are trivial wrappers that add no value, and their existence suggests they may do more than what they do. Get rid of them. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Dan Mick <dan.mick@inktank.com>
-rw-r--r--drivers/block/rbd.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 4daa400c13aa..89576a0b3f2e 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -290,16 +290,6 @@ static struct device rbd_root_dev = {
290# define rbd_assert(expr) ((void) 0) 290# define rbd_assert(expr) ((void) 0)
291#endif /* !RBD_DEBUG */ 291#endif /* !RBD_DEBUG */
292 292
293static struct device *rbd_get_dev(struct rbd_device *rbd_dev)
294{
295 return get_device(&rbd_dev->dev);
296}
297
298static void rbd_put_dev(struct rbd_device *rbd_dev)
299{
300 put_device(&rbd_dev->dev);
301}
302
303static int rbd_dev_refresh(struct rbd_device *rbd_dev, u64 *hver); 293static int rbd_dev_refresh(struct rbd_device *rbd_dev, u64 *hver);
304static int rbd_dev_v2_refresh(struct rbd_device *rbd_dev, u64 *hver); 294static int rbd_dev_v2_refresh(struct rbd_device *rbd_dev, u64 *hver);
305 295
@@ -311,7 +301,7 @@ static int rbd_open(struct block_device *bdev, fmode_t mode)
311 return -EROFS; 301 return -EROFS;
312 302
313 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); 303 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
314 rbd_get_dev(rbd_dev); 304 (void) get_device(&rbd_dev->dev);
315 set_device_ro(bdev, rbd_dev->mapping.read_only); 305 set_device_ro(bdev, rbd_dev->mapping.read_only);
316 rbd_dev->open_count++; 306 rbd_dev->open_count++;
317 mutex_unlock(&ctl_mutex); 307 mutex_unlock(&ctl_mutex);
@@ -326,7 +316,7 @@ static int rbd_release(struct gendisk *disk, fmode_t mode)
326 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); 316 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
327 rbd_assert(rbd_dev->open_count > 0); 317 rbd_assert(rbd_dev->open_count > 0);
328 rbd_dev->open_count--; 318 rbd_dev->open_count--;
329 rbd_put_dev(rbd_dev); 319 put_device(&rbd_dev->dev);
330 mutex_unlock(&ctl_mutex); 320 mutex_unlock(&ctl_mutex);
331 321
332 return 0; 322 return 0;