From patchwork Tue Nov 2 09:02:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 296872 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA2930av015452 for ; Tue, 2 Nov 2010 09:03:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752449Ab0KBJC7 (ORCPT ); Tue, 2 Nov 2010 05:02:59 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:50766 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752428Ab0KBJC7 (ORCPT ); Tue, 2 Nov 2010 05:02:59 -0400 Received: by wyf28 with SMTP id 28so6423477wyf.19 for ; Tue, 02 Nov 2010 02:02:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=nICFuDS+ZrioQqMGhUEfI+2dvZgZrhiNv9lrIdsGPz0=; b=nBXJPkIsONMmUIBH4dEIsWXjAxKqwMLUTqc1M8HxrlnH49jHbMtVQGvKVd5UzsLI+V Z3aOLMZkl6Ip7GJvTVHP2UofT/SeUfGQ0qAoxweoPX417LNFZDHiuxDVWrF8Gz//+Ovq gOAIdcrpPJc1SZ4cXhBjSFnG2jF3J5q6dkcWo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=JaOLo/6xhq++t58AI5qyse7kviMldXr+YTJ4kWw5P/GOssQnWd+TeeGn9UkIN2YEtV WHWUVsPf0nKc5RcvlX9/K25MRQBSbOdxE+NGIeMr0WakMrwERuSA2oCiV/HPUQkKUqu3 o785vhYY/r/tH9LFT0qkv963C2KuQNZfWz238= MIME-Version: 1.0 Received: by 10.216.240.75 with SMTP id d53mr191068wer.4.1288688577741; Tue, 02 Nov 2010 02:02:57 -0700 (PDT) Received: by 10.216.70.136 with HTTP; Tue, 2 Nov 2010 02:02:57 -0700 (PDT) Date: Tue, 2 Nov 2010 12:02:57 +0300 Message-ID: Subject: [PATCH 5/5] CIFS: Add strictcache mount option From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 02 Nov 2010 09:03:00 +0000 (UTC) diff --git a/fs/cifs/README b/fs/cifs/README index ee68d10..8fb6192 100644 --- a/fs/cifs/README +++ b/fs/cifs/README @@ -443,6 +443,11 @@ A partial list of the supported mount options follows: if oplock (caching token) is granted and held. Note that direct allows write operations larger than page size to be sent to the server. + strictcache Use for switching on strict cache mode. In this mode the + client read from the cache all the time it has Oplock Level II, + otherwise - read from the server. All written data are stored + in the cache, but if the client doesn't have Exclusive Oplock, + it writes the data to the server. acl Allow setfacl and getfacl to manage posix ACLs if server supports them. (default) noacl Do not allow setfacl and getfacl calls on this mount diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 9eb327d..609c5e2 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -84,6 +84,7 @@ struct smb_vol { bool no_xattr:1; /* set if xattr (EA) support should be disabled*/ bool server_ino:1; /* use inode numbers from server ie UniqueId */ bool direct_io:1; + bool strict_io:1; /* strict cache behavior */ bool remap:1; /* set to remap seven reserved chars in filenames */ bool posix_paths:1; /* unset to not ask for posix pathnames. */ bool no_linux_ext:1; @@ -1346,6 +1347,8 @@ cifs_parse_mount_options(char *options, const char *devname, vol->direct_io = 1; } else if (strnicmp(data, "forcedirectio", 13) == 0) { vol->direct_io = 1; + } else if (strnicmp(data, "strictcache", 11) == 0) { + vol->strict_io = 1; } else if (strnicmp(data, "noac", 4) == 0) { printk(KERN_WARNING "CIFS: Mount option noac not "