Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359643
b: refs/heads/master
c: 25dcf95
h: refs/heads/master
i:
  359641: 6019ee3
  359639: bcd64ab
v: v3
  • Loading branch information
Alex Elder authored and Sage Weil committed Feb 14, 2013
1 parent d512347 commit 170d34d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 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: 975241afcbba82ab1ddc6ebf8a02246d1e9314fd
refs/heads/master: 25dcf954c3230946b5f3e18db9f91d7640eff76e
16 changes: 12 additions & 4 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1063,22 +1063,29 @@ static void rbd_img_request_put(struct rbd_img_request *img_request)
static inline void rbd_img_obj_request_add(struct rbd_img_request *img_request,
struct rbd_obj_request *obj_request)
{
rbd_assert(obj_request->img_request == NULL);

rbd_obj_request_get(obj_request);
obj_request->img_request = img_request;
list_add_tail(&obj_request->links, &img_request->obj_requests);
obj_request->which = img_request->obj_request_count++;
obj_request->which = img_request->obj_request_count;
rbd_assert(obj_request->which != BAD_WHICH);
img_request->obj_request_count++;
list_add_tail(&obj_request->links, &img_request->obj_requests);
}

static inline void rbd_img_obj_request_del(struct rbd_img_request *img_request,
struct rbd_obj_request *obj_request)
{
rbd_assert(obj_request->which != BAD_WHICH);
obj_request->which = BAD_WHICH;

list_del(&obj_request->links);
rbd_assert(img_request->obj_request_count > 0);
img_request->obj_request_count--;
rbd_assert(obj_request->which == img_request->obj_request_count);
obj_request->which = BAD_WHICH;
rbd_assert(obj_request->img_request == img_request);
obj_request->callback = NULL;
obj_request->img_request = NULL;
obj_request->callback = NULL;
rbd_obj_request_put(obj_request);
}

Expand Down Expand Up @@ -1472,6 +1479,7 @@ static void rbd_img_request_destroy(struct kref *kref)

for_each_obj_request_safe(img_request, obj_request, next_obj_request)
rbd_img_obj_request_del(img_request, obj_request);
rbd_assert(img_request->obj_request_count == 0);

if (img_request->write_request)
ceph_put_snap_context(img_request->snapc);
Expand Down

0 comments on commit 170d34d

Please sign in to comment.