Skip to contentSkip to conversation

rbd: rename block_name -> object_prefix

PATCH In review Alex Elder 3 participants 3 messages Sep 4, 2012

Subsystems (2)
lore
Share & tools
lore

Alex Elder

author
#0 lore raw

PATCH 1/1 rbd: rename block_name -> object_prefix

In the on-disk image header structure there is a field "block_name" which represents what we now call the "object prefix" for an rbd image. Rename this field "object_prefix" to be consistent with modern usage.

This appears to be the only remaining vestige of the use of "block" in symbols that represent objects in the rbd code.

This addresses http://tracker.newdream.net/issues/1761

---
 drivers/block/rbd.c       |    4 ++--
 drivers/block/rbd_types.h |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/block/rbd.c +0 -0
index fd51f9d..2b40a4a 100644
@@ -522,11 +522,11 @@ static int rbd_header_from_disk(struct

rbd_image_header *header,

snap_count = le32_to_cpu(ondisk->snap_count);

- size = sizeof (ondisk->block_name) + 1;
+ size = sizeof (ondisk->object_prefix) + 1;
header->object_prefix = kmalloc(size, GFP_KERNEL); if (!header->object_prefix)
return -ENOMEM;
- memcpy(header->object_prefix, ondisk->block_name, size - 1);
+ memcpy(header->object_prefix, ondisk->object_prefix, size - 1);
header->object_prefix[size - 1] = '\0';

if (snap_count) {

drivers/block/rbd_types.h +1 -1
index 0924e9e..d9d8a77 100644
@@ -47,7 +47,7 @@ struct rbd_image_snap_ondisk {
 
 struct rbd_image_header_ondisk {
 	char text[40];
-	char block_name[24];
+	char object_prefix[24];
 	char signature[4];
 	char version[8];
 	struct {
Signature · 1 line
1.7.9.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 49 lines · Alex Elder

In the on-disk image header structure there is a field "block_name" which represents what we now call the "object prefix" for an rbd image. Rename this field "object_prefix" to be consistent with modern usage.

This appears to be the only remaining vestige of the use of "block" in symbols that represent objects in the rbd code.

This addresses http://tracker.newdream.net/issues/1761

---
  drivers/block/rbd.c       |    4 ++--
  drivers/block/rbd_types.h |    2 +-
  2 files changed, 3 insertions(+), 3 deletions(-)
drivers/block/rbd.c +2 -2
index fd51f9d..2b40a4a 100644
@@ -522,11 +522,11 @@ static int rbd_header_from_disk(struct
 rbd_image_header *header,
 
  	snap_count = le32_to_cpu(ondisk->snap_count);
 
-	size = sizeof (ondisk->block_name) + 1;
+	size = sizeof (ondisk->object_prefix) + 1;
  	header->object_prefix = kmalloc(size, GFP_KERNEL);
  	if (!header->object_prefix)
  		return -ENOMEM;
-	memcpy(header->object_prefix, ondisk->block_name, size - 1);
+	memcpy(header->object_prefix, ondisk->object_prefix, size - 1);
  	header->object_prefix[size - 1] = '\0';
 
  	if (snap_count) {
drivers/block/rbd_types.h +1 -1
index 0924e9e..d9d8a77 100644
@@ -47,7 +47,7 @@ struct rbd_image_snap_ondisk {
 
  struct rbd_image_header_ondisk {
  	char text[40];
-	char block_name[24];
+	char object_prefix[24];
  	char signature[4];
  	char version[8];
  	struct {
Reviewed-by on v1 1/1
#2 lore raw
In reply to Alex Elder
Quoted 49 lines · Alex Elder

In the on-disk image header structure there is a field "block_name" which represents what we now call the "object prefix" for an rbd image. Rename this field "object_prefix" to be consistent with modern usage.

This appears to be the only remaining vestige of the use of "block" in symbols that represent objects in the rbd code.

This addresses http://tracker.newdream.net/issues/1761

---
  drivers/block/rbd.c       |    4 ++--
  drivers/block/rbd_types.h |    2 +-
  2 files changed, 3 insertions(+), 3 deletions(-)
drivers/block/rbd.c +2 -2
index fd51f9d..2b40a4a 100644
@@ -522,11 +522,11 @@ static int rbd_header_from_disk(struct
 rbd_image_header *header,
 
  	snap_count = le32_to_cpu(ondisk->snap_count);
 
-	size = sizeof (ondisk->block_name) + 1;
+	size = sizeof (ondisk->object_prefix) + 1;
  	header->object_prefix = kmalloc(size, GFP_KERNEL);
  	if (!header->object_prefix)
  		return -ENOMEM;
-	memcpy(header->object_prefix, ondisk->block_name, size - 1);
+	memcpy(header->object_prefix, ondisk->object_prefix, size - 1);
  	header->object_prefix[size - 1] = '\0';
 
  	if (snap_count) {
drivers/block/rbd_types.h +1 -1
index 0924e9e..d9d8a77 100644
@@ -47,7 +47,7 @@ struct rbd_image_snap_ondisk {
 
  struct rbd_image_header_ondisk {
  	char text[40];
-	char block_name[24];
+	char object_prefix[24];
  	char signature[4];
  	char version[8];
  	struct {