summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Drokin <green@linuxhacker.ru>2015-05-21 15:32:01 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-31 10:50:19 +0900
commit3dd4598271fc119a4e3c5589be03f88a41c31e64 (patch)
tree00c1b81a06dc135094c456e22ccbc12a55b93d1b
parent87d32094efc208f31e4e3b226d25e58058352208 (diff)
downloadop-kernel-dev-3dd4598271fc119a4e3c5589be03f88a41c31e64.zip
op-kernel-dev-3dd4598271fc119a4e3c5589be03f88a41c31e64.tar.gz
staging/lustre/ldlm: move namespaces/lock_unused_count to sysfs
Move ldlm display of lock_unused_count from procfs to sysfs Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lustre/ldlm/ldlm_resource.c14
-rw-r--r--drivers/staging/lustre/sysfs-fs-lustre7
2 files changed, 19 insertions, 2 deletions
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index 667f2ca..fba09e4 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -179,6 +179,17 @@ static ssize_t lock_count_show(struct kobject *kobj, struct attribute *attr,
}
LUSTRE_RO_ATTR(lock_count);
+static ssize_t lock_unused_count_show(struct kobject *kobj,
+ struct attribute *attr,
+ char *buf)
+{
+ struct ldlm_namespace *ns = container_of(kobj, struct ldlm_namespace,
+ ns_kobj);
+
+ return sprintf(buf, "%d\n", ns->ns_nr_unused);
+}
+LUSTRE_RO_ATTR(lock_unused_count);
+
static ssize_t lru_size_show(struct kobject *kobj, struct attribute *attr,
char *buf)
{
@@ -312,6 +323,7 @@ LUSTRE_RW_ATTR(early_lock_cancel);
static struct attribute *ldlm_ns_attrs[] = {
&lustre_attr_resource_count.attr,
&lustre_attr_lock_count.attr,
+ &lustre_attr_lock_unused_count.attr,
&lustre_attr_lru_size.attr,
&lustre_attr_early_lock_cancel.attr,
NULL,
@@ -402,8 +414,6 @@ int ldlm_namespace_proc_register(struct ldlm_namespace *ns)
lock_vars[0].name = lock_name;
if (ns_is_client(ns)) {
- LDLM_NS_ADD_VAR("lock_unused_count", &ns->ns_nr_unused,
- &ldlm_uint_fops);
LDLM_NS_ADD_VAR("lru_max_age", &ns->ns_max_age,
&ldlm_rw_uint_fops);
} else {
diff --git a/drivers/staging/lustre/sysfs-fs-lustre b/drivers/staging/lustre/sysfs-fs-lustre
index e54e485..f92f7cf 100644
--- a/drivers/staging/lustre/sysfs-fs-lustre
+++ b/drivers/staging/lustre/sysfs-fs-lustre
@@ -223,6 +223,13 @@ Description:
0 - LRU size is unlimited, controlled by server resources
positive number - number of locks to allow in lock LRU list
+What: /sys/fs/lustre/ldlm/namespaces/<name>/lock_unused_count
+Date: May 2015
+Contact: "Oleg Drokin" <oleg.drokin@intel.com>
+Description:
+ Display number of locks currently sitting in the LRU list
+ of this namespace
+
What: /sys/fs/lustre/ldlm/namespaces/<name>/early_lock_cancel
Date: May 2015
Contact: "Oleg Drokin" <oleg.drokin@intel.com>
OpenPOWER on IntegriCloud