aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2009-02-23 10:21:59 -0500
committerSteve French <sfrench@us.ibm.com>2009-03-11 21:36:20 -0400
commitbe652445fdccb8e5d4391928c3b45324ea37f9e1 (patch)
tree9912b7022b06d3ad08ff73d71505f018fe96922b /fs/cifs/connect.c
parent10e70afa75c90702b2326abaaa757d6b7835636f (diff)
[CIFS] Add new nostrictsync cifs mount option to avoid slow SMB flush
If this mount option is set, when an application does an fsync call then the cifs client does not send an SMB Flush to the server (to force the server to write all dirty data for this file immediately to disk), although cifs still sends all dirty (cached) file data to the server and waits for the server to respond to the write write. Since SMB Flush can be very slow, and some servers may be reliable enough (to risk delaying slightly flushing the data to disk on the server), turning on this option may be useful to improve performance for applications that fsync too much, at a small risk of server crash. If this mount option is not set, by default cifs will send an SMB flush request (and wait for a response) on every fsync call. Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index da0f4ffa0613..18e84a4e0504 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -95,6 +95,7 @@ struct smb_vol {
95 bool local_lease:1; /* check leases only on local system, not remote */ 95 bool local_lease:1; /* check leases only on local system, not remote */
96 bool noblocksnd:1; 96 bool noblocksnd:1;
97 bool noautotune:1; 97 bool noautotune:1;
98 bool nostrictsync:1; /* do not force expensive SMBflush on every sync */
98 unsigned int rsize; 99 unsigned int rsize;
99 unsigned int wsize; 100 unsigned int wsize;
100 unsigned int sockopt; 101 unsigned int sockopt;
@@ -1274,6 +1275,10 @@ cifs_parse_mount_options(char *options, const char *devname,
1274 vol->intr = 0; 1275 vol->intr = 0;
1275 } else if (strnicmp(data, "intr", 4) == 0) { 1276 } else if (strnicmp(data, "intr", 4) == 0) {
1276 vol->intr = 1; 1277 vol->intr = 1;
1278 } else if (strnicmp(data, "nostrictsync", 12) == 0) {
1279 vol->nostrictsync = 1;
1280 } else if (strnicmp(data, "strictsync", 10) == 0) {
1281 vol->nostrictsync = 0;
1277 } else if (strnicmp(data, "serverino", 7) == 0) { 1282 } else if (strnicmp(data, "serverino", 7) == 0) {
1278 vol->server_ino = 1; 1283 vol->server_ino = 1;
1279 } else if (strnicmp(data, "noserverino", 9) == 0) { 1284 } else if (strnicmp(data, "noserverino", 9) == 0) {
@@ -2160,6 +2165,8 @@ static void setup_cifs_sb(struct smb_vol *pvolume_info,
2160 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_UNX_EMUL; 2165 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_UNX_EMUL;
2161 if (pvolume_info->nobrl) 2166 if (pvolume_info->nobrl)
2162 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_BRL; 2167 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_BRL;
2168 if (pvolume_info->nostrictsync)
2169 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_SSYNC;
2163 if (pvolume_info->mand_lock) 2170 if (pvolume_info->mand_lock)
2164 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NOPOSIXBRL; 2171 cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NOPOSIXBRL;
2165 if (pvolume_info->cifs_acl) 2172 if (pvolume_info->cifs_acl)