diff options
author | Alex Elder <elder@inktank.com> | 2013-02-14 13:16:43 -0500 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 00:16:25 -0400 |
commit | 2ac2b7a6d4976bd6b5dc0751aa77d12d48d3ac4c (patch) | |
tree | af95ff579ab1719871e8678ef530db46514c0eb7 /fs/ceph/addr.c | |
parent | 2794a82a11cfeae0890741b18b0049ddb55ce646 (diff) |
libceph: distinguish page and bio requests
An osd request uses either pages or a bio list for its data. Use a
union to record information about the two, and add a data type
tag to select between them.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'fs/ceph/addr.c')
-rw-r--r-- | fs/ceph/addr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 3a1a77b0ae9f..276fe96f12e3 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
@@ -243,6 +243,7 @@ static void finish_read(struct ceph_osd_request *req, struct ceph_msg *msg) | |||
243 | dout("finish_read %p req %p rc %d bytes %d\n", inode, req, rc, bytes); | 243 | dout("finish_read %p req %p rc %d bytes %d\n", inode, req, rc, bytes); |
244 | 244 | ||
245 | /* unlock all pages, zeroing any data we didn't read */ | 245 | /* unlock all pages, zeroing any data we didn't read */ |
246 | BUG_ON(req->r_data.type != CEPH_OSD_DATA_TYPE_PAGES); | ||
246 | for (i = 0; i < req->r_data.num_pages; i++, bytes -= PAGE_CACHE_SIZE) { | 247 | for (i = 0; i < req->r_data.num_pages; i++, bytes -= PAGE_CACHE_SIZE) { |
247 | struct page *page = req->r_data.pages[i]; | 248 | struct page *page = req->r_data.pages[i]; |
248 | 249 | ||
@@ -336,6 +337,7 @@ static int start_read(struct inode *inode, struct list_head *page_list, int max) | |||
336 | } | 337 | } |
337 | pages[i] = page; | 338 | pages[i] = page; |
338 | } | 339 | } |
340 | req->r_data.type = CEPH_OSD_DATA_TYPE_PAGES; | ||
339 | req->r_data.pages = pages; | 341 | req->r_data.pages = pages; |
340 | req->r_data.num_pages = nr_pages; | 342 | req->r_data.num_pages = nr_pages; |
341 | req->r_data.alignment = 0; | 343 | req->r_data.alignment = 0; |
@@ -561,6 +563,7 @@ static void writepages_finish(struct ceph_osd_request *req, | |||
561 | long writeback_stat; | 563 | long writeback_stat; |
562 | unsigned issued = ceph_caps_issued(ci); | 564 | unsigned issued = ceph_caps_issued(ci); |
563 | 565 | ||
566 | BUG_ON(req->r_data.type != CEPH_OSD_DATA_TYPE_PAGES); | ||
564 | if (rc >= 0) { | 567 | if (rc >= 0) { |
565 | /* | 568 | /* |
566 | * Assume we wrote the pages we originally sent. The | 569 | * Assume we wrote the pages we originally sent. The |
@@ -830,6 +833,7 @@ get_more_pages: | |||
830 | break; | 833 | break; |
831 | } | 834 | } |
832 | 835 | ||
836 | req->r_data.type = CEPH_OSD_DATA_TYPE_PAGES; | ||
833 | req->r_data.num_pages = calc_pages_for(0, len); | 837 | req->r_data.num_pages = calc_pages_for(0, len); |
834 | req->r_data.alignment = 0; | 838 | req->r_data.alignment = 0; |
835 | max_pages = req->r_data.num_pages; | 839 | max_pages = req->r_data.num_pages; |