diff options
-rw-r--r-- | drivers/block/rbd.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index ae223819bbf0..6748fe2d67d6 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -788,7 +788,7 @@ static int rbd_header_from_disk(struct rbd_device *rbd_dev, | |||
788 | * Copy the names, and fill in each snapshot's id | 788 | * Copy the names, and fill in each snapshot's id |
789 | * and size. | 789 | * and size. |
790 | * | 790 | * |
791 | * Note that rbd_dev_v1_header_read() guarantees the | 791 | * Note that rbd_dev_v1_header_info() guarantees the |
792 | * ondisk buffer we're working with has | 792 | * ondisk buffer we're working with has |
793 | * snap_names_len bytes beyond the end of the | 793 | * snap_names_len bytes beyond the end of the |
794 | * snapshot id array, this memcpy() is safe. | 794 | * snapshot id array, this memcpy() is safe. |
@@ -3050,7 +3050,7 @@ out: | |||
3050 | * return, the rbd_dev->header field will contain up-to-date | 3050 | * return, the rbd_dev->header field will contain up-to-date |
3051 | * information about the image. | 3051 | * information about the image. |
3052 | */ | 3052 | */ |
3053 | static int rbd_dev_v1_header_read(struct rbd_device *rbd_dev) | 3053 | static int rbd_dev_v1_header_info(struct rbd_device *rbd_dev) |
3054 | { | 3054 | { |
3055 | struct rbd_image_header_ondisk *ondisk = NULL; | 3055 | struct rbd_image_header_ondisk *ondisk = NULL; |
3056 | u32 snap_count = 0; | 3056 | u32 snap_count = 0; |
@@ -3106,14 +3106,6 @@ out: | |||
3106 | } | 3106 | } |
3107 | 3107 | ||
3108 | /* | 3108 | /* |
3109 | * only read the first part of the ondisk header, without the snaps info | ||
3110 | */ | ||
3111 | static int rbd_dev_v1_refresh(struct rbd_device *rbd_dev) | ||
3112 | { | ||
3113 | return rbd_dev_v1_header_read(rbd_dev); | ||
3114 | } | ||
3115 | |||
3116 | /* | ||
3117 | * Clear the rbd device's EXISTS flag if the snapshot it's mapped to | 3109 | * Clear the rbd device's EXISTS flag if the snapshot it's mapped to |
3118 | * has disappeared from the (just updated) snapshot context. | 3110 | * has disappeared from the (just updated) snapshot context. |
3119 | */ | 3111 | */ |
@@ -3141,7 +3133,7 @@ static int rbd_dev_refresh(struct rbd_device *rbd_dev) | |||
3141 | mapping_size = rbd_dev->mapping.size; | 3133 | mapping_size = rbd_dev->mapping.size; |
3142 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); | 3134 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); |
3143 | if (rbd_dev->image_format == 1) | 3135 | if (rbd_dev->image_format == 1) |
3144 | ret = rbd_dev_v1_refresh(rbd_dev); | 3136 | ret = rbd_dev_v1_header_info(rbd_dev); |
3145 | else | 3137 | else |
3146 | ret = rbd_dev_v2_refresh(rbd_dev); | 3138 | ret = rbd_dev_v2_refresh(rbd_dev); |
3147 | 3139 | ||
@@ -4467,11 +4459,6 @@ static void rbd_dev_unprobe(struct rbd_device *rbd_dev) | |||
4467 | memset(header, 0, sizeof (*header)); | 4459 | memset(header, 0, sizeof (*header)); |
4468 | } | 4460 | } |
4469 | 4461 | ||
4470 | static int rbd_dev_v1_probe(struct rbd_device *rbd_dev) | ||
4471 | { | ||
4472 | return rbd_dev_v1_header_read(rbd_dev); | ||
4473 | } | ||
4474 | |||
4475 | static int rbd_dev_v2_probe(struct rbd_device *rbd_dev) | 4462 | static int rbd_dev_v2_probe(struct rbd_device *rbd_dev) |
4476 | { | 4463 | { |
4477 | int ret; | 4464 | int ret; |
@@ -4714,7 +4701,7 @@ static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool read_only) | |||
4714 | goto out_header_name; | 4701 | goto out_header_name; |
4715 | 4702 | ||
4716 | if (rbd_dev->image_format == 1) | 4703 | if (rbd_dev->image_format == 1) |
4717 | ret = rbd_dev_v1_probe(rbd_dev); | 4704 | ret = rbd_dev_v1_header_info(rbd_dev); |
4718 | else | 4705 | else |
4719 | ret = rbd_dev_v2_probe(rbd_dev); | 4706 | ret = rbd_dev_v2_probe(rbd_dev); |
4720 | if (ret) | 4707 | if (ret) |