Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed95b21a authored by Ilya Dryomov's avatar Ilya Dryomov
Browse files

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: default avatarIlya Dryomov <idryomov@gmail.com>
Reviewed-by: default avatarMike Christie <mchristi@redhat.com>
Tested-by: default avatarMike Christie <mchristi@redhat.com>
parent 99d16943
Loading
Loading
Loading
Loading
+796 −16

File changed.

Preview size limit exceeded, changes collapsed.

+11 −0
Original line number Original line Diff line number Diff line
@@ -28,6 +28,17 @@
#define RBD_DATA_PREFIX        "rbd_data."
#define RBD_DATA_PREFIX        "rbd_data."
#define RBD_ID_PREFIX          "rbd_id."
#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
 * For format version 1, rbd image 'foo' consists of objects
 *   foo.rbd		- image metadata
 *   foo.rbd		- image metadata
+1 −0
Original line number Original line Diff line number Diff line
@@ -15,6 +15,7 @@ const char *ceph_entity_type_name(int type)
	default: return "unknown";
	default: return "unknown";
	}
	}
}
}
EXPORT_SYMBOL(ceph_entity_type_name);


const char *ceph_osd_op_name(int op)
const char *ceph_osd_op_name(int op)
{
{