From: Josh Durgin <josh.durgin@inktank.com>
To: Alex Elder <elder@inktank.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH 1/5] rbd: pass flags to rbd_req_sync_exec()
Date: Tue, 11 Sep 2012 08:14:57 -0700 [thread overview]
Message-ID: <504F5571.70409@inktank.com> (raw)
In-Reply-To: <504A3AA1.6090603@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
On 09/07/2012 11:19 AM, Alex Elder wrote:
> In order to allow both read requests and write requests to be
> initiated using rbd_req_sync_exec(), add an OSD flags value
> which can be passed down to rbd_req_sync_op(). Rename the "data"
> and "len" parameters to be more clear that they represent data
> that is outbound.
>
> At this point, this function is still only used (and only works) for
> write requests.
>
> Signed-off-by: Alex Elder <elder@inktank.com>
> ---
> drivers/block/rbd.c | 31 +++++++++++++++++++++----------
> 1 file changed, 21 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index daa428e3..4e84f99 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -1437,23 +1437,33 @@ fail:
> }
>
> /*
> - * Request sync osd read
> + * Synchronous osd object method call
> */
> static int rbd_req_sync_exec(struct rbd_device *rbd_dev,
> const char *object_name,
> const char *class_name,
> const char *method_name,
> - const char *data,
> - int len,
> + const char *outbound,
> + size_t outbound_size,
> + int flags,
> u64 *ver)
> {
> struct ceph_osd_req_op *ops;
> int class_name_len = strlen(class_name);
> int method_name_len = strlen(method_name);
> + int payload_size;
> int ret;
>
> - ops = rbd_create_rw_ops(1, CEPH_OSD_OP_CALL,
> - class_name_len + method_name_len + len);
> + /*
> + * Any input parameters required by the method we're calling
> + * will be sent along with the class and method names as
> + * part of the message payload. That data and its size are
> + * supplied via the indata and indata_len fields (named from
> + * the perspective of the server side) in the OSD request
> + * operation.
> + */
> + payload_size = class_name_len + method_name_len + outbound_size;
> + ops = rbd_create_rw_ops(1, CEPH_OSD_OP_CALL, payload_size);
> if (!ops)
> return -ENOMEM;
>
> @@ -1462,13 +1472,12 @@ static int rbd_req_sync_exec(struct rbd_device
> *rbd_dev,
> ops[0].cls.method_name = method_name;
> ops[0].cls.method_len = (__u8) method_name_len;
> ops[0].cls.argc = 0;
> - ops[0].cls.indata = data;
> - ops[0].cls.indata_len = len;
> + ops[0].cls.indata = outbound;
> + ops[0].cls.indata_len = outbound_size;
>
> ret = rbd_req_sync_op(rbd_dev, NULL,
> CEPH_NOSNAP,
> - CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK,
> - ops,
> + flags, ops,
> object_name, 0, 0, NULL, NULL, ver);
>
> rbd_destroy_ops(ops);
> @@ -1780,7 +1789,9 @@ static int rbd_header_add_snap(struct rbd_device
> *rbd_dev,
>
> ret = rbd_req_sync_exec(rbd_dev, rbd_dev->header_name,
> "rbd", "snap_add",
> - data, p - data, NULL);
> + data, (size_t) (p - data),
> + CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK,
> + NULL);
>
> kfree(data);
>
next prev parent reply other threads:[~2012-09-11 15:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-07 18:16 [PATCH 0/5] rbd: kill create_snap sysfs entry Alex Elder
2012-09-07 18:19 ` [PATCH 1/5] rbd: pass flags to rbd_req_sync_exec() Alex Elder
2012-09-11 15:14 ` Josh Durgin [this message]
2012-09-07 18:19 ` [PATCH 2/5] rbd: support data returned from OSD methods Alex Elder
2012-09-11 15:16 ` Josh Durgin
2012-09-07 18:19 ` [PATCH 3/5] rbd: define some new format constants Alex Elder
2012-09-11 15:18 ` Josh Durgin
2012-09-07 18:19 ` [PATCH 4/5] rbd: define rbd_dev_image_id() Alex Elder
2012-09-11 15:50 ` Josh Durgin
2012-09-07 18:19 ` [PATCH 5/5] rbd: kill create_snap sysfs entry Alex Elder
2012-09-11 20:53 ` 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=504F5571.70409@inktank.com \
--to=josh.durgin@inktank.com \
--cc=ceph-devel@vger.kernel.org \
--cc=elder@inktank.com \
/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.