From patchwork Wed Nov 10 15:41:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 314562 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 oAAFgYqb031219 for ; Wed, 10 Nov 2010 15:42:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756722Ab0KJPmo (ORCPT ); Wed, 10 Nov 2010 10:42:44 -0500 Received: from mail-ew0-f46.google.com ([209.85.215.46]:34474 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756665Ab0KJPmn (ORCPT ); Wed, 10 Nov 2010 10:42:43 -0500 Received: by mail-ew0-f46.google.com with SMTP id 7so367214ewy.19 for ; Wed, 10 Nov 2010 07:42:43 -0800 (PST) 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=iJVeoXE0NviAsd3og6/UgJZFDMmNIEzROfd7p/QsucitgRLJpQJUNDxJ1eDVwsJfR2 Usdh3sF/AKHtdvf/f33SSrGgmlBpn5U5NOIlDgqz06s7FBOYa93HKRLeZMnQNikGNoPU T2GcAy+osqQhYq7ttxm5xvWoRQTYlrJO+fXvI= 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=jUKDmUz0dOxK9LQK7fAchvw7e/8puT+5hYMXe8+LHVqZcbo8LDbsHCuWpkYX/akHMF EcwZPr5hRuF9giIoo9WSVbr/q5B3r+T7CmojwIURN3boIOYnTve367xCDQopJW1KgxRu fNAwFg21RZNm+pYzl00cBp8felqu29mgkmII0= Received: by 10.213.29.133 with SMTP id q5mr634725ebc.66.1289403762297; Wed, 10 Nov 2010 07:42:42 -0800 (PST) Received: from localhost.localdomain ([79.126.90.150]) by mx.google.com with ESMTPS id w20sm815303eeh.0.2010.11.10.07.42.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 10 Nov 2010 07:42:40 -0800 (PST) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH 6/6] CIFS: Add strictcache mount option Date: Wed, 10 Nov 2010 18:41:51 +0300 Message-Id: <1289403711-12965-7-git-send-email-piastryyy@gmail.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1289403711-12965-1-git-send-email-piastryyy@gmail.com> References: <1289403711-12965-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]); Wed, 10 Nov 2010 15:42:44 +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;