All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <elder@inktank.com>
To: ceph-devel@vger.kernel.org
Subject: [PATCH 06/11] rbd: define image request layered flag
Date: Thu, 11 Apr 2013 21:18:02 -0500	[thread overview]
Message-ID: <51676EDA.5070107@inktank.com> (raw)
In-Reply-To: <51676E0F.2010504@inktank.com>

Define a flag indicating whether an image request is for a layered
image (one with a parent image to which requests will be redirected
if the target object of a request does not exist).  The code that
checks this flag will be added shortly.

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

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 7ecd909..a77157d 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -205,6 +205,7 @@ struct rbd_obj_request {
 enum img_req_flags {
 	IMG_REQ_WRITE,		/* I/O direction: read = 0, write = 1 */
 	IMG_REQ_CHILD,		/* initiator: block = 0, child image = 1 */
+	IMG_REQ_LAYERED,	/* ENOENT handling: normal = 0, layered = 1 */
 };

 struct rbd_img_request {
@@ -1247,6 +1248,18 @@ static bool img_request_child_test(struct
rbd_img_request *img_request)
 	return test_bit(IMG_REQ_CHILD, &img_request->flags) != 0;
 }

+static void img_request_layered_set(struct rbd_img_request *img_request)
+{
+	set_bit(IMG_REQ_LAYERED, &img_request->flags);
+	smp_mb();
+}
+
+static bool img_request_layered_test(struct rbd_img_request *img_request)
+{
+	smp_mb();
+	return test_bit(IMG_REQ_LAYERED, &img_request->flags) != 0;
+}
+
 static void
 rbd_img_obj_request_read_callback(struct rbd_obj_request *obj_request)
 {
@@ -1549,6 +1562,8 @@ static struct rbd_img_request *rbd_img_request_create(
 	}
 	if (child_request)
 		img_request_child_set(img_request);
+	if (rbd_dev->parent_spec)
+		img_request_layered_set(img_request);
 	spin_lock_init(&img_request->completion_lock);
 	img_request->next_completion = 0;
 	img_request->callback = NULL;
@@ -1557,6 +1572,7 @@ static struct rbd_img_request *rbd_img_request_create(
 	INIT_LIST_HEAD(&img_request->obj_requests);
 	kref_init(&img_request->kref);

+	(void) img_request_layered_test(img_request);	/* Avoid a warning */
 	rbd_img_request_get(img_request);	/* Avoid a warning */
 	rbd_img_request_put(img_request);	/* TEMPORARY */

-- 
1.7.9.5


  parent reply	other threads:[~2013-04-12  2:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12  2:14 [PATCH 00/11] rbd: layered read functionality Alex Elder
2013-04-12  2:17 ` [PATCH 01/11] rbd: record overall image request result Alex Elder
2013-04-12  2:17 ` [PATCH 02/11] rbd: record aggregate image transfer count Alex Elder
2013-04-12  2:17 ` [PATCH 03/11] rbd: record image-relative offset in object requests Alex Elder
2013-04-12  2:17 ` [PATCH 04/11] rbd: define image request flags Alex Elder
2013-04-12  2:17 ` [PATCH 05/11] rbd: define image request originator flag Alex Elder
2013-04-12  2:18 ` Alex Elder [this message]
2013-04-12  2:18 ` [PATCH 07/11] rbd: encapsulate image object end request handling Alex Elder
2013-04-12  2:18 ` [PATCH 08/11] rbd: define an rbd object request flags field Alex Elder
2013-04-12  2:18 ` [PATCH 09/11] rbd: add an object request flag for image data objects Alex Elder
2013-04-12  2:18 ` [PATCH 10/11] rbd: probe the parent of an image if present Alex Elder
2013-04-12  2:19 ` [PATCH 11/11] rbd: implement layered reads Alex Elder
2013-04-14 17:22 ` [PATCH 00/11] rbd: layered read functionality 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=51676EDA.5070107@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.