@@ -24,6 +24,9 @@ extern int rbd_obj_notify_scsi_event_sync(struct rbd_device *rbd_dev, u32 event,
extern int rbd_obj_notify_ack_sync(struct rbd_device *rbd_dev, u64 notify_id);
extern int rbd_attach_tcm_dev(struct rbd_device *rbd_dev, void *data);
extern int rbd_detach_tcm_dev(struct rbd_device *rbd_dev);
+extern int rbd_dev_lock(struct rbd_device *rbd_dev, char *name, u8 type,
+ char *cookie, char *tag, char *desc, u8 flags);
+extern int rbd_dev_unlock(struct rbd_device *rbd_dev, char *name, char *cookie);
#if defined(CONFIG_TCM_IBLOCK) || defined(CONFIG_TCM_IBLOCK_MODULE)
@@ -4134,11 +4134,11 @@ int rbd_attach_tcm_dev(struct rbd_device *rbd_dev, void *data)
* @type: lock type (RADOS_LOCK_EXCLUSIVE or RADOS_LOCK_SHARED)
* @cookie: user-defined identifier for this instance of the lock
* @tag: if RADOS_LOCK_SHARED, tag of the lock. NULL if non shared.
- * desc: user-defined lock description
+ * @desc: user-defined lock description
* @flags: lock flags
*/
-static int rbd_dev_lock(struct rbd_device *rbd_dev, char *name, u8 type,
- char *cookie, char *tag, char *desc, u8 flags)
+int rbd_dev_lock(struct rbd_device *rbd_dev, char *name, u8 type,
+ char *cookie, char *tag, char *desc, u8 flags)
{
int lock_op_buf_size;
int name_len = strlen(name);
@@ -4194,7 +4194,7 @@ static int rbd_dev_lock(struct rbd_device *rbd_dev, char *name, u8 type,
* @name: the name of the lock
* @cookie: user-defined identifier for this instance of the lock
*/
-static int rbd_dev_unlock(struct rbd_device *rbd_dev, char *name, char *cookie)
+int rbd_dev_unlock(struct rbd_device *rbd_dev, char *name, char *cookie)
{
int unlock_op_buf_size;
int name_len = strlen(name);
To be used for COMPARE AND WRITE device locking. Signed-off-by: David Disseldorp <ddiss@suse.de> --- drivers/block/rbd.h | 3 +++ drivers/block/rbd_main.c | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-)