Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347567
b: refs/heads/master
c: 13f4042
h: refs/heads/master
i:
  347565: 017288e
  347563: 298ea98
  347559: b97ea2f
  347551: c64a76d
v: v3
  • Loading branch information
Alex Elder committed Oct 26, 2012
1 parent e79c8a0 commit 5e23228
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 48 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: be466c1cc36621590ef17b05a6d342dfd33f7280
refs/heads/master: 13f4042c05b6a1a638ccab3f0cabdb84993803a2
60 changes: 13 additions & 47 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1210,41 +1210,6 @@ static int rbd_do_op(struct request *rq,
return ret;
}

/*
* Request async osd write
*/
static int rbd_req_write(struct request *rq,
struct rbd_device *rbd_dev,
struct ceph_snap_context *snapc,
u64 ofs, u64 len,
struct bio *bio,
struct rbd_req_coll *coll,
int coll_index)
{
return rbd_do_op(rq, rbd_dev, snapc, CEPH_NOSNAP,
CEPH_OSD_OP_WRITE,
CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK,
ofs, len, bio, coll, coll_index);
}

/*
* Request async osd read
*/
static int rbd_req_read(struct request *rq,
struct rbd_device *rbd_dev,
u64 snapid,
u64 ofs, u64 len,
struct bio *bio,
struct rbd_req_coll *coll,
int coll_index)
{
return rbd_do_op(rq, rbd_dev, NULL,
snapid,
CEPH_OSD_OP_READ,
CEPH_OSD_FLAG_READ,
ofs, len, bio, coll, coll_index);
}

/*
* Request sync osd read
*/
Expand Down Expand Up @@ -1550,21 +1515,22 @@ static void rbd_rq_fn(struct request_queue *q)
goto next_seg;
}


/* init OSD command: write or read */
if (do_write)
rbd_req_write(rq, rbd_dev,
snapc,
ofs,
op_size, bio,
coll, cur_seg);
(void) rbd_do_op(rq, rbd_dev,
snapc, CEPH_NOSNAP,
CEPH_OSD_OP_WRITE,
CEPH_OSD_FLAG_WRITE |
CEPH_OSD_FLAG_ONDISK,
ofs, op_size, bio,
coll, cur_seg);
else
rbd_req_read(rq, rbd_dev,
rbd_dev->mapping.snap_id,
ofs,
op_size, bio,
coll, cur_seg);

(void) rbd_do_op(rq, rbd_dev,
NULL, rbd_dev->mapping.snap_id,
CEPH_OSD_OP_READ,
CEPH_OSD_FLAG_READ,
ofs, op_size, bio,
coll, cur_seg);
next_seg:
size -= op_size;
ofs += op_size;
Expand Down

0 comments on commit 5e23228

Please sign in to comment.