From: Alex Elder <elder@inktank.com>
To: "ceph-devel@vger.kernel.org" <ceph-devel@vger.kernel.org>
Subject: [PATCH REPOST 1/6] rbd: don't assign extent info in rbd_do_request()
Date: Fri, 04 Jan 2013 09:05:56 -0600 [thread overview]
Message-ID: <50E6EFD4.2050103@inktank.com> (raw)
In-Reply-To: <50E6EF5F.9080200@inktank.com>
In rbd_do_request() there's a sort of last-minute assignment of the
extent offset and length and payload length for read and write
operations. Move those assignments into the caller (in those spots
that might initiate read or write operations)
Signed-off-by: Alex Elder <elder@inktank.com>
---
drivers/block/rbd.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index f0b30b2..4ce9981 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1156,13 +1156,6 @@ static int rbd_do_request(struct request *rq,
osd_req->r_oid_len = strlen(osd_req->r_oid);
osd_req->r_file_layout = rbd_dev->layout; /* struct */
-
- if (op->op == CEPH_OSD_OP_READ || op->op == CEPH_OSD_OP_WRITE) {
- op->extent.offset = ofs;
- op->extent.length = len;
- if (op->op == CEPH_OSD_OP_WRITE)
- op->payload_len = len;
- }
osd_req->r_num_pages = calc_pages_for(ofs, len);
osd_req->r_page_alignment = ofs & ~PAGE_MASK;
@@ -1269,6 +1262,13 @@ static int rbd_req_sync_op(struct rbd_device
*rbd_dev,
if (IS_ERR(pages))
return PTR_ERR(pages);
+ if (op->op == CEPH_OSD_OP_READ || op->op == CEPH_OSD_OP_WRITE) {
+ op->extent.offset = ofs;
+ op->extent.length = inbound_size;
+ if (op->op == CEPH_OSD_OP_WRITE)
+ op->payload_len = inbound_size;
+ }
+
ret = rbd_do_request(NULL, rbd_dev, NULL, CEPH_NOSNAP,
object_name, ofs, inbound_size, NULL,
pages, num_pages,
@@ -1332,6 +1332,9 @@ static int rbd_do_op(struct request *rq,
op = rbd_create_rw_op(opcode, payload_len);
if (!op)
goto done;
+ op->extent.offset = seg_ofs;
+ op->extent.length = seg_len;
+ op->payload_len = payload_len;
/* we've taken care of segment sizes earlier when we
cloned the bios. We should never have a segment
--
1.7.9.5
next prev parent reply other threads:[~2013-01-04 15:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-04 15:03 [PATCH REPOST 0/6] rbd: consolidate osd request setup Alex Elder
2013-01-04 15:05 ` Alex Elder [this message]
2013-01-04 15:06 ` [PATCH REPOST 2/6] rbd: don't assign extent info in rbd_req_sync_op() Alex Elder
2013-01-04 15:06 ` [PATCH REPOST 3/6] rbd: initialize off and len in rbd_create_rw_op() Alex Elder
2013-01-04 15:06 ` [PATCH REPOST 4/6] rbd: define generalized osd request op routines Alex Elder
2013-01-04 15:06 ` [PATCH REPOST 5/6] rbd: move call osd op setup into rbd_osd_req_op_create() Alex Elder
2013-01-04 15:07 ` [PATCH REPOST 6/6] rbd: move remaining " Alex Elder
2013-01-17 4:23 ` Josh Durgin
2013-01-17 4:37 ` Alex Elder
2013-01-17 22:25 ` Alex Elder
2013-01-17 4:25 ` [PATCH REPOST 0/6] rbd: consolidate osd request setup Josh Durgin
2013-01-17 22:19 ` 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=50E6EFD4.2050103@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.