Skip to content

Commit

Permalink
libceph: pass length to ceph_osdc_build_request()
Browse files Browse the repository at this point in the history
The len argument to ceph_osdc_build_request() is set up to be
passed by address, but that function never updates its value
so there's no need to do this.  Tighten up the interface by
passing the length directly.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
  • Loading branch information
Alex Elder committed Jan 17, 2013
1 parent 5b9d1b1 commit 0120be3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ static int rbd_do_request(struct request *rq,
snapid, ofs, &len, &bno, osd_req, ops);
rbd_assert(ret == 0);

ceph_osdc_build_request(osd_req, ofs, &len, ops, snapc, &mtime);
ceph_osdc_build_request(osd_req, ofs, len, ops, snapc, &mtime);

if (linger_req) {
ceph_osdc_set_request_linger(osdc, osd_req);
Expand Down
2 changes: 1 addition & 1 deletion include/linux/ceph/osd_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ extern struct ceph_osd_request *ceph_osdc_alloc_request(struct ceph_osd_client *
struct bio *bio);

extern void ceph_osdc_build_request(struct ceph_osd_request *req,
u64 off, u64 *plen,
u64 off, u64 len,
struct ceph_osd_req_op *src_ops,
struct ceph_snap_context *snapc,
struct timespec *mtime);
Expand Down
6 changes: 3 additions & 3 deletions net/ceph/osd_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ static void osd_req_encode_op(struct ceph_osd_request *req,
*
*/
void ceph_osdc_build_request(struct ceph_osd_request *req,
u64 off, u64 *plen,
u64 off, u64 len,
struct ceph_osd_req_op *src_ops,
struct ceph_snap_context *snapc,
struct timespec *mtime)
Expand Down Expand Up @@ -390,7 +390,7 @@ void ceph_osdc_build_request(struct ceph_osd_request *req,

if (flags & CEPH_OSD_FLAG_WRITE) {
req->r_request->hdr.data_off = cpu_to_le16(off);
req->r_request->hdr.data_len = cpu_to_le32(*plen + data_len);
req->r_request->hdr.data_len = cpu_to_le32(len + data_len);
} else if (data_len) {
req->r_request->hdr.data_off = 0;
req->r_request->hdr.data_len = cpu_to_le32(data_len);
Expand Down Expand Up @@ -464,7 +464,7 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
req->r_num_pages = calc_pages_for(page_align, *plen);
req->r_page_alignment = page_align;

ceph_osdc_build_request(req, off, plen, ops,
ceph_osdc_build_request(req, off, *plen, ops,
snapc,
mtime);

Expand Down

0 comments on commit 0120be3

Please sign in to comment.