diff options
| -rw-r--r-- | drivers/block/rbd.c | 35 | ||||
| -rw-r--r-- | fs/ceph/addr.c | 2 | ||||
| -rw-r--r-- | include/linux/ceph/osd_client.h | 19 | ||||
| -rw-r--r-- | net/ceph/osd_client.c | 64 |
4 files changed, 67 insertions, 53 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index eb64ed0f228f..80ac772587c8 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
| @@ -1336,16 +1336,17 @@ static void rbd_osd_req_format_op(struct rbd_obj_request *obj_request, | |||
| 1336 | snap_id = img_request->snap_id; | 1336 | snap_id = img_request->snap_id; |
| 1337 | } | 1337 | } |
| 1338 | if (obj_request->type != OBJ_REQUEST_NODATA) { | 1338 | if (obj_request->type != OBJ_REQUEST_NODATA) { |
| 1339 | struct ceph_osd_req_op *op = &obj_request->osd_req->r_ops[0]; | ||
| 1340 | |||
| 1341 | /* | 1339 | /* |
| 1342 | * If it has data, it's either a object class method | 1340 | * If it has data, it's either a object class method |
| 1343 | * call (cls) or it's an extent operation. | 1341 | * call (cls) or it's an extent operation. |
| 1344 | */ | 1342 | */ |
| 1345 | if (op->op == CEPH_OSD_OP_CALL) | 1343 | /* XXX This use of the ops array goes away in the next patch */ |
| 1346 | osd_req_op_cls_response_data(op, osd_data); | 1344 | if (obj_request->osd_req->r_ops[0].op == CEPH_OSD_OP_CALL) |
| 1345 | osd_req_op_cls_response_data(obj_request->osd_req, 0, | ||
| 1346 | osd_data); | ||
| 1347 | else | 1347 | else |
| 1348 | osd_req_op_extent_osd_data(op, osd_data); | 1348 | osd_req_op_extent_osd_data(obj_request->osd_req, 0, |
| 1349 | osd_data); | ||
| 1349 | } | 1350 | } |
| 1350 | ceph_osdc_build_request(osd_req, obj_request->offset, | 1351 | ceph_osdc_build_request(osd_req, obj_request->offset, |
| 1351 | snapc, snap_id, mtime); | 1352 | snapc, snap_id, mtime); |
| @@ -1577,7 +1578,6 @@ static int rbd_img_request_fill_bio(struct rbd_img_request *img_request, | |||
| 1577 | while (resid) { | 1578 | while (resid) { |
| 1578 | const char *object_name; | 1579 | const char *object_name; |
| 1579 | unsigned int clone_size; | 1580 | unsigned int clone_size; |
| 1580 | struct ceph_osd_req_op *op; | ||
| 1581 | u64 offset; | 1581 | u64 offset; |
| 1582 | u64 length; | 1582 | u64 length; |
| 1583 | 1583 | ||
| @@ -1606,8 +1606,8 @@ static int rbd_img_request_fill_bio(struct rbd_img_request *img_request, | |||
| 1606 | if (!obj_request->osd_req) | 1606 | if (!obj_request->osd_req) |
| 1607 | goto out_partial; | 1607 | goto out_partial; |
| 1608 | 1608 | ||
| 1609 | op = &obj_request->osd_req->r_ops[0]; | 1609 | osd_req_op_extent_init(obj_request->osd_req, 0, |
| 1610 | osd_req_op_extent_init(op, opcode, offset, length, 0, 0); | 1610 | opcode, offset, length, 0, 0); |
| 1611 | rbd_osd_req_format_op(obj_request, write_request); | 1611 | rbd_osd_req_format_op(obj_request, write_request); |
| 1612 | 1612 | ||
| 1613 | /* status and version are initially zero-filled */ | 1613 | /* status and version are initially zero-filled */ |
| @@ -1710,7 +1710,6 @@ static int rbd_obj_notify_ack(struct rbd_device *rbd_dev, | |||
| 1710 | u64 ver, u64 notify_id) | 1710 | u64 ver, u64 notify_id) |
| 1711 | { | 1711 | { |
| 1712 | struct rbd_obj_request *obj_request; | 1712 | struct rbd_obj_request *obj_request; |
| 1713 | struct ceph_osd_req_op *op; | ||
| 1714 | struct ceph_osd_client *osdc; | 1713 | struct ceph_osd_client *osdc; |
| 1715 | int ret; | 1714 | int ret; |
| 1716 | 1715 | ||
| @@ -1724,8 +1723,8 @@ static int rbd_obj_notify_ack(struct rbd_device *rbd_dev, | |||
| 1724 | if (!obj_request->osd_req) | 1723 | if (!obj_request->osd_req) |
| 1725 | goto out; | 1724 | goto out; |
| 1726 | 1725 | ||
| 1727 | op = &obj_request->osd_req->r_ops[0]; | 1726 | osd_req_op_watch_init(obj_request->osd_req, 0, CEPH_OSD_OP_NOTIFY_ACK, |
| 1728 | osd_req_op_watch_init(op, CEPH_OSD_OP_NOTIFY_ACK, notify_id, ver, 0); | 1727 | notify_id, ver, 0); |
| 1729 | rbd_osd_req_format_op(obj_request, false); | 1728 | rbd_osd_req_format_op(obj_request, false); |
| 1730 | 1729 | ||
| 1731 | osdc = &rbd_dev->rbd_client->client->osdc; | 1730 | osdc = &rbd_dev->rbd_client->client->osdc; |
| @@ -1766,7 +1765,6 @@ static int rbd_dev_header_watch_sync(struct rbd_device *rbd_dev, int start) | |||
| 1766 | { | 1765 | { |
| 1767 | struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc; | 1766 | struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc; |
| 1768 | struct rbd_obj_request *obj_request; | 1767 | struct rbd_obj_request *obj_request; |
| 1769 | struct ceph_osd_req_op *op; | ||
| 1770 | int ret; | 1768 | int ret; |
| 1771 | 1769 | ||
| 1772 | rbd_assert(start ^ !!rbd_dev->watch_event); | 1770 | rbd_assert(start ^ !!rbd_dev->watch_event); |
| @@ -1790,8 +1788,7 @@ static int rbd_dev_header_watch_sync(struct rbd_device *rbd_dev, int start) | |||
| 1790 | if (!obj_request->osd_req) | 1788 | if (!obj_request->osd_req) |
| 1791 | goto out_cancel; | 1789 | goto out_cancel; |
| 1792 | 1790 | ||
| 1793 | op = &obj_request->osd_req->r_ops[0]; | 1791 | osd_req_op_watch_init(obj_request->osd_req, 0, CEPH_OSD_OP_WATCH, |
| 1794 | osd_req_op_watch_init(op, CEPH_OSD_OP_WATCH, | ||
| 1795 | rbd_dev->watch_event->cookie, | 1792 | rbd_dev->watch_event->cookie, |
| 1796 | rbd_dev->header.obj_version, start); | 1793 | rbd_dev->header.obj_version, start); |
| 1797 | rbd_osd_req_format_op(obj_request, true); | 1794 | rbd_osd_req_format_op(obj_request, true); |
| @@ -1854,7 +1851,6 @@ static int rbd_obj_method_sync(struct rbd_device *rbd_dev, | |||
| 1854 | { | 1851 | { |
| 1855 | struct rbd_obj_request *obj_request; | 1852 | struct rbd_obj_request *obj_request; |
| 1856 | struct ceph_osd_client *osdc; | 1853 | struct ceph_osd_client *osdc; |
| 1857 | struct ceph_osd_req_op *op; | ||
| 1858 | struct page **pages; | 1854 | struct page **pages; |
| 1859 | u32 page_count; | 1855 | u32 page_count; |
| 1860 | int ret; | 1856 | int ret; |
| @@ -1884,8 +1880,8 @@ static int rbd_obj_method_sync(struct rbd_device *rbd_dev, | |||
| 1884 | if (!obj_request->osd_req) | 1880 | if (!obj_request->osd_req) |
| 1885 | goto out; | 1881 | goto out; |
| 1886 | 1882 | ||
| 1887 | op = &obj_request->osd_req->r_ops[0]; | 1883 | osd_req_op_cls_init(obj_request->osd_req, 0, CEPH_OSD_OP_CALL, |
| 1888 | osd_req_op_cls_init(op, CEPH_OSD_OP_CALL, class_name, method_name, | 1884 | class_name, method_name, |
| 1889 | outbound, outbound_size); | 1885 | outbound, outbound_size); |
| 1890 | rbd_osd_req_format_op(obj_request, false); | 1886 | rbd_osd_req_format_op(obj_request, false); |
| 1891 | 1887 | ||
| @@ -2066,7 +2062,6 @@ static int rbd_obj_read_sync(struct rbd_device *rbd_dev, | |||
| 2066 | 2062 | ||
| 2067 | { | 2063 | { |
| 2068 | struct rbd_obj_request *obj_request; | 2064 | struct rbd_obj_request *obj_request; |
| 2069 | struct ceph_osd_req_op *op; | ||
| 2070 | struct ceph_osd_client *osdc; | 2065 | struct ceph_osd_client *osdc; |
| 2071 | struct page **pages = NULL; | 2066 | struct page **pages = NULL; |
| 2072 | u32 page_count; | 2067 | u32 page_count; |
| @@ -2091,8 +2086,8 @@ static int rbd_obj_read_sync(struct rbd_device *rbd_dev, | |||
| 2091 | if (!obj_request->osd_req) | 2086 | if (!obj_request->osd_req) |
| 2092 | goto out; | 2087 | goto out; |
| 2093 | 2088 | ||
| 2094 | op = &obj_request->osd_req->r_ops[0]; | 2089 | osd_req_op_extent_init(obj_request->osd_req, 0, CEPH_OSD_OP_READ, |
| 2095 | osd_req_op_extent_init(op, CEPH_OSD_OP_READ, offset, length, 0, 0); | 2090 | offset, length, 0, 0); |
| 2096 | rbd_osd_req_format_op(obj_request, false); | 2091 | rbd_osd_req_format_op(obj_request, false); |
| 2097 | 2092 | ||
| 2098 | osdc = &rbd_dev->rbd_client->client->osdc; | 2093 | osdc = &rbd_dev->rbd_client->client->osdc; |
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 0ac3a37753cb..cc57104a7266 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
| @@ -926,7 +926,7 @@ get_more_pages: | |||
| 926 | 926 | ||
| 927 | /* Update the write op length in case we changed it */ | 927 | /* Update the write op length in case we changed it */ |
| 928 | 928 | ||
| 929 | osd_req_op_extent_update(&req->r_ops[0], len); | 929 | osd_req_op_extent_update(req, 0, len); |
| 930 | 930 | ||
| 931 | vino = ceph_vino(inode); | 931 | vino = ceph_vino(inode); |
| 932 | ceph_osdc_build_request(req, offset, snapc, vino.snap, | 932 | ceph_osdc_build_request(req, offset, snapc, vino.snap, |
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index ae5193550fbf..144d57cbef9e 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h | |||
| @@ -233,20 +233,25 @@ extern void ceph_osdc_handle_reply(struct ceph_osd_client *osdc, | |||
| 233 | extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc, | 233 | extern void ceph_osdc_handle_map(struct ceph_osd_client *osdc, |
| 234 | struct ceph_msg *msg); | 234 | struct ceph_msg *msg); |
| 235 | 235 | ||
| 236 | extern void osd_req_op_init(struct ceph_osd_req_op *op, u16 opcode); | 236 | extern void osd_req_op_extent_init(struct ceph_osd_request *osd_req, |
| 237 | extern void osd_req_op_extent_init(struct ceph_osd_req_op *op, u16 opcode, | 237 | unsigned int which, u16 opcode, |
| 238 | u64 offset, u64 length, | 238 | u64 offset, u64 length, |
| 239 | u64 truncate_size, u32 truncate_seq); | 239 | u64 truncate_size, u32 truncate_seq); |
| 240 | extern void osd_req_op_extent_update(struct ceph_osd_req_op *op, u64 length); | 240 | extern void osd_req_op_extent_update(struct ceph_osd_request *osd_req, |
| 241 | extern void osd_req_op_extent_osd_data(struct ceph_osd_req_op *op, | 241 | unsigned int which, u64 length); |
| 242 | extern void osd_req_op_extent_osd_data(struct ceph_osd_request *osd_req, | ||
| 243 | unsigned int which, | ||
| 242 | struct ceph_osd_data *osd_data); | 244 | struct ceph_osd_data *osd_data); |
| 243 | extern void osd_req_op_cls_init(struct ceph_osd_req_op *op, u16 opcode, | 245 | extern void osd_req_op_cls_init(struct ceph_osd_request *osd_req, |
| 246 | unsigned int which, u16 opcode, | ||
| 244 | const char *class, const char *method, | 247 | const char *class, const char *method, |
| 245 | const void *request_data, | 248 | const void *request_data, |
| 246 | size_t request_data_size); | ||
