From: "Yan, Zheng" <zyan@redhat.com>
To: ceph-devel@vger.kernel.org
Cc: idryomov@gmail.com, "Yan, Zheng" <zyan@redhat.com>
Subject: [PATCH V2 2/6] libceph: move r_reply_op_{len,result} into struct ceph_osd_req_op
Date: Tue, 19 Jan 2016 16:08:07 +0800 [thread overview]
Message-ID: <1453190891-40937-3-git-send-email-zyan@redhat.com> (raw)
In-Reply-To: <1453190891-40937-1-git-send-email-zyan@redhat.com>
This avoids defining large array of r_reply_op_{len,result} in
in 'struct ceph_osd_request'
Signed-off-by: Yan, Zheng <zyan@redhat.com>
---
drivers/block/rbd.c | 2 +-
include/linux/ceph/osd_client.h | 5 +++--
net/ceph/osd_client.c | 4 ++--
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 4a87678..22cfc01 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1854,7 +1854,7 @@ static void rbd_osd_req_callback(struct ceph_osd_request *osd_req,
* passed to the block layer, which just supports a 32-bit
* length field.
*/
- obj_request->xferred = osd_req->r_reply_op_len[0];
+ obj_request->xferred = osd_req->r_ops[0].reply_op_len;
rbd_assert(obj_request->xferred < (u64)UINT_MAX);
opcode = osd_req->r_ops[0].op;
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index 5bf428a..fda3a05 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -116,6 +116,9 @@ struct ceph_osd_req_op {
u64 expected_write_size;
} alloc_hint;
};
+ /* reply */
+ int reply_op_len;
+ s32 reply_op_result;
};
/* an in-flight request */
@@ -150,8 +153,6 @@ struct ceph_osd_request {
struct ceph_eversion *r_request_reassert_version;
int r_result;
- int r_reply_op_len[CEPH_OSD_MAX_OP];
- s32 r_reply_op_result[CEPH_OSD_MAX_OP];
int r_got_reply;
int r_linger;
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index b93752e..3852006 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -1840,7 +1840,7 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg)
int len;
len = le32_to_cpu(op->payload_len);
- req->r_reply_op_len[i] = len;
+ req->r_ops[i].reply_op_len = len;
dout(" op %d has %d bytes\n", i, len);
payload_len += len;
p += sizeof(*op);
@@ -1855,7 +1855,7 @@ static void handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg)
ceph_decode_need(&p, end, 4 + numops * 4, bad_put);
retry_attempt = ceph_decode_32(&p);
for (i = 0; i < numops; i++)
- req->r_reply_op_result[i] = ceph_decode_32(&p);
+ req->r_ops[i].reply_op_result = ceph_decode_32(&p);
if (le16_to_cpu(msg->hdr.version) >= 6) {
p += 8 + 4; /* skip replay_version */
--
2.5.0
next prev parent reply other threads:[~2016-01-19 8:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-19 8:08 [PATCH V2 0/6] scattered page writeback Yan, Zheng
2016-01-19 8:08 ` [PATCH V2 1/6] libceph: enlarge max number of operations in OSD request Yan, Zheng
2016-01-19 8:08 ` Yan, Zheng [this message]
2016-01-19 8:08 ` [PATCH V2 3/6] libceph: allow reserving " Yan, Zheng
2016-01-19 8:08 ` [PATCH V2 4/6] libceph: add helper that extends numner of " Yan, Zheng
2016-01-19 8:08 ` [PATCH V2 5/6] libceph: add helper that duplicates last extent operation Yan, Zheng
2016-01-19 8:08 ` [PATCH V2 6/6] ceph: scattered page writeback Yan, Zheng
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=1453190891-40937-3-git-send-email-zyan@redhat.com \
--to=zyan@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=idryomov@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox