}
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)
{
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,
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 {
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>