aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorJosh Durgin <josh.durgin@dreamhost.com>2011-12-05 13:43:42 -0500
committerAlex Elder <elder@dreamhost.com>2012-05-14 13:13:09 -0400
commit263c6ca007a6693fb724a24c5a55716c49d33573 (patch)
tree5fce498f80244db3944b3a21bba207572afd2f93 /drivers/block
parent3591538fb272d2432d112d47d7e0ddd0be4cded2 (diff)
rbd: rename __rbd_update_snaps to __rbd_refresh_header
This function rereads the entire header and handles any changes in it, not just changes in snapshots. Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com> Reviewed-by: Alex Elder <elder@dreamhost.com> Reviewed-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 83597965c486..65665c9c42c6 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -240,7 +240,7 @@ static void rbd_put_dev(struct rbd_device *rbd_dev)
240 put_device(&rbd_dev->dev); 240 put_device(&rbd_dev->dev);
241} 241}
242 242
243static int __rbd_update_snaps(struct rbd_device *rbd_dev); 243static int __rbd_refresh_header(struct rbd_device *rbd_dev);
244 244
245static int rbd_open(struct block_device *bdev, fmode_t mode) 245static int rbd_open(struct block_device *bdev, fmode_t mode)
246{ 246{
@@ -1222,7 +1222,7 @@ static void rbd_watch_cb(u64 ver, u64 notify_id, u8 opcode, void *data)
1222 dout("rbd_watch_cb %s notify_id=%lld opcode=%d\n", dev->obj_md_name, 1222 dout("rbd_watch_cb %s notify_id=%lld opcode=%d\n", dev->obj_md_name,
1223 notify_id, (int)opcode); 1223 notify_id, (int)opcode);
1224 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); 1224 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
1225 rc = __rbd_update_snaps(dev); 1225 rc = __rbd_refresh_header(dev);
1226 mutex_unlock(&ctl_mutex); 1226 mutex_unlock(&ctl_mutex);
1227 if (rc) 1227 if (rc)
1228 pr_warning(RBD_DRV_NAME "%d got notification but failed to " 1228 pr_warning(RBD_DRV_NAME "%d got notification but failed to "
@@ -1689,7 +1689,7 @@ static void __rbd_remove_all_snaps(struct rbd_device *rbd_dev)
1689/* 1689/*
1690 * only read the first part of the ondisk header, without the snaps info 1690 * only read the first part of the ondisk header, without the snaps info
1691 */ 1691 */
1692static int __rbd_update_snaps(struct rbd_device *rbd_dev) 1692static int __rbd_refresh_header(struct rbd_device *rbd_dev)
1693{ 1693{
1694 int ret; 1694 int ret;
1695 struct rbd_image_header h; 1695 struct rbd_image_header h;
@@ -1876,7 +1876,7 @@ static ssize_t rbd_image_refresh(struct device *dev,
1876 1876
1877 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); 1877 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
1878 1878
1879 rc = __rbd_update_snaps(rbd_dev); 1879 rc = __rbd_refresh_header(rbd_dev);
1880 if (rc < 0) 1880 if (rc < 0)
1881 ret = rc; 1881 ret = rc;
1882 1882
@@ -2159,7 +2159,7 @@ static int rbd_init_watch_dev(struct rbd_device *rbd_dev)
2159 rbd_dev->header.obj_version); 2159 rbd_dev->header.obj_version);
2160 if (ret == -ERANGE) { 2160 if (ret == -ERANGE) {
2161 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); 2161 mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
2162 rc = __rbd_update_snaps(rbd_dev); 2162 rc = __rbd_refresh_header(rbd_dev);
2163 mutex_unlock(&ctl_mutex); 2163 mutex_unlock(&ctl_mutex);
2164 if (rc < 0) 2164 if (rc < 0)
2165 return rc; 2165 return rc;
@@ -2544,7 +2544,7 @@ static ssize_t rbd_snap_add(struct device *dev,
2544 if (ret < 0) 2544 if (ret < 0)
2545 goto err_unlock; 2545 goto err_unlock;
2546 2546
2547 ret = __rbd_update_snaps(rbd_dev); 2547 ret = __rbd_refresh_header(rbd_dev);
2548 if (ret < 0) 2548 if (ret < 0)
2549 goto err_unlock; 2549 goto err_unlock;
2550 2550