diff options
author | Alex Elder <elder@inktank.com> | 2013-04-03 02:28:58 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 00:18:14 -0400 |
commit | 8c042b0df99cd06ef8473ef6e204b87b3dc80158 (patch) | |
tree | 234f410f3253401efa7266cdd67a6e87b22e8bac /fs | |
parent | 54d5064912649e296552f298e6472ffd37cd8f90 (diff) |
libceph: add data pointers in osd op structures
An extent type osd operation currently implies that there will
be corresponding data supplied in the data portion of the request
(for write) or response (for read) message. Similarly, an osd class
method operation implies a data item will be supplied to receive
the response data from the operation.
Add a ceph_osd_data pointer to each of those structures, and assign
it to point to eithre the incoming or the outgoing data structure in
the osd message. The data is not always available when an op is
initially set up, so add two new functions to allow setting them
after the op has been initialized.
Begin to make use of the data item pointer available in the osd
operation rather than the request data in or out structure in
places where it's convenient. Add some assertions to verify
pointers are always set the way they're expected to be.
This is a sort of stepping stone toward really moving the data
into the osd request ops, to allow for some validation before
making that jump.
This is the first in a series of patches that resolve:
http://tracker.ceph.com/issues/4657
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/addr.c | 8 | ||||
-rw-r--r-- | fs/ceph/file.c | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index c9da074f0fe6..0ac3a37753cb 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
@@ -343,7 +343,8 @@ static int start_read(struct inode *inode, struct list_head *page_list, int max) | |||
343 | } | 343 | } |
344 | pages[i] = page; | 344 | pages[i] = page; |
345 | } | 345 | } |
346 | ceph_osd_data_pages_init(&req->r_data_in, pages, len, 0, | 346 | BUG_ON(req->r_ops[0].extent.osd_data != &req->r_data_in); |
347 | ceph_osd_data_pages_init(req->r_ops[0].extent.osd_data, pages, len, 0, | ||
347 | false, false); | 348 | false, false); |
348 | req->r_callback = finish_read; | 349 | req->r_callback = finish_read; |
349 | req->r_inode = inode; | 350 | req->r_inode = inode; |
@@ -916,8 +917,9 @@ get_more_pages: | |||
916 | dout("writepages got %d pages at %llu~%llu\n", | 917 | dout("writepages got %d pages at %llu~%llu\n", |
917 | locked_pages, offset, len); | 918 | locked_pages, offset, len); |
918 | 919 | ||
919 | ceph_osd_data_pages_init(&req->r_data_out, pages, len, 0, | 920 | BUG_ON(req->r_ops[0].extent.osd_data != &req->r_data_out); |
920 | !!pool, false); | 921 | ceph_osd_data_pages_init(req->r_ops[0].extent.osd_data, pages, |
922 | len, 0, !!pool, false); | ||
921 | 923 | ||
922 | pages = NULL; /* request message now owns the pages array */ | 924 | pages = NULL; /* request message now owns the pages array */ |
923 | pool = NULL; | 925 | pool = NULL; |
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index a12f47642c40..cddc10fd7cf9 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -574,8 +574,9 @@ more: | |||
574 | own_pages = true; | 574 | own_pages = true; |
575 | } | 575 | } |
576 | } | 576 | } |
577 | ceph_osd_data_pages_init(&req->r_data_out, pages, len, page_align, | 577 | BUG_ON(req->r_ops[0].extent.osd_data != &req->r_data_out); |
578 | false, own_pages); | 578 | ceph_osd_data_pages_init(req->r_ops[0].extent.osd_data, pages, len, |
579 | page_align, false, own_pages); | ||
579 | 580 | ||
580 | /* BUG_ON(vino.snap != CEPH_NOSNAP); */ | 581 | /* BUG_ON(vino.snap != CEPH_NOSNAP); */ |
581 | ceph_osdc_build_request(req, pos, snapc, vino.snap, &mtime); | 582 | ceph_osdc_build_request(req, pos, snapc, vino.snap, &mtime); |