From: Alex Elder <elder@inktank.com>
To: ceph-devel@vger.kernel.org
Subject: [PATCH 2/7] rbd: zero format 1 header structure earlier
Date: Mon, 06 May 2013 20:52:48 -0500 [thread overview]
Message-ID: <51885E70.2070901@inktank.com> (raw)
In-Reply-To: <51885E06.8020201@inktank.com>
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>
---
drivers/block/rbd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 357a11f..cdba93b 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;
--
1.7.9.5
next prev parent reply other threads:[~2013-05-07 1:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-07 1:51 [PATCH 0/7] rbd: use common code for probe and refresh Alex Elder
2013-05-07 1:52 ` [PATCH 1/7] rbd: set the mapping size and features later Alex Elder
2013-05-07 1:52 ` Alex Elder [this message]
2013-05-07 1:53 ` [PATCH 3/7] rbd: refactor rbd_header_from_disk() Alex Elder
2013-05-07 1:53 ` [PATCH 4/7] rbd: update in-core header directly Alex Elder
2013-05-07 1:53 ` [PATCH 5/7] rbd: simplify rbd_dev_v1_probe() Alex Elder
2013-05-07 1:53 ` [PATCH 6/7] rbd: get rid of trivial v1 header wrappers Alex Elder
2013-05-07 1:54 ` [PATCH 7/7] rbd: define rbd_dev_v1_header_info() Alex Elder
2013-05-08 19:29 ` [PATCH 0/7] rbd: use common code for probe and refresh Josh Durgin
2013-05-08 20:39 ` Alex Elder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51885E70.2070901@inktank.com \
--to=elder@inktank.com \
--cc=ceph-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox