aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/rbd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r--drivers/block/rbd.c60
1 files changed, 13 insertions, 47 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 5d9e2cc5c51e..8f2c39ad3bb0 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1211,41 +1211,6 @@ done:
1211} 1211}
1212 1212
1213/* 1213/*
1214 * Request async osd write
1215 */
1216static int rbd_req_write(struct request *rq,
1217 struct rbd_device *rbd_dev,
1218 struct ceph_snap_context *snapc,
1219 u64 ofs, u64 len,
1220 struct bio *bio,
1221 struct rbd_req_coll *coll,
1222 int coll_index)
1223{
1224 return rbd_do_op(rq, rbd_dev, snapc, CEPH_NOSNAP,
1225 CEPH_OSD_OP_WRITE,
1226 CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK,
1227 ofs, len, bio, coll, coll_index);
1228}
1229
1230/*
1231 * Request async osd read
1232 */
1233static int rbd_req_read(struct request *rq,
1234 struct rbd_device *rbd_dev,
1235 u64 snapid,
1236 u64 ofs, u64 len,
1237 struct bio *bio,
1238 struct rbd_req_coll *coll,
1239 int coll_index)
1240{
1241 return rbd_do_op(rq, rbd_dev, NULL,
1242 snapid,
1243 CEPH_OSD_OP_READ,
1244 CEPH_OSD_FLAG_READ,
1245 ofs, len, bio, coll, coll_index);
1246}
1247
1248/*
1249 * Request sync osd read 1214 * Request sync osd read
1250 */ 1215 */
1251static int rbd_req_sync_read(struct rbd_device *rbd_dev, 1216static int rbd_req_sync_read(struct rbd_device *rbd_dev,
@@ -1550,21 +1515,22 @@ static void rbd_rq_fn(struct request_queue *q)
1550 goto next_seg; 1515 goto next_seg;
1551 } 1516 }
1552 1517
1553
1554 /* init OSD command: write or read */ 1518 /* init OSD command: write or read */
1555 if (do_write) 1519 if (do_write)
1556 rbd_req_write(rq, rbd_dev, 1520 (void) rbd_do_op(rq, rbd_dev,
1557 snapc, 1521 snapc, CEPH_NOSNAP,
1558 ofs, 1522 CEPH_OSD_OP_WRITE,
1559 op_size, bio, 1523 CEPH_OSD_FLAG_WRITE |
1560 coll, cur_seg); 1524 CEPH_OSD_FLAG_ONDISK,
1525 ofs, op_size, bio,
1526 coll, cur_seg);
1561 else 1527 else
1562 rbd_req_read(rq, rbd_dev, 1528 (void) rbd_do_op(rq, rbd_dev,
1563 rbd_dev->mapping.snap_id, 1529 NULL, rbd_dev->mapping.snap_id,
1564 ofs, 1530 CEPH_OSD_OP_READ,
1565 op_size, bio, 1531 CEPH_OSD_FLAG_READ,
1566 coll, cur_seg); 1532 ofs, op_size, bio,
1567 1533 coll, cur_seg);
1568next_seg: 1534next_seg:
1569 size -= op_size; 1535 size -= op_size;
1570 ofs += op_size; 1536 ofs += op_size;