summaryrefslogtreecommitdiff
path: root/drivers/block/rbd_types.h
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2016-08-12 16:40:02 +0200
committerIlya Dryomov <idryomov@gmail.com>2016-08-24 23:49:16 +0200
commited95b21a4b0a71ef89306cdeb427d53cc9cb343f (patch)
tree3a8ff6e713df797980ffc5df4411625a0f4a0f36 /drivers/block/rbd_types.h
parent99d1694310df3ffef66902f5bc1a23e95a724aa3 (diff)
rbd: support for exclusive-lock feature
Add basic support for RBD_FEATURE_EXCLUSIVE_LOCK feature. Maintenance operations (resize, snapshot create, etc) are offloaded to librbd via returning -EOPNOTSUPP - librbd should request the lock and execute the operation. Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Reviewed-by: Mike Christie <mchristi@redhat.com> Tested-by: Mike Christie <mchristi@redhat.com>
Diffstat (limited to 'drivers/block/rbd_types.h')
-rw-r--r--drivers/block/rbd_types.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/block/rbd_types.h b/drivers/block/rbd_types.h
index 49d77cbcf8bd..94f367db27b0 100644
--- a/drivers/block/rbd_types.h
+++ b/drivers/block/rbd_types.h
@@ -28,6 +28,17 @@
#define RBD_DATA_PREFIX "rbd_data."
#define RBD_ID_PREFIX "rbd_id."
+#define RBD_LOCK_NAME "rbd_lock"
+#define RBD_LOCK_TAG "internal"
+#define RBD_LOCK_COOKIE_PREFIX "auto"
+
+enum rbd_notify_op {
+ RBD_NOTIFY_OP_ACQUIRED_LOCK = 0,
+ RBD_NOTIFY_OP_RELEASED_LOCK = 1,
+ RBD_NOTIFY_OP_REQUEST_LOCK = 2,
+ RBD_NOTIFY_OP_HEADER_UPDATE = 3,
+};
+
/*
* For format version 1, rbd image 'foo' consists of objects
* foo.rbd - image metadata