summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-05-06 09:51:29 -0500
committerAlex Elder <elder@inktank.com>2013-05-08 17:00:28 -0500
commit46578dcdca951f3da70d3a5a9b5166b2a492a182 (patch)
tree3646f4403d3267b9774928fcdb913cdc222bbd1c /drivers/block
parentf35a4dee14c31dc00807f3bcd59cc7a6959f63d7 (diff)
rbd: zero format 1 header structure earlier
The passed-in header structure is zeroed in rbd_header_from_disk(). Instead, have the caller do it. Note that there are two callers, rbd_dev_v1_refresh() and rbd_dev_v1_probe(). The latter already has a zeroed header structure so zeroing it isn't necessary there. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index a05b6e5dc36..b0fbc38cc6f 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -738,8 +738,6 @@ static int rbd_header_from_disk(struct rbd_image_header *header,
size_t size;
u32 i;
- memset(header, 0, sizeof (*header));
-
snap_count = le32_to_cpu(ondisk->snap_count);
len = strnlen(ondisk->object_prefix, sizeof (ondisk->object_prefix));
@@ -3103,6 +3101,7 @@ static int rbd_dev_v1_refresh(struct rbd_device *rbd_dev)
int ret;
struct rbd_image_header h;
+ memset(&h, 0, sizeof (h));
ret = rbd_read_header(rbd_dev, &h);
if (ret < 0)
return ret;