Skip to content

Commit

Permalink
rbd: don't bother setting snapid in rbd_do_request()
Browse files Browse the repository at this point in the history
For some reason, the snapid field of the osd request header is
explicitly set to CEPH_NOSNAP in rbd_do_request().  Just a few lines
later--with no code that would access this field in between--a call
is made to ceph_calc_raw_layout() passing the snapid provided to
rbd_do_request(), which encodes the snapid value it is provided into
that field instead.

In other words, there is no need to fill in CEPH_NOSNAP, and doing
so suggests it might be necessary.  Don't do that any more.

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 25704ac commit 7c3d22c
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,6 @@ static int rbd_do_request(struct request *rq,
u64 bno;
struct timespec mtime = CURRENT_TIME;
struct rbd_request *rbd_req;
struct ceph_osd_request_head *reqhead;
struct ceph_osd_client *osdc;

rbd_req = kzalloc(sizeof(*rbd_req), GFP_NOIO);
Expand Down Expand Up @@ -1165,9 +1164,6 @@ static int rbd_do_request(struct request *rq,

osd_req->r_priv = rbd_req;

reqhead = osd_req->r_request->front.iov_base;
reqhead->snapid = cpu_to_le64(CEPH_NOSNAP);

strncpy(osd_req->r_oid, object_name, sizeof(osd_req->r_oid));
osd_req->r_oid_len = strlen(osd_req->r_oid);

Expand Down

0 comments on commit 7c3d22c

Please sign in to comment.