Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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>
  • Loading branch information...
commit c3e946ce7276faf0b302acd25c7b874edbeba661 1 parent c89ce05
Alex Elder alexelder authored

Showing 1 changed file with 2 additions and 12 deletions. Show diff stats Hide diff stats

  1. +2 12 drivers/block/rbd.c
14 drivers/block/rbd.c
@@ -290,16 +290,6 @@ static struct device rbd_root_dev = {
290 290 # define rbd_assert(expr) ((void) 0)
291 291 #endif /* !RBD_DEBUG */
292 292
293   -static struct device *rbd_get_dev(struct rbd_device *rbd_dev)
294   -{
295   - return get_device(&rbd_dev->dev);
296   -}
297   -
298   -static void rbd_put_dev(struct rbd_device *rbd_dev)
299   -{
300   - put_device(&rbd_dev->dev);
301   -}
302   -
303 293 static int rbd_dev_refresh(struct rbd_device *rbd_dev, u64 *hver);
304 294 static 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 301 return -EROFS;
312 302
313 303 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
314   - rbd_get_dev(rbd_dev);
  304 + (void) get_device(&rbd_dev->dev);
315 305 set_device_ro(bdev, rbd_dev->mapping.read_only);
316 306 rbd_dev->open_count++;
317 307 mutex_unlock(&ctl_mutex);
@@ -326,7 +316,7 @@ static int rbd_release(struct gendisk *disk, fmode_t mode)
326 316 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
327 317 rbd_assert(rbd_dev->open_count > 0);
328 318 rbd_dev->open_count--;
329   - rbd_put_dev(rbd_dev);
  319 + put_device(&rbd_dev->dev);
330 320 mutex_unlock(&ctl_mutex);
331 321
332 322 return 0;

0 comments on commit c3e946c

Please sign in to comment.
Something went wrong with that request. Please try again.