rbd: kill rbd_req_{read,write}()
Both rbd_req_read() and rbd_req_write() are simple wrapper routines for rbd_do_op(), and each is only called once. Replace each wrapper call with a direct call to rbd_do_op(), and get rid of the wrapper functions. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
This commit is contained in:
parent
be466c1cc3
commit
13f4042c05
1 changed files with 13 additions and 47 deletions
|
@ -1210,41 +1210,6 @@ done:
|
||||||
return ret;
|
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
|
* Request sync osd read
|
||||||
*/
|
*/
|
||||||
|
@ -1550,21 +1515,22 @@ static void rbd_rq_fn(struct request_queue *q)
|
||||||
goto next_seg;
|
goto next_seg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* init OSD command: write or read */
|
/* init OSD command: write or read */
|
||||||
if (do_write)
|
if (do_write)
|
||||||
rbd_req_write(rq, rbd_dev,
|
(void) rbd_do_op(rq, rbd_dev,
|
||||||
snapc,
|
snapc, CEPH_NOSNAP,
|
||||||
ofs,
|
CEPH_OSD_OP_WRITE,
|
||||||
op_size, bio,
|
CEPH_OSD_FLAG_WRITE |
|
||||||
coll, cur_seg);
|
CEPH_OSD_FLAG_ONDISK,
|
||||||
|
ofs, op_size, bio,
|
||||||
|
coll, cur_seg);
|
||||||
else
|
else
|
||||||
rbd_req_read(rq, rbd_dev,
|
(void) rbd_do_op(rq, rbd_dev,
|
||||||
rbd_dev->mapping.snap_id,
|
NULL, rbd_dev->mapping.snap_id,
|
||||||
ofs,
|
CEPH_OSD_OP_READ,
|
||||||
op_size, bio,
|
CEPH_OSD_FLAG_READ,
|
||||||
coll, cur_seg);
|
ofs, op_size, bio,
|
||||||
|
coll, cur_seg);
|
||||||
next_seg:
|
next_seg:
|
||||||
size -= op_size;
|
size -= op_size;
|
||||||
ofs += op_size;
|
ofs += op_size;
|
||||||
|
|
Loading…
Reference in a new issue