All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rbd: drop original request earlier for existence check
@ 2013-05-14  1:39 Alex Elder
  2013-05-14  1:41 ` Alex Elder
  2013-05-16 21:29 ` [PATCH, v2] " Alex Elder
  0 siblings, 2 replies; 4+ messages in thread
From: Alex Elder @ 2013-05-14  1:39 UTC (permalink / raw)
  To: ceph-devel

The reference to the original request dropped at the end of
rbd_img_obj_exists_callback() corresponds to the reference taken
in rbd_img_obj_exists_submit() to account for the stat request
referring to it.  Move the put of that reference up right after
clearing that pointer to make its purpose more obvious.

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

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 632dd35..b2f5c96 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2528,6 +2528,7 @@ static void rbd_img_obj_exists_callback(struct
rbd_obj_request *obj_request)
 	 */
 	orig_request = obj_request->obj_request;
 	obj_request->obj_request = NULL;
+	rbd_obj_request_put(orig_request);
 	rbd_assert(orig_request);
 	rbd_assert(orig_request->img_request);

@@ -2548,7 +2549,6 @@ static void rbd_img_obj_exists_callback(struct
rbd_obj_request *obj_request)
 	if (!rbd_dev->parent_overlap) {
 		struct ceph_osd_client *osdc;

-		rbd_obj_request_put(orig_request);
 		osdc = &rbd_dev->rbd_client->client->osdc;
 		result = rbd_obj_request_submit(osdc, orig_request);
 		if (!result)
@@ -2578,7 +2578,6 @@ static void rbd_img_obj_exists_callback(struct
rbd_obj_request *obj_request)
 out:
 	if (orig_request->result)
 		rbd_obj_request_complete(orig_request);
-	rbd_obj_request_put(orig_request);
 }

 static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] rbd: drop original request earlier for existence check
  2013-05-14  1:39 [PATCH] rbd: drop original request earlier for existence check Alex Elder
@ 2013-05-14  1:41 ` Alex Elder
  2013-05-16 21:29 ` [PATCH, v2] " Alex Elder
  1 sibling, 0 replies; 4+ messages in thread
From: Alex Elder @ 2013-05-14  1:41 UTC (permalink / raw)
  To: ceph-devel

On 05/13/2013 08:39 PM, Alex Elder wrote:
> The reference to the original request dropped at the end of
> rbd_img_obj_exists_callback() corresponds to the reference taken
> in rbd_img_obj_exists_submit() to account for the stat request
> referring to it.  Move the put of that reference up right after
> clearing that pointer to make its purpose more obvious.

This patch and the one I just posted are available in the
"review/wip-postflatten" branch of the ceph-client git
repository.

					-Alex

> Signed-off-by: Alex Elder <elder@inktank.com>
> ---
>  drivers/block/rbd.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index 632dd35..b2f5c96 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -2528,6 +2528,7 @@ static void rbd_img_obj_exists_callback(struct
> rbd_obj_request *obj_request)
>  	 */
>  	orig_request = obj_request->obj_request;
>  	obj_request->obj_request = NULL;
> +	rbd_obj_request_put(orig_request);
>  	rbd_assert(orig_request);
>  	rbd_assert(orig_request->img_request);
> 
> @@ -2548,7 +2549,6 @@ static void rbd_img_obj_exists_callback(struct
> rbd_obj_request *obj_request)
>  	if (!rbd_dev->parent_overlap) {
>  		struct ceph_osd_client *osdc;
> 
> -		rbd_obj_request_put(orig_request);
>  		osdc = &rbd_dev->rbd_client->client->osdc;
>  		result = rbd_obj_request_submit(osdc, orig_request);
>  		if (!result)
> @@ -2578,7 +2578,6 @@ static void rbd_img_obj_exists_callback(struct
> rbd_obj_request *obj_request)
>  out:
>  	if (orig_request->result)
>  		rbd_obj_request_complete(orig_request);
> -	rbd_obj_request_put(orig_request);
>  }
> 
>  static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH, v2] rbd: drop original request earlier for existence check
  2013-05-14  1:39 [PATCH] rbd: drop original request earlier for existence check Alex Elder
  2013-05-14  1:41 ` Alex Elder
@ 2013-05-16 21:29 ` Alex Elder
  2013-05-17  1:42   ` Josh Durgin
  1 sibling, 1 reply; 4+ messages in thread
From: Alex Elder @ 2013-05-16 21:29 UTC (permalink / raw)
  To: ceph-devel

The reference to the original request dropped at the end of
rbd_img_obj_exists_callback() corresponds to the reference taken
in rbd_img_obj_exists_submit() to account for the stat request
referring to it.  Move the put of that reference up right after
clearing that pointer to make its purpose more obvious.

Signed-off-by: Alex Elder <elder@inktank.com>
---
v2: rebased to reflect changes in earlier patches

 drivers/block/rbd.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index fdbcf04..b4c5e47 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2529,6 +2529,7 @@ static void rbd_img_obj_exists_callback(struct
rbd_obj_request *obj_request)
 	 */
 	orig_request = obj_request->obj_request;
 	obj_request->obj_request = NULL;
+	rbd_obj_request_put(orig_request);
 	rbd_assert(orig_request);
 	rbd_assert(orig_request->img_request);

@@ -2549,7 +2550,6 @@ static void rbd_img_obj_exists_callback(struct
rbd_obj_request *obj_request)
 	if (!rbd_dev->parent_overlap) {
 		struct ceph_osd_client *osdc;

-		rbd_obj_request_put(orig_request);
 		osdc = &rbd_dev->rbd_client->client->osdc;
 		result = rbd_obj_request_submit(osdc, orig_request);
 		if (!result)
@@ -2579,7 +2579,6 @@ static void rbd_img_obj_exists_callback(struct
rbd_obj_request *obj_request)
 out:
 	if (orig_request->result)
 		rbd_obj_request_complete(orig_request);
-	rbd_obj_request_put(orig_request);
 }

 static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH, v2] rbd: drop original request earlier for existence check
  2013-05-16 21:29 ` [PATCH, v2] " Alex Elder
@ 2013-05-17  1:42   ` Josh Durgin
  0 siblings, 0 replies; 4+ messages in thread
From: Josh Durgin @ 2013-05-17  1:42 UTC (permalink / raw)
  To: Alex Elder; +Cc: ceph-devel

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>

On 05/16/2013 02:29 PM, Alex Elder wrote:
> The reference to the original request dropped at the end of
> rbd_img_obj_exists_callback() corresponds to the reference taken
> in rbd_img_obj_exists_submit() to account for the stat request
> referring to it.  Move the put of that reference up right after
> clearing that pointer to make its purpose more obvious.
>
> Signed-off-by: Alex Elder <elder@inktank.com>
> ---
> v2: rebased to reflect changes in earlier patches
>
>   drivers/block/rbd.c |    3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index fdbcf04..b4c5e47 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -2529,6 +2529,7 @@ static void rbd_img_obj_exists_callback(struct
> rbd_obj_request *obj_request)
>   	 */
>   	orig_request = obj_request->obj_request;
>   	obj_request->obj_request = NULL;
> +	rbd_obj_request_put(orig_request);
>   	rbd_assert(orig_request);
>   	rbd_assert(orig_request->img_request);
>
> @@ -2549,7 +2550,6 @@ static void rbd_img_obj_exists_callback(struct
> rbd_obj_request *obj_request)
>   	if (!rbd_dev->parent_overlap) {
>   		struct ceph_osd_client *osdc;
>
> -		rbd_obj_request_put(orig_request);
>   		osdc = &rbd_dev->rbd_client->client->osdc;
>   		result = rbd_obj_request_submit(osdc, orig_request);
>   		if (!result)
> @@ -2579,7 +2579,6 @@ static void rbd_img_obj_exists_callback(struct
> rbd_obj_request *obj_request)
>   out:
>   	if (orig_request->result)
>   		rbd_obj_request_complete(orig_request);
> -	rbd_obj_request_put(orig_request);
>   }
>
>   static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request)
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-05-17  1:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-14  1:39 [PATCH] rbd: drop original request earlier for existence check Alex Elder
2013-05-14  1:41 ` Alex Elder
2013-05-16 21:29 ` [PATCH, v2] " Alex Elder
2013-05-17  1:42   ` Josh Durgin

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.