aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/block/rbd.c15
-rw-r--r--net/ceph/osd_client.c3
2 files changed, 17 insertions, 1 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index ff9e9255745c..09514d9d8a97 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1148,6 +1148,8 @@ struct ceph_osd_req_op *rbd_osd_req_op_create(u16 opcode, ...)
1148 if (opcode == CEPH_OSD_OP_WRITE) 1148 if (opcode == CEPH_OSD_OP_WRITE)
1149 op->payload_len = op->extent.length; 1149 op->payload_len = op->extent.length;
1150 break; 1150 break;
1151 case CEPH_OSD_OP_STAT:
1152 break;
1151 case CEPH_OSD_OP_CALL: 1153 case CEPH_OSD_OP_CALL:
1152 /* rbd_osd_req_op_create(CALL, class, method, data, datalen) */ 1154 /* rbd_osd_req_op_create(CALL, class, method, data, datalen) */
1153 op->cls.class_name = va_arg(args, char *); 1155 op->cls.class_name = va_arg(args, char *);
@@ -1277,6 +1279,16 @@ static void rbd_osd_write_callback(struct rbd_obj_request *obj_request,
1277 obj_request_done_set(obj_request); 1279 obj_request_done_set(obj_request);
1278} 1280}
1279 1281
1282/*
1283 * For a simple stat call there's nothing to do. We'll do more if
1284 * this is part of a write sequence for a layered image.
1285 */
1286static void rbd_osd_stat_callback(struct rbd_obj_request *obj_request,
1287 struct ceph_osd_op *op)
1288{
1289 obj_request_done_set(obj_request);
1290}
1291
1280static void rbd_osd_req_callback(struct ceph_osd_request *osd_req, 1292static void rbd_osd_req_callback(struct ceph_osd_request *osd_req,
1281 struct ceph_msg *msg) 1293 struct ceph_msg *msg)
1282{ 1294{
@@ -1307,6 +1319,9 @@ static void rbd_osd_req_callback(struct ceph_osd_request *osd_req,
1307 case CEPH_OSD_OP_WRITE: 1319 case CEPH_OSD_OP_WRITE:
1308 rbd_osd_write_callback(obj_request, op); 1320 rbd_osd_write_callback(obj_request, op);
1309 break; 1321 break;
1322 case CEPH_OSD_OP_STAT:
1323 rbd_osd_stat_callback(obj_request, op);
1324 break;
1310 case CEPH_OSD_OP_CALL: 1325 case CEPH_OSD_OP_CALL:
1311 case CEPH_OSD_OP_NOTIFY_ACK: 1326 case CEPH_OSD_OP_NOTIFY_ACK:
1312 case CEPH_OSD_OP_WATCH: 1327 case CEPH_OSD_OP_WATCH:
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index b58748ec405d..39629b66f3b1 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -220,6 +220,8 @@ static void osd_req_encode_op(struct ceph_osd_request *req,
220 dst->op = cpu_to_le16(src->op); 220 dst->op = cpu_to_le16(src->op);
221 221
222 switch (src->op) { 222 switch (src->op) {
223 case CEPH_OSD_OP_STAT:
224 break;
223 case CEPH_OSD_OP_READ: 225 case CEPH_OSD_OP_READ:
224 case CEPH_OSD_OP_WRITE: 226 case CEPH_OSD_OP_WRITE:
225 dst->extent.offset = 227 dst->extent.offset =
@@ -255,7 +257,6 @@ static void osd_req_encode_op(struct ceph_osd_request *req,
255 pr_err("unrecognized osd opcode %d\n", dst->op); 257 pr_err("unrecognized osd opcode %d\n", dst->op);
256 WARN_ON(1); 258 WARN_ON(1);
257 break; 259 break;
258 case CEPH_OSD_OP_STAT:
259 case CEPH_OSD_OP_MAPEXT: 260 case CEPH_OSD_OP_MAPEXT:
260 case CEPH_OSD_OP_MASKTRUNC: 261 case CEPH_OSD_OP_MASKTRUNC:
261 case CEPH_OSD_OP_SPARSE_READ: 262 case CEPH_OSD_OP_SPARSE_READ: