提交 c3e946ce 编写于 作者: A Alex Elder

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: NAlex Elder <elder@inktank.com>
Reviewed-by: NDan Mick <dan.mick@inktank.com>
上级 c89ce05e
...@@ -290,16 +290,6 @@ static struct device rbd_root_dev = { ...@@ -290,16 +290,6 @@ static struct device rbd_root_dev = {
# define rbd_assert(expr) ((void) 0) # define rbd_assert(expr) ((void) 0)
#endif /* !RBD_DEBUG */ #endif /* !RBD_DEBUG */
static struct device *rbd_get_dev(struct rbd_device *rbd_dev)
{
return get_device(&rbd_dev->dev);
}
static void rbd_put_dev(struct rbd_device *rbd_dev)
{
put_device(&rbd_dev->dev);
}
static int rbd_dev_refresh(struct rbd_device *rbd_dev, u64 *hver); static int rbd_dev_refresh(struct rbd_device *rbd_dev, u64 *hver);
static int rbd_dev_v2_refresh(struct rbd_device *rbd_dev, u64 *hver); static int rbd_dev_v2_refresh(struct rbd_device *rbd_dev, u64 *hver);
...@@ -311,7 +301,7 @@ static int rbd_open(struct block_device *bdev, fmode_t mode) ...@@ -311,7 +301,7 @@ static int rbd_open(struct block_device *bdev, fmode_t mode)
return -EROFS; return -EROFS;
mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
rbd_get_dev(rbd_dev); (void) get_device(&rbd_dev->dev);
set_device_ro(bdev, rbd_dev->mapping.read_only); set_device_ro(bdev, rbd_dev->mapping.read_only);
rbd_dev->open_count++; rbd_dev->open_count++;
mutex_unlock(&ctl_mutex); mutex_unlock(&ctl_mutex);
...@@ -326,7 +316,7 @@ static int rbd_release(struct gendisk *disk, fmode_t mode) ...@@ -326,7 +316,7 @@ static int rbd_release(struct gendisk *disk, fmode_t mode)
mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
rbd_assert(rbd_dev->open_count > 0); rbd_assert(rbd_dev->open_count > 0);
rbd_dev->open_count--; rbd_dev->open_count--;
rbd_put_dev(rbd_dev); put_device(&rbd_dev->dev);
mutex_unlock(&ctl_mutex); mutex_unlock(&ctl_mutex);
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册