From patchwork Mon Dec 13 15:00:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovsky X-Patchwork-Id: 406502 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 oBDF1Ocr017890 for ; Mon, 13 Dec 2010 15:01:33 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753969Ab0LMPBd (ORCPT ); Mon, 13 Dec 2010 10:01:33 -0500 Received: from mail-ey0-f171.google.com ([209.85.215.171]:33869 "EHLO mail-ey0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754533Ab0LMPBd (ORCPT ); Mon, 13 Dec 2010 10:01:33 -0500 Received: by mail-ey0-f171.google.com with SMTP id 5so4190550eyg.2 for ; Mon, 13 Dec 2010 07:01:32 -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=riX8H+7dCLgNcmvjMQmwDAazQz8MupetqiYD9I/0Ufg=; b=TPRsdfW/W7sWI1I2v2DhXT04dHV1Uc6cOJSXPVeg5bVQ066bXgh3VhFus3LZGysB7W ujKIhz7hXC/JJ2a+JRZZHDOpO0lPhkupLFnV2EU4wpenjCmJm21130x7heTSZKz3LVxS woz3Eq9SGzUAJy24mDyGpwvp4Ov2BEy8zrSt8= 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=NOnPO+CXAPRQ81xzu1R9Y/8L9obNDGvvR4AOPKW9JB7lZW56kHP/al/nzmjKs3giTm CFnlHjY7Ks/k/06+YJx3Ew7iZxQw4DQXvI9zFoXloyTC0uy9x4kPuClknypvYXlnxZJ9 BmTFCT6RZAK7ES3/uLELnbmOdcCX4dsnUfdzs= Received: by 10.213.8.138 with SMTP id h10mr4057013ebh.76.1292252492448; Mon, 13 Dec 2010 07:01:32 -0800 (PST) Received: from localhost.localdomain (PPPoE-78-29-112-8.san.ru [78.29.112.8]) by mx.google.com with ESMTPS id w20sm148969eeh.0.2010.12.13.07.01.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 13 Dec 2010 07:01:31 -0800 (PST) From: Pavel Shilovsky To: linux-cifs@vger.kernel.org Subject: [PATCH 7/7] CIFS: Add strictcache mount option Date: Mon, 13 Dec 2010 18:00:55 +0300 Message-Id: <1292252455-4025-7-git-send-email-piastryyy@gmail.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1292252455-4025-1-git-send-email-piastryyy@gmail.com> References: <1292252455-4025-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]); Mon, 13 Dec 2010 15:01:33 +0000 (UTC) diff --git a/fs/cifs/README b/fs/cifs/README index 46af99a..fe16835 100644 --- a/fs/cifs/README +++ b/fs/cifs/README @@ -452,6 +452,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 cc1a860..877cb9e 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; @@ -1357,6 +1358,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 " @@ -2614,6 +2617,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;