aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2008-10-23 00:42:37 -0400
committerSteve French <sfrench@us.ibm.com>2008-10-23 00:42:37 -0400
commit84210e9120a8c01a14379ba1f9a9b0f963641d94 (patch)
treeed20b210bb554f283d8458ee6d146a5c4439e37f /fs/cifs/connect.c
parenta364bc0b37f14ffd66c1f982af42990a9d77fa43 (diff)
[CIFS] improve setlease handling
fcntl(F_SETLEASE) currently is not exported by cifs (nor by local file systems) so cifs grants leases based on how other local processes have opened the file not by whether the file is cacheable (oplocked). This adds the check to make sure that the file is cacheable on the client before checking whether we can grant the lease locally (generic_setlease). It also adds a mount option for cifs (locallease) if the user wants to override this and try to grant leases even if the server did not grant oplock. Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 1126f7ab4606..f51b79a67e1b 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -90,7 +90,8 @@ struct smb_vol {
90 bool nocase:1; /* request case insensitive filenames */ 90 bool nocase:1; /* request case insensitive filenames */
91 bool nobrl:1; /* disable sending byte range locks to srv */ 91 bool nobrl:1; /* disable sending byte range locks to srv */
92 bool seal:1; /* request transport encryption on share */ 92 bool seal:1; /* request transport encryption on share */
93 bool nodfs:1; 93 bool nodfs:1; /* Do not request DFS, even if available */
94 bool local_lease:1; /* check leases only on local system, not remote */
94 unsigned int rsize; 95 unsigned int rsize;
95 unsigned int wsize; 96 unsigned int wsize;
96 unsigned int sockopt; 97 unsigned int sockopt;
@@ -1264,6 +1265,10 @@ cifs_parse_mount_options(char *options, const char *devname,
1264 vol->no_psx_acl = 0; 1265 vol->no_psx_acl = 0;
1265 } else if (strnicmp(data, "noacl", 5) == 0) { 1266 } else if (strnicmp(data, "noacl", 5) == 0) {
1266 vol->no_psx_acl = 1; 1267 vol->no_psx_acl = 1;
1268#ifdef CONFIG_CIFS_EXPERIMENTAL
1269 } else if (strnicmp(data, "locallease", 6) == 0) {
1270 vol->local_lease = 1;
1271#endif
1267 } else if (strnicmp(data, "sign", 4) == 0) { 1272 } else if (strnicmp(data, "sign", 4) == 0) {
1268 vol->secFlg |= CIFSSEC_MUST_SIGN; 1273 vol->secFlg |= CIFSSEC_MUST_SIGN;
1269 } else if (strnicmp(data, "seal", 4) == 0) { 1274 } else if (strnicmp(data, "seal", 4) == 0) {
@@ -2162,6 +2167,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
2162 for the retry flag is used */ 2167 for the retry flag is used */
2163 tcon->retry = volume_info.retry; 2168 tcon->retry = volume_info.retry;
2164 tcon->nocase = volume_info.nocase; 2169 tcon->nocase = volume_info.nocase;
2170 tcon->local_lease = volume_info.local_lease;
2165 if (tcon->seal != volume_info.seal) 2171 if (tcon->seal != volume_info.seal)
2166 cERROR(1, ("transport encryption setting " 2172 cERROR(1, ("transport encryption setting "
2167 "conflicts with existing tid")); 2173 "conflicts with existing tid"));