Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347569
b: refs/heads/master
c: 4634246
h: refs/heads/master
i:
  347567: 5e23228
v: v3
  • Loading branch information
Alex Elder committed Oct 26, 2012
1 parent 5910e49 commit b57288e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 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: ff2e4bb5b32f89c455979a4222a9b78007cde254
refs/heads/master: 4634246db8cb2e5117ef7c682efcc383fa3354f8
26 changes: 9 additions & 17 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,6 @@ static int rbd_req_sync_op(struct rbd_device *rbd_dev,
static int rbd_do_op(struct request *rq,
struct rbd_device *rbd_dev,
struct ceph_snap_context *snapc,
u64 snapid,
u64 ofs, u64 len,
struct bio *bio,
struct rbd_req_coll *coll,
Expand All @@ -1177,6 +1176,7 @@ static int rbd_do_op(struct request *rq,
u32 payload_len;
int opcode;
int flags;
u64 snapid;

seg_name = rbd_segment_name(rbd_dev, ofs);
if (!seg_name)
Expand All @@ -1187,10 +1187,13 @@ static int rbd_do_op(struct request *rq,
if (rq_data_dir(rq) == WRITE) {
opcode = CEPH_OSD_OP_WRITE;
flags = CEPH_OSD_FLAG_WRITE|CEPH_OSD_FLAG_ONDISK;
snapid = CEPH_NOSNAP;
payload_len = seg_len;
} else {
opcode = CEPH_OSD_OP_READ;
flags = CEPH_OSD_FLAG_READ;
snapc = NULL;
snapid = rbd_dev->mapping.snap_id;
payload_len = 0;
}

Expand Down Expand Up @@ -1518,24 +1521,13 @@ static void rbd_rq_fn(struct request_queue *q)
kref_get(&coll->kref);
bio = bio_chain_clone(&rq_bio, &next_bio, &bp,
op_size, GFP_ATOMIC);
if (!bio) {
if (bio)
(void) rbd_do_op(rq, rbd_dev, snapc,
ofs, op_size,
bio, coll, cur_seg);
else
rbd_coll_end_req_index(rq, coll, cur_seg,
-ENOMEM, op_size);
goto next_seg;
}

/* init OSD command: write or read */
if (do_write)
(void) rbd_do_op(rq, rbd_dev,
snapc, CEPH_NOSNAP,
ofs, op_size, bio,
coll, cur_seg);
else
(void) rbd_do_op(rq, rbd_dev,
NULL, rbd_dev->mapping.snap_id,
ofs, op_size, bio,
coll, cur_seg);
next_seg:
size -= op_size;
ofs += op_size;

Expand Down

0 comments on commit b57288e

Please sign in to comment.