aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/cifs/cifs_debug.c6
-rw-r--r--fs/cifs/cifsfs.c6
-rw-r--r--fs/cifs/cifsglob.h3
-rw-r--r--fs/cifs/dir.c2
-rw-r--r--fs/cifs/file.c4
5 files changed, 13 insertions, 8 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
512static int cifs_oplock_proc_show(struct seq_file *m, void *v) 512static 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}
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index aa8fe7cee0b4..5c2972106816 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -53,7 +53,7 @@
53int cifsFYI = 0; 53int cifsFYI = 0;
54int cifsERROR = 1; 54int cifsERROR = 1;
55int traceSMB = 0; 55int traceSMB = 0;
56unsigned int oplockEnabled = 1; 56bool enable_oplocks = true;
57unsigned int linuxExtEnabled = 1; 57unsigned int linuxExtEnabled = 1;
58unsigned int lookupCacheEnabled = 1; 58unsigned int lookupCacheEnabled = 1;
59unsigned int multiuser_mount = 0; 59unsigned int multiuser_mount = 0;
@@ -82,6 +82,10 @@ module_param(echo_retries, ushort, 0644);
82MODULE_PARM_DESC(echo_retries, "Number of echo attempts before giving up and " 82MODULE_PARM_DESC(echo_retries, "Number of echo attempts before giving up and "
83 "reconnecting server. Default: 5. 0 means " 83 "reconnecting server. Default: 5. 0 means "
84 "never reconnect."); 84 "never reconnect.");
85module_param(enable_oplocks, bool, 0644);
86MODULE_PARM_DESC(enable_oplocks, "Enable or disable oplocks (bool). Default:"
87 "y/Y/1");
88
85extern mempool_t *cifs_sm_req_poolp; 89extern mempool_t *cifs_sm_req_poolp;
86extern mempool_t *cifs_req_poolp; 90extern mempool_t *cifs_req_poolp;
87extern mempool_t *cifs_mid_poolp; 91extern mempool_t *cifs_mid_poolp;
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 95dad9d14cf1..d734dee9d495 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -964,7 +964,8 @@ GLOBAL_EXTERN unsigned int multiuser_mount; /* if enabled allows new sessions
964 to be established on existing mount if we 964 to be established on existing mount if we
965 have the uid/password or Kerberos credential 965 have the uid/password or Kerberos credential
966 or equivalent for current user */ 966 or equivalent for current user */
967GLOBAL_EXTERN unsigned int oplockEnabled; 967/* enable or disable oplocks */
968GLOBAL_EXTERN bool enable_oplocks;
968GLOBAL_EXTERN unsigned int lookupCacheEnabled; 969GLOBAL_EXTERN unsigned int lookupCacheEnabled;
969GLOBAL_EXTERN unsigned int global_secflags; /* if on, session setup sent 970GLOBAL_EXTERN unsigned int global_secflags; /* if on, session setup sent
970 with more secure ntlmssp2 challenge/resp */ 971 with more secure ntlmssp2 challenge/resp */
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 72d448bf96ce..4dd5333753fa 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -171,7 +171,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
171 } 171 }
172 tcon = tlink_tcon(tlink); 172 tcon = tlink_tcon(tlink);
173 173
174 if (oplockEnabled) 174 if (enable_oplocks)
175 oplock = REQ_OPLOCK; 175 oplock = REQ_OPLOCK;
176 176
177 if (nd) 177 if (nd)
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index fd57165f55fa..8e184150cfb5 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -371,7 +371,7 @@ int cifs_open(struct inode *inode, struct file *file)
371 cFYI(1, "inode = 0x%p file flags are 0x%x for %s", 371 cFYI(1, "inode = 0x%p file flags are 0x%x for %s",
372 inode, file->f_flags, full_path); 372 inode, file->f_flags, full_path);
373 373
374 if (oplockEnabled) 374 if (enable_oplocks)
375 oplock = REQ_OPLOCK; 375 oplock = REQ_OPLOCK;
376 else 376 else
377 oplock = 0; 377 oplock = 0;
@@ -495,7 +495,7 @@ static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush)
495 cFYI(1, "inode = 0x%p file flags 0x%x for %s", 495 cFYI(1, "inode = 0x%p file flags 0x%x for %s",
496 inode, pCifsFile->f_flags, full_path); 496 inode, pCifsFile->f_flags, full_path);
497 497
498 if (oplockEnabled) 498 if (enable_oplocks)
499 oplock = REQ_OPLOCK; 499 oplock = REQ_OPLOCK;
500 else 500 else
501 oplock = 0; 501 oplock = 0;