From: Alex Elder <elder@inktank.com>
To: ceph-devel@vger.kernel.org
Subject: [PATCH 2/6] rbd: make snap_size order parameter optional
Date: Fri, 26 Apr 2013 07:05:53 -0500 [thread overview]
Message-ID: <517A6DA1.90809@inktank.com> (raw)
In-Reply-To: <517A6D39.80000@inktank.com>
Only one of the two callers of _rbd_dev_v2_snap_size() needs the
order value returned. So make that an optional argument--a null
pointer if the caller doesn't need it.
Signed-off-by: Alex Elder <elder@inktank.com>
---
drivers/block/rbd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 28b652c..1e01f0d 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3494,7 +3494,8 @@ static int _rbd_dev_v2_snap_size(struct rbd_device
*rbd_dev, u64 snap_id,
if (ret < sizeof (size_buf))
return -ERANGE;
- *order = size_buf.order;
+ if (order)
+ *order = size_buf.order;
*snap_size = le64_to_cpu(size_buf.size);
dout(" snap_id 0x%016llx order = %u, snap_size = %llu\n",
@@ -3939,11 +3940,10 @@ static char *rbd_dev_v2_snap_info(struct
rbd_device *rbd_dev, u32 which,
u64 *snap_size, u64 *snap_features)
{
u64 snap_id;
- u8 order;
int ret;
snap_id = rbd_dev->header.snapc->snaps[which];
- ret = _rbd_dev_v2_snap_size(rbd_dev, snap_id, &order, snap_size);
+ ret = _rbd_dev_v2_snap_size(rbd_dev, snap_id, NULL, snap_size);
if (ret)
return ERR_PTR(ret);
ret = _rbd_dev_v2_snap_features(rbd_dev, snap_id, snap_features);
--
1.7.9.5
next prev parent reply other threads:[~2013-04-26 12:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-26 12:04 [PATCH 0/6] rbd: cleanup and plug leaks Alex Elder
2013-04-26 12:05 ` [PATCH 1/6] rbd: fix leak of snapshots during initial probe Alex Elder
2013-04-29 15:12 ` Josh Durgin
2013-04-26 12:05 ` Alex Elder [this message]
2013-04-29 15:14 ` [PATCH 2/6] rbd: make snap_size order parameter optional Josh Durgin
2013-04-26 12:06 ` [PATCH 3/6] rbd: only update values on snap_info success Alex Elder
2013-04-29 15:15 ` Josh Durgin
2013-04-26 12:06 ` [PATCH 4/6] rbd: rename __rbd_add_snap_dev() Alex Elder
2013-04-29 15:15 ` Josh Durgin
2013-04-26 12:06 ` [PATCH 5/6] rbd: fix leak of format 2 snapshot names Alex Elder
2013-04-26 17:40 ` [PATCH 5/6, v2] " Alex Elder
2013-04-29 15:16 ` [PATCH 5/6] " Josh Durgin
2013-04-29 15:18 ` Josh Durgin
2013-04-26 12:06 ` [PATCH 6/6] rbd: use rbd_obj_method_sync() return value Alex Elder
2013-04-29 15:22 ` Josh Durgin
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=517A6DA1.90809@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.