aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/rbd.c
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-07-10 21:30:09 -0400
committerSage Weil <sage@inktank.com>2012-07-30 12:29:59 -0400
commitca1e49a6afe87ea4e2d3e73e10d1d3c0fad2aa3f (patch)
tree58d4d398687c155824eb248211a11fe0d59d1058 /drivers/block/rbd.c
parentea3352f4aa4fc32397d9a535780315e0f2bfee15 (diff)
rbd: rename rbd_dev->block_name
Each rbd image has a name that forms the basis of all data objects backing the device. Old (format 1) images refer to this name as the "block name," while new (format 2) images use the term "object prefix" for this. Change the field name in the in-core rbd image header structure to reflect the more modern usage. We intentionally keep the the name "block_name" in the on-disk definition for format 1 image headers. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Yehuda Sadeh <yehuda@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block/rbd.c')
-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 384694f40b44..523413bdca92 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -78,7 +78,7 @@
78 */ 78 */
79struct rbd_image_header { 79struct rbd_image_header {
80 u64 image_size; 80 u64 image_size;
81 char block_name[32]; 81 char object_prefix[32];
82 __u8 obj_order; 82 __u8 obj_order;
83 __u8 crypt_type; 83 __u8 crypt_type;
84 __u8 comp_type; 84 __u8 comp_type;
@@ -518,7 +518,7 @@ static int rbd_header_from_disk(struct rbd_image_header *header,
518 header->snap_names = NULL; 518 header->snap_names = NULL;
519 header->snap_sizes = NULL; 519 header->snap_sizes = NULL;
520 } 520 }
521 memcpy(header->block_name, ondisk->block_name, 521 memcpy(header->object_prefix, ondisk->block_name,
522 sizeof(ondisk->block_name)); 522 sizeof(ondisk->block_name));
523 523
524 header->image_size = le64_to_cpu(ondisk->image_size); 524 header->image_size = le64_to_cpu(ondisk->image_size);
@@ -620,7 +620,7 @@ static void rbd_header_free(struct rbd_image_header *header)
620 * get the actual striped segment name, offset and length 620 * get the actual striped segment name, offset and length
621 */ 621 */
622static u64 rbd_get_segment(struct rbd_image_header *header, 622static u64 rbd_get_segment(struct rbd_image_header *header,
623 const char *block_name, 623 const char *object_prefix,
624 u64 ofs, u64 len, 624 u64 ofs, u64 len,
625 char *seg_name, u64 *segofs) 625 char *seg_name, u64 *segofs)
626{ 626{
@@ -628,7 +628,7 @@ static u64 rbd_get_segment(struct rbd_image_header *header,
628 628
629 if (seg_name) 629 if (seg_name)
630 snprintf(seg_name, RBD_MAX_SEG_NAME_LEN, 630 snprintf(seg_name, RBD_MAX_SEG_NAME_LEN,
631 "%s.%012llx", block_name, seg); 631 "%s.%012llx", object_prefix, seg);
632 632
633 ofs = ofs & ((1 << header->obj_order) - 1); 633 ofs = ofs & ((1 << header->obj_order) - 1);
634 len = min_t(u64, len, (1 << header->obj_order) - ofs); 634 len = min_t(u64, len, (1 << header->obj_order) - ofs);
@@ -1091,7 +1091,7 @@ static int rbd_do_op(struct request *rq,
1091 return -ENOMEM; 1091 return -ENOMEM;
1092 1092
1093 seg_len = rbd_get_segment(&rbd_dev->header, 1093 seg_len = rbd_get_segment(&rbd_dev->header,
1094 rbd_dev->header.block_name, 1094 rbd_dev->header.object_prefix,
1095 ofs, len, 1095 ofs, len,
1096 seg_name, &seg_ofs); 1096 seg_name, &seg_ofs);
1097 1097
@@ -1482,7 +1482,7 @@ static void rbd_rq_fn(struct request_queue *q)
1482 /* a bio clone to be passed down to OSD req */ 1482 /* a bio clone to be passed down to OSD req */
1483 dout("rq->bio->bi_vcnt=%d\n", rq->bio->bi_vcnt); 1483 dout("rq->bio->bi_vcnt=%d\n", rq->bio->bi_vcnt);
1484 op_size = rbd_get_segment(&rbd_dev->header, 1484 op_size = rbd_get_segment(&rbd_dev->header,
1485 rbd_dev->header.block_name, 1485 rbd_dev->header.object_prefix,
1486 ofs, size, 1486 ofs, size,
1487 NULL, NULL); 1487 NULL, NULL);
1488 kref_get(&coll->kref); 1488 kref_get(&coll->kref);