All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <elder@inktank.com>
To: ceph-devel@vger.kernel.org
Subject: [PATCH 4/7] rbd: adjust image object request ref counting
Date: Mon, 15 Apr 2013 22:38:15 -0500	[thread overview]
Message-ID: <516CC7A7.5060907@inktank.com> (raw)
In-Reply-To: <516CC6E4.6070307@inktank.com>

An extra reference is taken when an object request is added as one
of the requests making up an image object.  A reference is dropped
again when the image's object requests get submitted.

The original reference for the object request will remain throughout
this period, so we don't need to add and then take away an extra
one.

This can be interpreted as the image request inheriting the original
object request's reference.

Signed-off-by: Alex Elder <elder@inktank.com>
---
 drivers/block/rbd.c |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 8e8b876..81751cd 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1167,7 +1167,7 @@ static inline void rbd_img_obj_request_add(struct
rbd_img_request *img_request,
 {
 	rbd_assert(obj_request->img_request == NULL);

-	rbd_obj_request_get(obj_request);
+	/* Image request now owns object's original reference */
 	obj_request->img_request = img_request;
 	obj_request->which = img_request->obj_request_count;
 	rbd_assert(!obj_request_img_data_test(obj_request));
@@ -1815,12 +1815,6 @@ static int rbd_img_request_submit(struct
rbd_img_request *img_request)
 		ret = rbd_obj_request_submit(osdc, obj_request);
 		if (ret)
 			return ret;
-		/*
-		 * The image request has its own reference to each
-		 * of its object requests, so we can safely drop the
-		 * initial one here.
-		 */
-		rbd_obj_request_put(obj_request);
 	}

 	return 0;
-- 
1.7.9.5


  parent reply	other threads:[~2013-04-16  3:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-16  3:35 [PATCH 0/7] rbd: existence check or layered writes Alex Elder
2013-04-16  3:36 ` [PATCH 1/7] libceph: kill off osd data write_request parameters Alex Elder
2013-04-16  3:37 ` [PATCH 2/7] libceph: clean up osd data field access functions Alex Elder
2013-04-16  3:38 ` [PATCH 3/7] libceph: support raw data requests Alex Elder
2013-04-16  3:38 ` Alex Elder [this message]
2013-04-16  3:38 ` [PATCH 5/7] rbd: always check IMG_DATA flag Alex Elder
2013-04-16  3:38 ` [PATCH 6/7] rbd: add target object existence flags Alex Elder
2013-04-16  3:38 ` [PATCH 7/7] rbd: issue stat request before layered write Alex Elder
2013-04-18 12:44   ` [PATCH 7/7, v2] " Alex Elder
2013-04-20  3:03     ` Josh Durgin
2013-04-20  3:04 ` [PATCH 0/7] rbd: existence check or layered writes Josh Durgin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=516CC7A7.5060907@inktank.com \
    --to=elder@inktank.com \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.