diff options
author | Steve French <smfrench@gmail.com> | 2011-10-12 18:47:03 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2011-10-13 00:42:05 -0400 |
commit | e75047344ea415760b2508a6fa29c0288c7b6b68 (patch) | |
tree | 14abdd67059e4d6a33ce149a4474dbaafc75b9b7 /fs/cifs/cifs_debug.c | |
parent | ba749e6d5227de22e442c6088cc7dc1f0c5c68bf (diff) |
add new module parameter 'enable_oplocks'
Thus spake Jeff Layton:
"Making that a module parm would allow you to set that parameter at boot
time without needing to add special startup scripts. IMO, all of the
procfile "switches" under /proc/fs/cifs should be module parms
instead."
This patch doesn't alter the default behavior (Oplocks are enabled by
default).
To disable oplocks when loading the module, use
modprobe cifs enable_oplocks=0
(any of '0' or 'n' or 'N' conventions can be used).
To disable oplocks at runtime using the new interface, use
echo 0 > /sys/module/cifs/parameters/enable_oplocks
The older /proc/fs/cifs/OplockEnabled interface will be deprecated
after two releases. A subsequent patch will add an warning message
about this deprecation.
Changes since v2:
- make enable_oplocks a 'bool'
Changes since v1:
- eliminate the use of extra variable by renaming the old one to
enable_oplocks and make it an 'int' type.
Reported-by: Alexander Swen <alex@swen.nu>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/cifs_debug.c')
-rw-r--r-- | fs/cifs/cifs_debug.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 6d40656e1e29..e1715313f398 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c | |||
@@ -511,7 +511,7 @@ static const struct file_operations cifsFYI_proc_fops = { | |||
511 | 511 | ||
512 | static int cifs_oplock_proc_show(struct seq_file *m, void *v) | 512 | static int cifs_oplock_proc_show(struct seq_file *m, void *v) |
513 | { | 513 | { |
514 | seq_printf(m, "%d\n", oplockEnabled); | 514 | seq_printf(m, "%d\n", enable_oplocks); |
515 | return 0; | 515 | return 0; |
516 | } | 516 | } |
517 | 517 | ||
@@ -530,9 +530,9 @@ static ssize_t cifs_oplock_proc_write(struct file *file, | |||
530 | if (rc) | 530 | if (rc) |
531 | return rc; | 531 | return rc; |
532 | if (c == '0' || c == 'n' || c == 'N') | 532 | if (c == '0' || c == 'n' || c == 'N') |
533 | oplockEnabled = 0; | 533 | enable_oplocks = false; |
534 | else if (c == '1' || c == 'y' || c == 'Y') | 534 | else if (c == '1' || c == 'y' || c == 'Y') |
535 | oplockEnabled = 1; | 535 | enable_oplocks = true; |
536 | 536 | ||
537 | return count; | 537 | return count; |
538 | } | 538 | } |