Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359631
b: refs/heads/master
c: 7d250b9
h: refs/heads/master
i:
  359629: 1890390
  359627: c5c309b
  359623: d35496b
  359615: 79f36e3
v: v3
  • Loading branch information
Alex Elder authored and Sage Weil committed Feb 14, 2013
1 parent f519ab5 commit 1b8329f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 56 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: 2250a71b591728092db9adcc51629401deb2f9f8
refs/heads/master: 7d250b949a33c8a658a2ad4ab390d8394b842224
58 changes: 3 additions & 55 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,25 +162,6 @@ struct rbd_client {
struct list_head node;
};

/*
* a request completion status
*/
struct rbd_req_status {
int done;
s32 rc;
u64 bytes;
};

/*
* a collection of requests
*/
struct rbd_req_coll {
int total;
int num_done;
struct kref kref;
struct rbd_req_status status[0];
};

struct rbd_img_request;
typedef void (*rbd_img_callback_t)(struct rbd_img_request *);

Expand Down Expand Up @@ -242,18 +223,6 @@ struct rbd_img_request {
#define for_each_obj_request_safe(ireq, oreq, n) \
list_for_each_entry_safe_reverse(oreq, n, &ireq->obj_requests, links)

/*
* a single io request
*/
struct rbd_request {
struct request *rq; /* blk layer request */
struct bio *bio; /* cloned bio */
struct page **pages; /* list of used pages */
u64 len;
int coll_index;
struct rbd_req_coll *coll;
};

struct rbd_snap {
struct device dev;
const char *name;
Expand Down Expand Up @@ -1195,21 +1164,18 @@ static int rbd_do_request(struct request *rq,
int num_pages,
int flags,
struct ceph_osd_req_op *op,
struct rbd_req_coll *coll,
int coll_index,
void (*rbd_cb)(struct ceph_osd_request *,
struct ceph_msg *),
u64 *ver)
{
struct ceph_osd_client *osdc;
struct ceph_osd_request *osd_req;
struct rbd_request *rbd_req = NULL;
struct timespec mtime = CURRENT_TIME;
int ret;

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

osdc = &rbd_dev->rbd_client->client->osdc;
osd_req = ceph_osdc_alloc_request(osdc, snapc, 1, false, GFP_NOIO);
Expand All @@ -1223,22 +1189,8 @@ static int rbd_do_request(struct request *rq,
bio_get(osd_req->r_bio);
}

if (coll) {
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_index;
}

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

strncpy(osd_req->r_oid, object_name, sizeof(osd_req->r_oid));
osd_req->r_oid_len = strlen(osd_req->r_oid);
Expand Down Expand Up @@ -1274,8 +1226,6 @@ static int rbd_do_request(struct request *rq,
done_err:
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 Expand Up @@ -1314,7 +1264,6 @@ static int rbd_req_sync_op(struct rbd_device *rbd_dev,
pages, num_pages,
flags,
op,
NULL, 0,
NULL,
ver);
if (ret < 0)
Expand Down Expand Up @@ -1390,7 +1339,6 @@ static int rbd_req_sync_notify_ack(struct rbd_device *rbd_dev,
NULL, 0,
CEPH_OSD_FLAG_READ,
op,
NULL, 0,
rbd_simple_req_cb, NULL);

rbd_osd_req_op_destroy(op);
Expand Down

0 comments on commit 1b8329f

Please sign in to comment.