From patchwork Fri Nov 5 08:29:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 303932 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 oA58WlC8011372 for ; Fri, 5 Nov 2010 08:32:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752407Ab0KEIcx (ORCPT ); Fri, 5 Nov 2010 04:32:53 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:36692 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753401Ab0KEIcw (ORCPT ); Fri, 5 Nov 2010 04:32:52 -0400 Received: by mail-ey0-f174.google.com with SMTP id 27so1565120eye.19 for ; Fri, 05 Nov 2010 01:32:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :message-id:x-mailer:in-reply-to:references; bh=F/M3gFay6ksIDAtjgwn3YNf8R3lCkvF60CG1KHzE1l8=; b=ernjKD1fC+2QvwGyLs1nAtr9mvdYEfxamUVAg+4zPWrxDbkvJuRdJRyofvJXrfkrSI p7I9O5PT1qUAfaLw9XG71Q0C46WkgongLnH79/m3XAOwBnY+3H007fa43HroduiX9klV i7TtdwONvIMl+iJG7LicelMFqPtZlqUHGJrAQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:x-mailer:in-reply-to:references; b=OcmDyTgasrjn1L+msN6aUArS29sE/lUxcGtkHpw6QAAfCi92bF8P2NsykxCnETTQl1 U8ySWlS9SYYNSgFQQ61fgBeVdjtlQP1jItqIjiAeay0vADwlwilqjiGKWbvyj0xV4d0G kYIeaQ/NVKGKlApO5xedde4b1T2LCBjVw15fU= Received: by 10.213.112.204 with SMTP id x12mr1281253ebp.81.1288945971984; Fri, 05 Nov 2010 01:32:51 -0700 (PDT) Received: from localhost.localdomain ([95.84.33.166]) by mx.google.com with ESMTPS id q58sm801154eeh.15.2010.11.05.01.32.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 05 Nov 2010 01:32:51 -0700 (PDT) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH 6/6] CIFS: Add strictcache mount option Date: Fri, 5 Nov 2010 11:29:37 +0300 Message-Id: <1288945777-9197-7-git-send-email-piastryyy@gmail.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1288945777-9197-1-git-send-email-piastryyy@gmail.com> References: <1288945777-9197-1-git-send-email-piastryyy@gmail.com> 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]); Fri, 05 Nov 2010 08:32:53 +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 251a17c..97286c7 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; @@ -1347,6 +1348,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 " "supported. Instead set " @@ -2597,6 +2600,8 @@ static void setup_cifs_sb(struct smb_vol *pvolume_info, if (pvolume_info->multiuser) cifs_sb->mnt_cifs_flags |= (CIFS_MOUNT_MULTIUSER | CIFS_MOUNT_NO_PERM); + if (pvolume_info->strict_io) + cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_STRICT_IO; if (pvolume_info->direct_io) { cFYI(1, "mounting share using direct i/o"); cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO;