diff options
author | Oleg Drokin <green@linuxhacker.ru> | 2015-05-21 15:31:56 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-31 10:50:19 +0900 |
commit | 0f53c823f9664683ce1aadab2d6a4cee950d6f62 (patch) | |
tree | 55aa87f30a94823973df616e7b2447e6a373a320 | |
parent | 18fd8850a4c8177ecf4870ff38c208d329a21ed0 (diff) | |
download | blackbird-op-linux-0f53c823f9664683ce1aadab2d6a4cee950d6f62.tar.gz blackbird-op-linux-0f53c823f9664683ce1aadab2d6a4cee950d6f62.zip |
staging/lustre/ldlm: move cancel_unused_locks_before_replay to sysfs
/proc/fs/lustre/ldlm/cancel_unused_locks_before_replay is
moved to /sys/fs/lustre/ldlm/cancel_unused_locks_before_replay
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_lockd.c | 29 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 4 | ||||
-rw-r--r-- | drivers/staging/lustre/sysfs-fs-lustre | 10 |
3 files changed, 38 insertions, 5 deletions
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c index 46f1790d06a3..151d60d45baa 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c @@ -1006,8 +1006,35 @@ void ldlm_destroy_export(struct obd_export *exp) } EXPORT_SYMBOL(ldlm_destroy_export); +extern unsigned int ldlm_cancel_unused_locks_before_replay; + +static ssize_t cancel_unused_locks_before_replay_show(struct kobject *kobj, + struct attribute *attr, + char *buf) +{ + return sprintf(buf, "%d\n", ldlm_cancel_unused_locks_before_replay); +} +static ssize_t cancel_unused_locks_before_replay_store(struct kobject *kobj, + struct attribute *attr, + const char *buffer, + size_t count) +{ + int rc; + unsigned long val; + + rc = kstrtoul(buffer, 10, &val); + if (rc) + return rc; + + ldlm_cancel_unused_locks_before_replay = val; + + return count; +} +LUSTRE_RW_ATTR(cancel_unused_locks_before_replay); + /* These are for root of /sys/fs/lustre/ldlm */ -struct attribute *ldlm_attrs[] = { +static struct attribute *ldlm_attrs[] = { + &lustre_attr_cancel_unused_locks_before_replay.attr, NULL, }; diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c index 70d956734a87..ad3e0b3a5d0a 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c @@ -65,8 +65,6 @@ struct proc_dir_entry *ldlm_type_proc_dir = NULL; static struct proc_dir_entry *ldlm_ns_proc_dir = NULL; struct proc_dir_entry *ldlm_svc_proc_dir = NULL; -extern unsigned int ldlm_cancel_unused_locks_before_replay; - /* during debug dump certain amount of granted locks for one resource to avoid * DDOS. */ unsigned int ldlm_dump_granted_max = 256; @@ -91,8 +89,6 @@ int ldlm_proc_setup(void) { "dump_namespaces", &ldlm_dump_ns_fops, NULL, 0222 }, { "dump_granted_max", &ldlm_rw_uint_fops, &ldlm_dump_granted_max }, - { "cancel_unused_locks_before_replay", &ldlm_rw_uint_fops, - &ldlm_cancel_unused_locks_before_replay }, { NULL } }; LASSERT(ldlm_ns_proc_dir == NULL); diff --git a/drivers/staging/lustre/sysfs-fs-lustre b/drivers/staging/lustre/sysfs-fs-lustre index ec4ae4726cdc..efe3440ae1f1 100644 --- a/drivers/staging/lustre/sysfs-fs-lustre +++ b/drivers/staging/lustre/sysfs-fs-lustre @@ -190,3 +190,13 @@ Contact: "Oleg Drokin" <oleg.drokin@intel.com> Description: Controls extended attributes client-side cache. 1 to enable, 0 to disable. + +What: /sys/fs/lustre/ldlm/cancel_unused_locks_before_replay +Date: May 2015 +Contact: "Oleg Drokin" <oleg.drokin@intel.com> +Description: + Controls if client should replay unused locks during recovery + If a client tends to have a lot of unused locks in LRU, + recovery times might become prolonged. + 1 - just locally cancel unused locks (default) + 0 - replay unused locks. |