diff options
author | Pavel Shilovsky <piastryyy@gmail.com> | 2011-01-24 14:16:35 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-01-25 14:31:38 -0500 |
commit | d39454ffe4a3c85428483b8a8a8e5e797b6363d5 (patch) | |
tree | 60d9762510ed6e1da338d5777827e18917e799bf /fs/cifs | |
parent | 72432ffcf555decbbae47f1be338e1d2f210aa69 (diff) |
CIFS: Add strictcache mount option
Use for switching on strict cache mode. In this mode the
client reads from the cache all the time it has Oplock Level II,
otherwise - read from the server. As for write - the client stores
a data in the cache in Exclusive Oplock case, otherwise - write
directly to the server.
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/README | 5 | ||||
-rw-r--r-- | fs/cifs/connect.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/fs/cifs/README b/fs/cifs/README index 46af99ab3614..fe1683590828 100644 --- a/fs/cifs/README +++ b/fs/cifs/README | |||
@@ -452,6 +452,11 @@ A partial list of the supported mount options follows: | |||
452 | if oplock (caching token) is granted and held. Note that | 452 | if oplock (caching token) is granted and held. Note that |
453 | direct allows write operations larger than page size | 453 | direct allows write operations larger than page size |
454 | to be sent to the server. | 454 | to be sent to the server. |
455 | strictcache Use for switching on strict cache mode. In this mode the | ||
456 | client read from the cache all the time it has Oplock Level II, | ||
457 | otherwise - read from the server. All written data are stored | ||
458 | in the cache, but if the client doesn't have Exclusive Oplock, | ||
459 | it writes the data to the server. | ||
455 | acl Allow setfacl and getfacl to manage posix ACLs if server | 460 | acl Allow setfacl and getfacl to manage posix ACLs if server |
456 | supports them. (default) | 461 | supports them. (default) |
457 | noacl Do not allow setfacl and getfacl calls on this mount | 462 | noacl Do not allow setfacl and getfacl calls on this mount |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 0cc3b81c2e84..47034af67b09 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -87,6 +87,7 @@ struct smb_vol { | |||
87 | bool no_xattr:1; /* set if xattr (EA) support should be disabled*/ | 87 | bool no_xattr:1; /* set if xattr (EA) support should be disabled*/ |
88 | bool server_ino:1; /* use inode numbers from server ie UniqueId */ | 88 | bool server_ino:1; /* use inode numbers from server ie UniqueId */ |
89 | bool direct_io:1; | 89 | bool direct_io:1; |
90 | bool strict_io:1; /* strict cache behavior */ | ||
90 | bool remap:1; /* set to remap seven reserved chars in filenames */ | 91 | bool remap:1; /* set to remap seven reserved chars in filenames */ |
91 | bool posix_paths:1; /* unset to not ask for posix pathnames. */ | 92 | bool posix_paths:1; /* unset to not ask for posix pathnames. */ |
92 | bool no_linux_ext:1; | 93 | bool no_linux_ext:1; |
@@ -1344,6 +1345,8 @@ cifs_parse_mount_options(char *options, const char *devname, | |||
1344 | vol->direct_io = 1; | 1345 | vol->direct_io = 1; |
1345 | } else if (strnicmp(data, "forcedirectio", 13) == 0) { | 1346 | } else if (strnicmp(data, "forcedirectio", 13) == 0) { |
1346 | vol->direct_io = 1; | 1347 | vol->direct_io = 1; |
1348 | } else if (strnicmp(data, "strictcache", 11) == 0) { | ||
1349 | vol->strict_io = 1; | ||
1347 | } else if (strnicmp(data, "noac", 4) == 0) { | 1350 | } else if (strnicmp(data, "noac", 4) == 0) { |
1348 | printk(KERN_WARNING "CIFS: Mount option noac not " | 1351 | printk(KERN_WARNING "CIFS: Mount option noac not " |
1349 | "supported. Instead set " | 1352 | "supported. Instead set " |
@@ -2584,6 +2587,8 @@ static void setup_cifs_sb(struct smb_vol *pvolume_info, | |||
2584 | if (pvolume_info->multiuser) | 2587 | if (pvolume_info->multiuser) |
2585 | cifs_sb->mnt_cifs_flags |= (CIFS_MOUNT_MULTIUSER | | 2588 | cifs_sb->mnt_cifs_flags |= (CIFS_MOUNT_MULTIUSER | |
2586 | CIFS_MOUNT_NO_PERM); | 2589 | CIFS_MOUNT_NO_PERM); |
2590 | if (pvolume_info->strict_io) | ||
2591 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_STRICT_IO; | ||
2587 | if (pvolume_info->direct_io) { | 2592 | if (pvolume_info->direct_io) { |
2588 | cFYI(1, "mounting share using direct i/o"); | 2593 | cFYI(1, "mounting share using direct i/o"); |
2589 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; | 2594 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO; |