From 558b3ab40f429409f8b22ea6929db6fc2425b9b9 Mon Sep 17 00:00:00 2001
From: Mike Christie <michaelc@cs.wisc.edu>
Date: Wed, 29 Jul 2015 04:23:52 -0500
Subject: [PATCH] rbd: export some functions used by lio rbd backend
References: fate#318836
Patch-mainline: Not yet, SES2 clustered LIO/RBD
The lio rbd backend will make img_request rbd calls, so this
patch exports the functions it uses.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: David Disseldorp <ddiss@suse.de>
---
drivers/block/rbd.c | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1474,7 +1474,8 @@ static void rbd_img_request_get(struct r
static bool img_request_child_test(struct rbd_img_request *img_request);
static void rbd_parent_request_destroy(struct kref *kref);
static void rbd_img_request_destroy(struct kref *kref);
-static void rbd_img_request_put(struct rbd_img_request *img_request)
+
+void rbd_img_request_put(struct rbd_img_request *img_request)
{
rbd_assert(img_request != NULL);
dout("%s: img %p (was %d)\n", __func__, img_request,
@@ -1484,6 +1485,7 @@ static void rbd_img_request_put(struct r
else
kref_put(&img_request->kref, rbd_img_request_destroy);
}
+EXPORT_SYMBOL(rbd_img_request_put);
static inline void rbd_img_obj_request_add(struct rbd_img_request *img_request,
struct rbd_obj_request *obj_request)
@@ -2157,11 +2159,10 @@ static bool rbd_dev_parent_get(struct rb
* that comprises the image request, and the Linux request pointer
* (if there is one).
*/
-static struct rbd_img_request *rbd_img_request_create(
- struct rbd_device *rbd_dev,
- u64 offset, u64 length,
- enum obj_operation_type op_type,
- struct ceph_snap_context *snapc)
+struct rbd_img_request *rbd_img_request_create(struct rbd_device *rbd_dev,
+ u64 offset, u64 length,
+ enum obj_operation_type op_type,
+ struct ceph_snap_context *snapc)
{
struct rbd_img_request *img_request;
@@ -2201,6 +2202,7 @@ static struct rbd_img_request *rbd_img_r
return img_request;
}
+EXPORT_SYMBOL(rbd_img_request_create);
static void rbd_img_request_destroy(struct kref *kref)
{
@@ -2451,9 +2453,8 @@ static void rbd_img_obj_request_fill(str
* function assumes data_desc describes memory sufficient to hold
* all data described by the image request.
*/
-static int rbd_img_request_fill(struct rbd_img_request *img_request,
- enum obj_request_type type,
- void *data_desc)
+int rbd_img_request_fill(struct rbd_img_request *img_request,
+ enum obj_request_type type, void *data_desc)
{
struct rbd_device *rbd_dev = img_request->rbd_dev;
struct rbd_obj_request *obj_request = NULL;
@@ -2557,6 +2558,7 @@ out_unwind:
return -ENOMEM;
}
+EXPORT_SYMBOL(rbd_img_request_fill);
int rbd_img_cmp_and_write_request_fill(struct rbd_img_request *img_request,
struct scatterlist *cmp_sgl,
@@ -2987,7 +2989,7 @@ static int rbd_img_obj_request_submit(st
return rbd_img_obj_exists_submit(obj_request);
}
-static int rbd_img_request_submit(struct rbd_img_request *img_request)
+int rbd_img_request_submit(struct rbd_img_request *img_request)
{
struct rbd_obj_request *obj_request;
struct rbd_obj_request *next_obj_request;
@@ -3006,6 +3008,7 @@ out_put_ireq:
rbd_img_request_put(img_request);
return ret;
}
+EXPORT_SYMBOL(rbd_img_request_submit);
static int setup_copyup_bvecs(struct rbd_obj_request *obj_req, u64 obj_overlap)
{