summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2018-02-01 11:50:47 +0100
committerIlya Dryomov <idryomov@gmail.com>2018-04-02 10:12:42 +0200
commit0be2d60ed888a25016a05148e52feea4bf401b0e (patch)
tree2a3eaf09f4f92bd642d1106cfa9276f76f24d861 /drivers/block
parentrbd: remove old request completion code (diff)
downloadlinux-0be2d60ed888a25016a05148e52feea4bf401b0e.tar.xz
linux-0be2d60ed888a25016a05148e52feea4bf401b0e.zip
rbd: remove obj_req->flags field
There are no standalone (!IMG_DATA) object requests anymore. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 959aa95cd626..7ec4d143f534 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -222,10 +222,6 @@ enum obj_operation_type {
OBJ_OP_DISCARD,
};
-enum obj_req_flags {
- OBJ_REQ_IMG_DATA, /* object usage: standalone = 0, image = 1 */
-};
-
/*
* Writes go through the following state machine to deal with
* layering:
@@ -252,16 +248,11 @@ struct rbd_obj_request {
u64 object_no;
u64 offset; /* object start byte */
u64 length; /* bytes from offset */
- unsigned long flags;
union {
bool tried_parent; /* for reads */
enum rbd_obj_write_state write_state; /* for writes */
};
- /*
- * An object request associated with an image will have its
- * img_data flag set; a standalone object request will not.
- */
struct rbd_img_request *img_request;
u64 img_offset;
/* links for img_request->obj_requests list */
@@ -1291,28 +1282,6 @@ static void rbd_obj_zero_range(struct rbd_obj_request *obj_req, u32 off,
}
}
-/*
- * The default/initial value for all object request flags is 0. For
- * each flag, once its value is set to 1 it is never reset to 0
- * again.
- */
-static void obj_request_img_data_set(struct rbd_obj_request *obj_request)
-{
- if (test_and_set_bit(OBJ_REQ_IMG_DATA, &obj_request->flags)) {
- struct rbd_device *rbd_dev;
-
- rbd_dev = obj_request->img_request->rbd_dev;
- rbd_warn(rbd_dev, "obj_request %p already marked img_data",
- obj_request);
- }
-}
-
-static bool obj_request_img_data_test(struct rbd_obj_request *obj_request)
-{
- smp_mb();
- return test_bit(OBJ_REQ_IMG_DATA, &obj_request->flags) != 0;
-}
-
static bool obj_request_overlaps_parent(struct rbd_obj_request *obj_request)
{
struct rbd_device *rbd_dev = obj_request->img_request->rbd_dev;
@@ -1365,8 +1334,6 @@ static inline void rbd_img_obj_request_add(struct rbd_img_request *img_request,
/* Image request now owns object's original reference */
obj_request->img_request = img_request;
- rbd_assert(!obj_request_img_data_test(obj_request));
- obj_request_img_data_set(obj_request);
img_request->obj_request_count++;
img_request->pending_count++;
list_add_tail(&obj_request->links, &img_request->obj_requests);
@@ -1380,7 +1347,6 @@ static inline void rbd_img_obj_request_del(struct rbd_img_request *img_request,
list_del(&obj_request->links);
rbd_assert(img_request->obj_request_count > 0);
img_request->obj_request_count--;
- rbd_assert(obj_request_img_data_test(obj_request));
rbd_assert(obj_request->img_request == img_request);
obj_request->img_request = NULL;
rbd_obj_request_put(obj_request);
@@ -1506,7 +1472,6 @@ static void rbd_osd_req_format_read(struct rbd_obj_request *obj_request)
{
struct ceph_osd_request *osd_req = obj_request->osd_req;
- rbd_assert(obj_request_img_data_test(obj_request));
osd_req->r_flags = CEPH_OSD_FLAG_READ;
osd_req->r_snapid = obj_request->img_request->snap_id;
}