This source file includes following definitions.
- security_show
1
2
3 #include <linux/init.h>
4 #include <linux/module.h>
5 #include <linux/moduleparam.h>
6 #include <linux/nd.h>
7 #include "pmem.h"
8 #include "pfn.h"
9 #include "nd.h"
10 #include "nd-core.h"
11
12 ssize_t security_show(struct device *dev,
13 struct device_attribute *attr, char *buf)
14 {
15 struct nvdimm *nvdimm = to_nvdimm(dev);
16
17
18
19
20
21 nvdimm->sec.flags = nvdimm_security_flags(nvdimm, NVDIMM_USER);
22
23 if (test_bit(NVDIMM_SECURITY_DISABLED, &nvdimm->sec.flags))
24 return sprintf(buf, "disabled\n");
25 if (test_bit(NVDIMM_SECURITY_UNLOCKED, &nvdimm->sec.flags))
26 return sprintf(buf, "unlocked\n");
27 if (test_bit(NVDIMM_SECURITY_LOCKED, &nvdimm->sec.flags))
28 return sprintf(buf, "locked\n");
29 return -ENOTTY;
30 }