Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359605
b: refs/heads/master
c: 2e53c6c
h: refs/heads/master
i:
  359603: 3429ad7
v: v3
  • Loading branch information
Alex Elder committed Jan 17, 2013
1 parent d39e917 commit 13e319f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 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: 907703d050df92979b3848ee42f88d5c9c6c13fe
refs/heads/master: 2e53c6c379b65372df21f4d6019f6eb63af81384
48 changes: 24 additions & 24 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,45 +1113,43 @@ static int rbd_do_request(struct request *rq,
struct ceph_osd_request **linger_req,
u64 *ver)
{
struct ceph_osd_client *osdc;
struct ceph_osd_request *osd_req;
int ret;
struct rbd_request *rbd_req = NULL;
struct timespec mtime = CURRENT_TIME;
struct rbd_request *rbd_req;
struct ceph_osd_client *osdc;

rbd_req = kzalloc(sizeof(*rbd_req), GFP_NOIO);
if (!rbd_req)
return -ENOMEM;

if (coll) {
rbd_req->coll = coll;
rbd_req->coll_index = coll_index;
}
int ret;

dout("rbd_do_request object_name=%s ofs=%llu len=%llu coll=%p[%d]\n",
object_name, (unsigned long long) ofs,
(unsigned long long) len, coll, coll_index);

osdc = &rbd_dev->rbd_client->client->osdc;
osd_req = ceph_osdc_alloc_request(osdc, snapc, 1, false, GFP_NOIO);
if (!osd_req) {
ret = -ENOMEM;
goto done_pages;
}
if (!osd_req)
return -ENOMEM;

osd_req->r_flags = flags;
osd_req->r_pages = pages;
if (bio) {
osd_req->r_bio = bio;
bio_get(osd_req->r_bio);
}
osd_req->r_callback = rbd_cb;

rbd_req->rq = rq;
rbd_req->bio = bio;
rbd_req->pages = pages;
rbd_req->len = len;
if (rbd_cb) {
ret = -ENOMEM;
rbd_req = kmalloc(sizeof(*rbd_req), GFP_NOIO);
if (!rbd_req)
goto done_osd_req;

rbd_req->rq = rq;
rbd_req->bio = bio;
rbd_req->pages = pages;
rbd_req->len = len;
rbd_req->coll = coll;
rbd_req->coll_index = coll ? coll_index : 0;
}

osd_req->r_callback = rbd_cb;
osd_req->r_priv = rbd_req;

strncpy(osd_req->r_oid, object_name, sizeof(osd_req->r_oid));
Expand Down Expand Up @@ -1193,10 +1191,12 @@ static int rbd_do_request(struct request *rq,
return ret;

done_err:
bio_chain_put(rbd_req->bio);
ceph_osdc_put_request(osd_req);
done_pages:
if (bio)
bio_chain_put(osd_req->r_bio);
kfree(rbd_req);
done_osd_req:
ceph_osdc_put_request(osd_req);

return ret;
}

Expand Down

0 comments on commit 13e319f

Please sign in to comment.