Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
LU-11085 nodemap: switch interval tree to in-kernel impl.
[fs/lustre-release.git]
/
lustre
/
ptlrpc
/
nodemap_lproc.c
diff --git
a/lustre/ptlrpc/nodemap_lproc.c
b/lustre/ptlrpc/nodemap_lproc.c
index
62a053f
..
2539522
100644
(file)
--- a/
lustre/ptlrpc/nodemap_lproc.c
+++ b/
lustre/ptlrpc/nodemap_lproc.c
@@
-118,7
+118,6
@@
static int nodemap_ranges_show(struct seq_file *m, void *data)
{
struct lu_nodemap *nodemap;
struct lu_nid_range *range;
- struct interval_node_extent ext;
char start_nidstr[LNET_NIDSTR_SIZE];
char end_nidstr[LNET_NIDSTR_SIZE];
bool cont = false;
@@
-140,9
+139,8
@@
static int nodemap_ranges_show(struct seq_file *m, void *data)
if (cont)
seq_printf(m, ",\n");
cont = 1;
- ext = range->rn_node.in_extent;
- libcfs_nid2str_r(ext.start, start_nidstr, sizeof(start_nidstr));
- libcfs_nid2str_r(ext.end, end_nidstr, sizeof(end_nidstr));
+ libcfs_nid2str_r(range->rn_start, start_nidstr, sizeof(start_nidstr));
+ libcfs_nid2str_r(range->rn_end, end_nidstr, sizeof(end_nidstr));
seq_printf(m, " { id: %u, start_nid: %s, end_nid: %s }",
range->rn_id, start_nidstr, end_nidstr);
}
@@
-637,6
+635,33
@@
static int nodemap_audit_mode_seq_show(struct seq_file *m, void *data)
return 0;
}
+/**
+ * Reads and prints the forbid_encryption flag for the given nodemap.
+ *
+ * \param m seq file in proc fs
+ * \param data unused
+ * \retval 0 success
+ */
+static int nodemap_forbid_encryption_seq_show(struct seq_file *m, void *data)
+{
+ struct lu_nodemap *nodemap;
+ int rc;
+
+ mutex_lock(&active_config_lock);
+ nodemap = nodemap_lookup(m->private);
+ mutex_unlock(&active_config_lock);
+ if (IS_ERR(nodemap)) {
+ rc = PTR_ERR(nodemap);
+ CERROR("cannot find nodemap '%s': rc = %d\n",
+ (char *)m->private, rc);
+ return rc;
+ }
+
+ seq_printf(m, "%d\n", (int)nodemap->nmf_forbid_encryption);
+ nodemap_putref(nodemap);
+ return 0;
+}
+
static struct lprocfs_vars lprocfs_nm_module_vars[] = {
{
.name = "active",
@@
-655,22
+680,23
@@
LPROC_SEQ_FOPS_RO(nodemap_squash_gid);
LPROC_SEQ_FOPS_RO(nodemap_deny_unknown);
LPROC_SEQ_FOPS_RO(nodemap_map_mode);
LPROC_SEQ_FOPS_RO(nodemap_audit_mode);
+LPROC_SEQ_FOPS_RO(nodemap_forbid_encryption);
-const struct file_operations nodemap_ranges_fops = {
+
static
const struct file_operations nodemap_ranges_fops = {
.open = nodemap_ranges_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release
};
-const struct file_operations nodemap_idmap_fops = {
+
static
const struct file_operations nodemap_idmap_fops = {
.open = nodemap_idmap_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release
};
-const struct file_operations nodemap_exports_fops = {
+
static
const struct file_operations nodemap_exports_fops = {
.open = nodemap_exports_open,
.read = seq_read,
.llseek = seq_lseek,
@@
-703,6
+729,10
@@
static struct lprocfs_vars lprocfs_nodemap_vars[] = {
.fops = &nodemap_audit_mode_fops,
},
{
+ .name = "forbid_encryption",
+ .fops = &nodemap_forbid_encryption_fops,
+ },
+ {
.name = "squash_uid",
.fops = &nodemap_squash_uid_fops,
},
@@
-773,6
+803,10
@@
static struct lprocfs_vars lprocfs_default_nodemap_vars[] = {
.fops = &nodemap_audit_mode_fops,
},
{
+ .name = "forbid_encryption",
+ .fops = &nodemap_forbid_encryption_fops,
+ },
+ {
NULL
}
};