diff options
| author | Alex Elder <elder@inktank.com> | 2013-04-15 15:50:36 -0400 |
|---|---|---|
| committer | Sage Weil <sage@inktank.com> | 2013-05-02 00:18:58 -0400 |
| commit | 406e2c9f9286fc93ae2191a7abf477dea05aadc9 (patch) | |
| tree | 121034644585b0171bfd436d77fe988ad1704753 | |
| parent | ac7f29bf2ee4a526efb68f947475ff77a43028de (diff) | |
libceph: kill off osd data write_request parameters
In the incremental move toward supporting distinct data items in an
osd request some of the functions had "write_request" parameters to
indicate, basically, whether the data belonged to in_data or the
out_data. Now that we maintain the data fields in the op structure
there is no need to indicate the direction, so get rid of the
"write_request" parameters.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
| -rw-r--r-- | drivers/block/rbd.c | 4 | ||||
| -rw-r--r-- | fs/ceph/addr.c | 9 | ||||
| -rw-r--r-- | fs/ceph/file.c | 4 | ||||
| -rw-r--r-- | include/linux/ceph/osd_client.h | 8 | ||||
| -rw-r--r-- | net/ceph/osd_client.c | 25 |
5 files changed, 23 insertions, 27 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 13a381b2a779..8e8b876e83c3 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
| @@ -1779,7 +1779,7 @@ static int rbd_img_request_fill_bio(struct rbd_img_request *img_request, | |||
| 1779 | 1779 | ||
| 1780 | osd_req_op_extent_init(osd_req, 0, opcode, offset, length, | 1780 | osd_req_op_extent_init(osd_req, 0, opcode, offset, length, |
| 1781 | 0, 0); | 1781 | 0, 0); |
| 1782 | osd_req_op_extent_osd_data_bio(osd_req, 0, write_request, | 1782 | osd_req_op_extent_osd_data_bio(osd_req, 0, |
| 1783 | obj_request->bio_list, obj_request->length); | 1783 | obj_request->bio_list, obj_request->length); |
| 1784 | rbd_osd_req_format(obj_request, write_request); | 1784 | rbd_osd_req_format(obj_request, write_request); |
| 1785 | 1785 | ||
| @@ -2281,7 +2281,7 @@ static int rbd_obj_read_sync(struct rbd_device *rbd_dev, | |||
| 2281 | 2281 | ||
| 2282 | osd_req_op_extent_init(obj_request->osd_req, 0, CEPH_OSD_OP_READ, | 2282 | osd_req_op_extent_init(obj_request->osd_req, 0, CEPH_OSD_OP_READ, |
| 2283 | offset, length, 0, 0); | 2283 | offset, length, 0, 0); |
| 2284 | osd_req_op_extent_osd_data_pages(obj_request->osd_req, 0, false, | 2284 | osd_req_op_extent_osd_data_pages(obj_request->osd_req, 0, |
| 2285 | obj_request->pages, | 2285 | obj_request->pages, |
| 2286 | obj_request->length, | 2286 | obj_request->length, |
| 2287 | obj_request->offset & ~PAGE_MASK, | 2287 | obj_request->offset & ~PAGE_MASK, |
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 2d6466b5fe82..3e68ac101040 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
| @@ -245,7 +245,7 @@ static void finish_read(struct ceph_osd_request *req, struct ceph_msg *msg) | |||
| 245 | dout("finish_read %p req %p rc %d bytes %d\n", inode, req, rc, bytes); | 245 | dout("finish_read %p req %p rc %d bytes %d\n", inode, req, rc, bytes); |
| 246 | 246 | ||
| 247 | /* unlock all pages, zeroing any data we didn't read */ | 247 | /* unlock all pages, zeroing any data we didn't read */ |
| 248 | osd_data = osd_req_op_extent_osd_data(req, 0, false); | 248 | osd_data = osd_req_op_extent_osd_data(req, 0); |
| 249 | BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_PAGES); | 249 | BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_PAGES); |
| 250 | num_pages = calc_pages_for((u64)osd_data->alignment, | 250 | num_pages = calc_pages_for((u64)osd_data->alignment, |
| 251 | (u64)osd_data->length); | 251 | (u64)osd_data->length); |
| @@ -343,8 +343,7 @@ 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 | osd_req_op_extent_osd_data_pages(req, 0, false, pages, len, 0, | 346 | osd_req_op_extent_osd_data_pages(req, 0, pages, len, 0, false, false); |
| 347 | false, false); | ||
| 348 | req->r_callback = finish_read; | 347 | req->r_callback = finish_read; |
| 349 | req->r_inode = inode; | 348 | req->r_inode = inode; |
| 350 | 349 | ||
| @@ -571,7 +570,7 @@ static void writepages_finish(struct ceph_osd_request *req, | |||
| 571 | long writeback_stat; | 570 | long writeback_stat; |
| 572 | unsigned issued = ceph_caps_issued(ci); | 571 | unsigned issued = ceph_caps_issued(ci); |
| 573 | 572 | ||
| 574 | osd_data = osd_req_op_extent_osd_data(req, 0, true); | 573 | osd_data = osd_req_op_extent_osd_data(req, 0); |
| 575 | BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_PAGES); | 574 | BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_PAGES); |
| 576 | num_pages = calc_pages_for((u64)osd_data->alignment, | 575 | num_pages = calc_pages_for((u64)osd_data->alignment, |
| 577 | (u64)osd_data->length); | 576 | (u64)osd_data->length); |
| @@ -916,7 +915,7 @@ get_more_pages: | |||
| 916 | dout("writepages got %d pages at %llu~%llu\n", | 915 | dout("writepages got %d pages at %llu~%llu\n", |
| 917 | locked_pages, offset, len); | 916 | locked_pages, offset, len); |
| 918 | 917 | ||
| 919 | osd_req_op_extent_osd_data_pages(req, 0, true, pages, len, 0, | 918 | osd_req_op_extent_osd_data_pages(req, 0, pages, len, 0, |
| 920 | !!pool, false); | 919 | !!pool, false); |
| 921 | 920 | ||
| 922 | pages = NULL; /* request message now owns the pages array */ | 921 | pages = NULL; /* request message now owns the pages array */ |
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 7e94dcb66d92..d70830c66833 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
| @@ -585,8 +585,8 @@ more: | |||
| 585 | own_pages = true; | 585 | own_pages = true; |
| 586 | } | 586 | } |
| 587 | } | 587 | } |
| 588 | osd_req_op_extent_osd_data_pages(req, 0, true, pages, len, | 588 | osd_req_op_extent_osd_data_pages(req, 0, pages, len, page_align, |
| 589 | page_align, false, own_pages); | 589 | false, own_pages); |
| 590 | 590 | ||
| 591 | /* BUG_ON(vino.snap != CEPH_NOSNAP); */ | 591 | /* BUG_ON(vino.snap != CEPH_NOSNAP); */ |
| 592 | ceph_osdc_build_request(req, pos, snapc, vino.snap, &mtime); | 592 | ceph_osdc_build_request(req, pos, snapc, vino.snap, &mtime); |
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index 0d3358ef5285..0e406934a551 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h | |||
| @@ -241,22 +241,22 @@ extern void osd_req_op_extent_update(struct ceph_osd_request *osd_req, | |||
| 241 | 241 | ||
| 242 | extern struct ceph_osd_data *osd_req_op_extent_osd_data( | 242 | extern struct ceph_osd_data *osd_req_op_extent_osd_data( |
| 243 | struct ceph_osd_request *osd_req, | 243 | struct ceph_osd_request *osd_req, |
| 244 | unsigned int which, bool write_request); | 244 | unsigned int which); |
| 245 | extern struct ceph_osd_data *osd_req_op_cls_response_data( | 245 | extern struct ceph_osd_data *osd_req_op_cls_response_data( |
| 246 | struct ceph_osd_request *osd_req, | 246 | struct ceph_osd_request *osd_req, |
| 247 | unsigned int which); | 247 | unsigned int which); |
| 248 | 248 | ||
| 249 | extern void osd_req_op_extent_osd_data_pages(struct ceph_osd_request *, | 249 | extern void osd_req_op_extent_osd_data_pages(struct ceph_osd_request *, |
| 250 | unsigned int which, bool write_request, | 250 | unsigned int which, |
| 251 | struct page **pages, u64 length, | 251 | struct page **pages, u64 length, |
| 252 | u32 alignment, bool pages_from_pool, | 252 | u32 alignment, bool pages_from_pool, |
| 253 | bool own_pages); | 253 | bool own_pages); |
| 254 | extern void osd_req_op_extent_osd_data_pagelist(struct ceph_osd_request *, | 254 | extern void osd_req_op_extent_osd_data_pagelist(struct ceph_osd_request *, |
| 255 | unsigned int which, bool write_request, | 255 | unsigned int which, |
| 256 | struct ceph_pagelist *pagelist); | 256 | struct ceph_pagelist *pagelist); |
| 257 | #ifdef CONFIG_BLOCK | 257 | #ifdef CONFIG_BLOCK |
| 258 | extern void osd_req_op_extent_osd_data_bio(struct ceph_osd_request *, | 258 | extern void osd_req_op_extent_osd_data_bio(struct ceph_osd_request *, |
| 259 | unsigned int which, bool write_request, | 259 | unsigned int which, |
| 260 | struct bio *bio, size_t bio_length); | 260 | struct bio *bio, size_t bio_length); |
| 261 | #endif /* CONFIG_BLOCK */ | 261 | #endif /* CONFIG_BLOCK */ |
| 262 | 262 | ||
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 0c5bf2fb5075..409c443c8d1f 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
| @@ -117,7 +117,7 @@ static void ceph_osd_data_bio_init(struct ceph_osd_data *osd_data, | |||
| 117 | 117 | ||
| 118 | struct ceph_osd_data * | 118 | struct ceph_osd_data * |
| 119 | osd_req_op_extent_osd_data(struct ceph_osd_request *osd_req, | 119 | osd_req_op_extent_osd_data(struct ceph_osd_request *osd_req, |
| 120 | unsigned int which, bool write_request) | 120 | unsigned int which) |
| 121 | { | 121 | { |
| 122 | BUG_ON(which >= osd_req->r_num_ops); | 122 | BUG_ON(which >= osd_req->r_num_ops); |
| 123 | 123 | ||
| @@ -156,37 +156,34 @@ osd_req_op_cls_response_data(struct ceph_osd_request *osd_req, | |||
| 156 | EXPORT_SYMBOL(osd_req_op_cls_response_data); /* ??? */ | 156 | EXPORT_SYMBOL(osd_req_op_cls_response_data); /* ??? */ |
| 157 | 157 | ||
| 158 | void osd_req_op_extent_osd_data_pages(struct ceph_osd_request *osd_req, | 158 | void osd_req_op_extent_osd_data_pages(struct ceph_osd_request *osd_req, |
| 159 | unsigned int which, bool write_request, | 159 | unsigned int which, struct page **pages, |
| 160 | struct page **pages, u64 length, u32 alignment, | 160 | u64 length, u32 alignment, |
| 161 | bool pages_from_pool, bool own_pages) | 161 | bool pages_from_pool, bool own_pages) |
| 162 | { | 162 | { |
| 163 | struct ceph_osd_data *osd_data; | 163 | struct ceph_osd_data *osd_data; |
| 164 | 164 | ||
| 165 | osd_data = osd_req_op_extent_osd_data(osd_req, which, write_request); | 165 | osd_data = osd_req_op_extent_osd_data(osd_req, which); |
| 166 | ceph_osd_data_pages_init(osd_data, pages, length, alignment, | 166 | ceph_osd_data_pages_init(osd_data, pages, length, alignment, |
| 167 | pages_from_pool, own_pages); | 167 | pages_from_pool, own_pages); |
| 168 | } | 168 | } |
| 169 | EXPORT_SYMBOL(osd_req_op_extent_osd_data_pages); | 169 | EXPORT_SYMBOL(osd_req_op_extent_osd_data_pages); |
| 170 | 170 | ||
| 171 | void osd_req_op_extent_osd_data_pagelist(struct ceph_osd_request *osd_req, | 171 | void osd_req_op_extent_osd_data_pagelist(struct ceph_osd_request *osd_req, |
| 172 | unsigned int which, bool write_request, | 172 | unsigned int which, struct ceph_pagelist *pagelist) |
| 173 | struct ceph_pagelist *pagelist) | ||
| 174 | { | 173 | { |
| 175 | struct ceph_osd_data *osd_data; | 174 | struct ceph_osd_data *osd_data; |
| 176 | 175 | ||
| 177 | osd_data = osd_req_op_extent_osd_data(osd_req, which, write_request); | 176 | osd_data = osd_req_op_extent_osd_data(osd_req, which); |
| 178 | ceph_osd_data_pagelist_init(osd_data, pagelist); | 177 | ceph_osd_data_pagelist_init(osd_data, pagelist); |
| 179 | } | 178 | } |
| 180 | EXPORT_SYMBOL(osd_req_op_extent_osd_data_pagelist); | 179 | EXPORT_SYMBOL(osd_req_op_extent_osd_data_pagelist); |
| 181 | 180 | ||
| 182 | #ifdef CONFIG_BLOCK | 181 | #ifdef CONFIG_BLOCK |
| 183 | void osd_req_op_extent_osd_data_bio(struct ceph_osd_request *osd_req, | 182 | void osd_req_op_extent_osd_data_bio(struct ceph_osd_request *osd_req, |
| 184 | unsigned int which, bool write_request, | 183 | unsigned int which, struct bio *bio, size_t bio_length) |
| 185 | struct bio *bio, size_t bio_length) | ||
| 186 | { | 184 | { |
| 187 | struct ceph_osd_data *osd_data; | 185 | struct ceph_osd_data *osd_data; |
| 188 | 186 | osd_data = osd_req_op_extent_osd_data(osd_req, which); | |
| 189 | osd_data = osd_req_op_extent_osd_data(osd_req, which, write_request); | ||
| 190 | ceph_osd_data_bio_init(osd_data, bio, bio_length); | 187 | ceph_osd_data_bio_init(osd_data, bio, bio_length); |
| 191 | } | 188 | } |
| 192 | EXPORT_SYMBOL(osd_req_op_extent_osd_data_bio); | 189 | EXPORT_SYMBOL(osd_req_op_extent_osd_data_bio); |
| @@ -2284,7 +2281,7 @@ int ceph_osdc_readpages(struct ceph_osd_client *osdc, | |||
| 2284 | 2281 | ||
| 2285 | /* it may be a short read due to an object boundary */ | 2282 | /* it may be a short read due to an object boundary */ |
| 2286 | 2283 | ||
| 2287 | osd_req_op_extent_osd_data_pages(req, 0, false, | 2284 | osd_req_op_extent_osd_data_pages(req, 0, |
| 2288 | pages, *plen, page_align, false, false); | 2285 | pages, *plen, page_align, false, false); |
| 2289 | 2286 | ||
| 2290 | dout("readpages final extent is %llu~%llu (%llu bytes align %d)\n", | 2287 | dout("readpages final extent is %llu~%llu (%llu bytes align %d)\n", |
| @@ -2327,7 +2324,7 @@ int ceph_osdc_writepages(struct ceph_osd_client *osdc, struct ceph_vino vino, | |||
| 2327 | return PTR_ERR(req); | 2324 | return PTR_ERR(req); |
| 2328 | 2325 | ||
| 2329 | /* it may be a short write due to an object boundary */ | 2326 | /* it may be a short write due to an object boundary */ |
| 2330 | osd_req_op_extent_osd_data_pages(req, 0, true, pages, len, page_align, | 2327 | osd_req_op_extent_osd_data_pages(req, 0, pages, len, page_align, |
| 2331 | false, false); | 2328 | false, false); |
| 2332 | dout("writepages %llu~%llu (%llu bytes)\n", off, len, len); | 2329 | dout("writepages %llu~%llu (%llu bytes)\n", off, len, len); |
| 2333 | 2330 | ||
| @@ -2428,7 +2425,7 @@ static struct ceph_msg *get_reply(struct ceph_connection *con, | |||
| 2428 | * XXX page data. Probably OK for reads, but this | 2425 | * XXX page data. Probably OK for reads, but this |
| 2429 | * XXX ought to be done more generally. | 2426 | * XXX ought to be done more generally. |
| 2430 | */ | 2427 | */ |
| 2431 | osd_data = osd_req_op_extent_osd_data(req, 0, false); | 2428 | osd_data = osd_req_op_extent_osd_data(req, 0); |
| 2432 | if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGES) { | 2429 | if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGES) { |
| 2433 | if (osd_data->pages && | 2430 | if (osd_data->pages && |
| 2434 | unlikely(osd_data->length < data_len)) { | 2431 | unlikely(osd_data->length < data_len)) { |
