Merge tag 'docs-4.15-2' of git://git.lwn.net/linux
[linux-2.6-microblaze.git] / drivers / nvdimm / dimm_devs.c
index f0d1b7e..097794d 100644 (file)
@@ -200,6 +200,13 @@ void nvdimm_set_locked(struct device *dev)
        set_bit(NDD_LOCKED, &nvdimm->flags);
 }
 
+void nvdimm_clear_locked(struct device *dev)
+{
+       struct nvdimm *nvdimm = to_nvdimm(dev);
+
+       clear_bit(NDD_LOCKED, &nvdimm->flags);
+}
+
 static void nvdimm_release(struct device *dev)
 {
        struct nvdimm *nvdimm = to_nvdimm(dev);
@@ -324,6 +331,17 @@ static ssize_t commands_show(struct device *dev,
 }
 static DEVICE_ATTR_RO(commands);
 
+static ssize_t flags_show(struct device *dev,
+               struct device_attribute *attr, char *buf)
+{
+       struct nvdimm *nvdimm = to_nvdimm(dev);
+
+       return sprintf(buf, "%s%s\n",
+                       test_bit(NDD_ALIASING, &nvdimm->flags) ? "alias " : "",
+                       test_bit(NDD_LOCKED, &nvdimm->flags) ? "lock " : "");
+}
+static DEVICE_ATTR_RO(flags);
+
 static ssize_t state_show(struct device *dev, struct device_attribute *attr,
                char *buf)
 {
@@ -365,6 +383,7 @@ static DEVICE_ATTR_RO(available_slots);
 
 static struct attribute *nvdimm_attributes[] = {
        &dev_attr_state.attr,
+       &dev_attr_flags.attr,
        &dev_attr_commands.attr,
        &dev_attr_available_slots.attr,
        NULL,