aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/block/rbd.c3
-rw-r--r--include/linux/ceph/osd_client.h1
-rw-r--r--net/ceph/osd_client.c11
3 files changed, 6 insertions, 9 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index ac8fd3856509..bdbaa4cfd9d3 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1148,13 +1148,14 @@ static int rbd_do_request(struct request *rq,
1148 (unsigned long long) len, coll, coll_index); 1148 (unsigned long long) len, coll, coll_index);
1149 1149
1150 osdc = &rbd_dev->rbd_client->client->osdc; 1150 osdc = &rbd_dev->rbd_client->client->osdc;
1151 osd_req = ceph_osdc_alloc_request(osdc, flags, snapc, ops, 1151 osd_req = ceph_osdc_alloc_request(osdc, snapc, ops,
1152 false, GFP_NOIO, pages, bio); 1152 false, GFP_NOIO, pages, bio);
1153 if (!osd_req) { 1153 if (!osd_req) {
1154 ret = -ENOMEM; 1154 ret = -ENOMEM;
1155 goto done_pages; 1155 goto done_pages;
1156 } 1156 }
1157 1157
1158 osd_req->r_flags = flags;
1158 osd_req->r_callback = rbd_cb; 1159 osd_req->r_callback = rbd_cb;
1159 1160
1160 rbd_req->rq = rq; 1161 rbd_req->rq = rq;
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index fe3a6e8db1f9..6ddda5bbd1a6 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -213,7 +213,6 @@ extern int ceph_calc_raw_layout(struct ceph_file_layout *layout,
213 struct ceph_osd_req_op *op); 213 struct ceph_osd_req_op *op);
214 214
215extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, 215extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc,
216 int flags,
217 struct ceph_snap_context *snapc, 216 struct ceph_snap_context *snapc,
218 struct ceph_osd_req_op *ops, 217 struct ceph_osd_req_op *ops,
219 bool use_mempool, 218 bool use_mempool,
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index cd9c28387de3..77ce1edaa07d 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -171,7 +171,6 @@ static int get_num_ops(struct ceph_osd_req_op *ops)
171} 171}
172 172
173struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc, 173struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc,
174 int flags,
175 struct ceph_snap_context *snapc, 174 struct ceph_snap_context *snapc,
176 struct ceph_osd_req_op *ops, 175 struct ceph_osd_req_op *ops,
177 bool use_mempool, 176 bool use_mempool,
@@ -208,10 +207,6 @@ struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *osdc,
208 INIT_LIST_HEAD(&req->r_req_lru_item); 207 INIT_LIST_HEAD(&req->r_req_lru_item);
209 INIT_LIST_HEAD(&req->r_osd_item); 208 INIT_LIST_HEAD(&req->r_osd_item);
210 209
211 req->r_flags = flags;
212
213 WARN_ON((flags & (CEPH_OSD_FLAG_READ|CEPH_OSD_FLAG_WRITE)) == 0);
214
215 /* create reply message */ 210 /* create reply message */
216 if (use_mempool) 211 if (use_mempool)
217 msg = ceph_msgpool_get(&osdc->msgpool_op_reply, 0); 212 msg = ceph_msgpool_get(&osdc->msgpool_op_reply, 0);
@@ -347,6 +342,8 @@ void ceph_osdc_build_request(struct ceph_osd_request *req,
347 u64 data_len = 0; 342 u64 data_len = 0;
348 int i; 343 int i;
349 344
345 WARN_ON((flags & (CEPH_OSD_FLAG_READ|CEPH_OSD_FLAG_WRITE)) == 0);
346
350 head = msg->front.iov_base; 347 head = msg->front.iov_base;
351 head->snapid = cpu_to_le64(snap_id); 348 head->snapid = cpu_to_le64(snap_id);
352 op = (void *)(head + 1); 349 op = (void *)(head + 1);
@@ -442,12 +439,12 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
442 } else 439 } else
443 ops[1].op = 0; 440 ops[1].op = 0;
444 441
445 req = ceph_osdc_alloc_request(osdc, flags, 442 req = ceph_osdc_alloc_request(osdc, snapc, ops,
446 snapc, ops,
447 use_mempool, 443 use_mempool,
448 GFP_NOFS, NULL, NULL); 444 GFP_NOFS, NULL, NULL);
449 if (!req) 445 if (!req)
450 return ERR_PTR(-ENOMEM); 446 return ERR_PTR(-ENOMEM);
447 req->r_flags = flags;
451 448
452 /* calculate max write size */ 449 /* calculate max write size */
453 r = calc_layout(vino, layout, off, plen, req, ops); 450 r = calc_layout(vino, layout, off, plen, req, ops);