diff options
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r-- | drivers/block/rbd.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 7ecd9099ea89..a77157d87915 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -205,6 +205,7 @@ struct rbd_obj_request { | |||
205 | enum img_req_flags { | 205 | enum img_req_flags { |
206 | IMG_REQ_WRITE, /* I/O direction: read = 0, write = 1 */ | 206 | IMG_REQ_WRITE, /* I/O direction: read = 0, write = 1 */ |
207 | IMG_REQ_CHILD, /* initiator: block = 0, child image = 1 */ | 207 | IMG_REQ_CHILD, /* initiator: block = 0, child image = 1 */ |
208 | IMG_REQ_LAYERED, /* ENOENT handling: normal = 0, layered = 1 */ | ||
208 | }; | 209 | }; |
209 | 210 | ||
210 | struct rbd_img_request { | 211 | struct rbd_img_request { |
@@ -1247,6 +1248,18 @@ static bool img_request_child_test(struct rbd_img_request *img_request) | |||
1247 | return test_bit(IMG_REQ_CHILD, &img_request->flags) != 0; | 1248 | return test_bit(IMG_REQ_CHILD, &img_request->flags) != 0; |
1248 | } | 1249 | } |
1249 | 1250 | ||
1251 | static void img_request_layered_set(struct rbd_img_request *img_request) | ||
1252 | { | ||
1253 | set_bit(IMG_REQ_LAYERED, &img_request->flags); | ||
1254 | smp_mb(); | ||
1255 | } | ||
1256 | |||
1257 | static bool img_request_layered_test(struct rbd_img_request *img_request) | ||
1258 | { | ||
1259 | smp_mb(); | ||
1260 | return test_bit(IMG_REQ_LAYERED, &img_request->flags) != 0; | ||
1261 | } | ||
1262 | |||
1250 | static void | 1263 | static void |
1251 | rbd_img_obj_request_read_callback(struct rbd_obj_request *obj_request) | 1264 | rbd_img_obj_request_read_callback(struct rbd_obj_request *obj_request) |
1252 | { | 1265 | { |
@@ -1549,6 +1562,8 @@ static struct rbd_img_request *rbd_img_request_create( | |||
1549 | } | 1562 | } |
1550 | if (child_request) | 1563 | if (child_request) |
1551 | img_request_child_set(img_request); | 1564 | img_request_child_set(img_request); |
1565 | if (rbd_dev->parent_spec) | ||
1566 | img_request_layered_set(img_request); | ||
1552 | spin_lock_init(&img_request->completion_lock); | 1567 | spin_lock_init(&img_request->completion_lock); |
1553 | img_request->next_completion = 0; | 1568 | img_request->next_completion = 0; |
1554 | img_request->callback = NULL; | 1569 | img_request->callback = NULL; |
@@ -1557,6 +1572,7 @@ static struct rbd_img_request *rbd_img_request_create( | |||
1557 | INIT_LIST_HEAD(&img_request->obj_requests); | 1572 | INIT_LIST_HEAD(&img_request->obj_requests); |
1558 | kref_init(&img_request->kref); | 1573 | kref_init(&img_request->kref); |
1559 | 1574 | ||
1575 | (void) img_request_layered_test(img_request); /* Avoid a warning */ | ||
1560 | rbd_img_request_get(img_request); /* Avoid a warning */ | 1576 | rbd_img_request_get(img_request); /* Avoid a warning */ |
1561 | rbd_img_request_put(img_request); /* TEMPORARY */ | 1577 | rbd_img_request_put(img_request); /* TEMPORARY */ |
1562 | 1578 | ||