@@ -541,6 +541,8 @@ int Create(struct supertype *st, struct mddev_ident *ident, int subdevs,
pr_err("At least 2 nodes are needed for cluster-md\n");
return 1;
}
+ } else if (s->btype == BitmapLockless) {
+ major_num = BITMAP_MAJOR_LOCKLESS;
}
memset(&info, 0, sizeof(info));
@@ -1195,7 +1197,8 @@ int Create(struct supertype *st, struct mddev_ident *ident, int subdevs,
* to stop another mdadm from finding and using those devices.
*/
- if (s->btype == BitmapInternal || s->btype == BitmapCluster) {
+ if (s->btype == BitmapInternal || s->btype == BitmapCluster ||
+ s->btype == BitmapLockless) {
if (!st->ss->add_internal_bitmap) {
pr_err("internal bitmaps not supported with %s metadata\n",
st->ss->name);
@@ -383,7 +383,8 @@ int Grow_addbitmap(char *devname, int fd, struct context *c, struct shape *s)
free(mdi);
}
- if (s->btype == BitmapInternal || s->btype == BitmapCluster) {
+ if (s->btype == BitmapInternal || s->btype == BitmapCluster ||
+ s->btype == BitmapLockless) {
int rv;
int d;
int offset_setable = 0;
@@ -13,6 +13,7 @@
#define BITMAP_MAJOR_HI 4
#define BITMAP_MAJOR_HOSTENDIAN 3
#define BITMAP_MAJOR_CLUSTERED 5
+#define BITMAP_MAJOR_LOCKLESS 6
#define BITMAP_MINOR 39
@@ -56,6 +56,12 @@ static mdadm_status_t set_bitmap_value(struct shape *s, struct context *c, char
return MDADM_STATUS_SUCCESS;
}
+ if (strcmp(val, "lockless") == 0) {
+ s->btype = BitmapLockless;
+ pr_info("Experimental lockless bitmap, use at your own disk!\n");
+ return MDADM_STATUS_SUCCESS;
+ }
+
if (strcmp(val, "clustered") == 0) {
s->btype = BitmapCluster;
/* Set the default number of cluster nodes
@@ -1251,7 +1257,8 @@ int main(int argc, char *argv[])
pr_err("--bitmap is required for consistency policy: %s\n",
map_num_s(consistency_policies, s.consistency_policy));
exit(2);
- } else if ((s.btype == BitmapInternal || s.btype == BitmapCluster) &&
+ } else if ((s.btype == BitmapInternal || s.btype == BitmapCluster ||
+ s.btype == BitmapLockless) &&
s.consistency_policy != CONSISTENCY_POLICY_BITMAP &&
s.consistency_policy != CONSISTENCY_POLICY_JOURNAL) {
pr_err("--bitmap is not compatible with consistency policy: %s\n",
@@ -607,6 +607,7 @@ enum bitmap_type {
BitmapNone,
BitmapInternal,
BitmapCluster,
+ BitmapLockless,
BitmapUnknown,
};