From patchwork Mon Oct 4 17:52:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 229211 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 o94HqJNG017232 for ; Mon, 4 Oct 2010 17:53:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755940Ab0JDRxF (ORCPT ); Mon, 4 Oct 2010 13:53:05 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:35925 "EHLO cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756228Ab0JDRxE (ORCPT ); Mon, 4 Oct 2010 13:53:04 -0400 X-Authority-Analysis: v=1.1 cv=R3xZCyK5Rzzq4RgmEA8QIQ3hFZTdsD3z+kRPUs1QTwQ= c=1 sm=0 a=Rp7SkZ5WBuQA:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=20KFwNOVAAAA:8 a=Y07csAZc7FeYNLHsDbcA:9 a=y5NMJu_bV_FXizKsYMcA:7 a=waKOd6PxenIbeyy17-wFZW4NCK8A:4 a=jEp0ucaQiEUA:10 a=ld/erqUjW76FpBUqCqkKeA==:117 X-Cloudmark-Score: 0 X-Originating-IP: 71.70.153.3 Received: from [71.70.153.3] ([71.70.153.3:49709] helo=mail.poochiereds.net) by cdptpa-oedge01.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 26/3B-06710-E741AAC4; Mon, 04 Oct 2010 17:53:02 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id D96A658178; Mon, 4 Oct 2010 13:53:01 -0400 (EDT) From: Jeff Layton To: linux-cifs@vger.kernel.org Subject: [PATCH 03/14] cifs: eliminate cifs_posix_open_inode_helper Date: Mon, 4 Oct 2010 13:52:50 -0400 Message-Id: <1286214781-626-4-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1286214781-626-1-git-send-email-jlayton@redhat.com> References: <1286214781-626-1-git-send-email-jlayton@redhat.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, 04 Oct 2010 17:53:05 +0000 (UTC) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 84d1435..944983e 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -106,64 +106,6 @@ static inline int cifs_get_disposition(unsigned int flags) return FILE_OPEN; } -/* all arguments to this function must be checked for validity in caller */ -static inline int -cifs_posix_open_inode_helper(struct inode *inode, struct file *file, - struct cifsInodeInfo *pCifsInode, __u32 oplock, - u16 netfid) -{ - - write_lock(&GlobalSMBSeslock); - - pCifsInode = CIFS_I(file->f_path.dentry->d_inode); - if (pCifsInode == NULL) { - write_unlock(&GlobalSMBSeslock); - return -EINVAL; - } - - if (pCifsInode->clientCanCacheRead) { - /* we have the inode open somewhere else - no need to discard cache data */ - goto psx_client_can_cache; - } - - /* BB FIXME need to fix this check to move it earlier into posix_open - BB fIX following section BB FIXME */ - - /* if not oplocked, invalidate inode pages if mtime or file - size changed */ -/* temp = cifs_NTtimeToUnix(le64_to_cpu(buf->LastWriteTime)); - if (timespec_equal(&file->f_path.dentry->d_inode->i_mtime, &temp) && - (file->f_path.dentry->d_inode->i_size == - (loff_t)le64_to_cpu(buf->EndOfFile))) { - cFYI(1, "inode unchanged on server"); - } else { - if (file->f_path.dentry->d_inode->i_mapping) { - rc = filemap_write_and_wait(file->f_path.dentry->d_inode->i_mapping); - if (rc != 0) - CIFS_I(file->f_path.dentry->d_inode)->write_behind_rc = rc; - } - cFYI(1, "invalidating remote inode since open detected it " - "changed"); - invalidate_remote_inode(file->f_path.dentry->d_inode); - } */ - -psx_client_can_cache: - if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { - pCifsInode->clientCanCacheAll = true; - pCifsInode->clientCanCacheRead = true; - cFYI(1, "Exclusive Oplock granted on inode %p", - file->f_path.dentry->d_inode); - } else if ((oplock & 0xF) == OPLOCK_READ) - pCifsInode->clientCanCacheRead = true; - - /* will have to change the unlock if we reenable the - filemap_fdatawrite (which does not seem necessary */ - write_unlock(&GlobalSMBSeslock); - return 0; -} - -/* all arguments to this function must be checked for validity in caller */ static inline int cifs_open_inode_helper(struct inode *inode, struct cifsTconInfo *pTcon, __u32 oplock, FILE_ALL_INFO *buf, char *full_path, int xid) @@ -271,15 +213,6 @@ int cifs_open(struct inode *inode, struct file *file) oflags, &oplock, &netfid, xid); if (rc == 0) { cFYI(1, "posix open succeeded"); - /* no need for special case handling of setting mode - on read only files needed here */ - - rc = cifs_posix_open_inode_helper(inode, file, - pCifsInode, oplock, netfid); - if (rc != 0) { - CIFSSMBClose(xid, tcon, netfid); - goto out; - } pCifsFile = cifs_new_fileinfo(inode, netfid, file, tlink, oflags, oplock);