From patchwork Fri Oct 8 17:31:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 241711 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 o98HVGcd020619 for ; Fri, 8 Oct 2010 17:31:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758941Ab0JHRbP (ORCPT ); Fri, 8 Oct 2010 13:31:15 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:63517 "EHLO cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758834Ab0JHRbO (ORCPT ); Fri, 8 Oct 2010 13:31:14 -0400 X-Authority-Analysis: v=1.1 cv=lu/RhtYP0ChAeUxMEPBris12a71TWT5f9yvo3GNwP9w= c=1 sm=0 a=og0bE7gNfscA:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=20KFwNOVAAAA:8 a=VnNF1IyMAAAA:8 a=Y07csAZc7FeYNLHsDbcA:9 a=Pm6DQG1nIDB0AZJ3ycwA:7 a=hxlOdOf-GaHNWid800eyNam8I_kA:4 a=jEp0ucaQiEUA:10 a=0kPLrQdw3YYA: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:45741] helo=mail.poochiereds.net) by cdptpa-oedge02.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id D8/D6-14228-1655FAC4; Fri, 08 Oct 2010 17:31:13 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id DDC1758183; Fri, 8 Oct 2010 13:31:12 -0400 (EDT) From: Jeff Layton To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org Subject: [PATCH 03/15] cifs: eliminate cifs_posix_open_inode_helper Date: Fri, 8 Oct 2010 13:31:00 -0400 Message-Id: <1286559072-29032-4-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1286559072-29032-1-git-send-email-jlayton@redhat.com> References: <1286559072-29032-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]); Fri, 08 Oct 2010 17:31:16 +0000 (UTC) diff --git a/fs/cifs/file.c b/fs/cifs/file.c index fd78a35..c10f085 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);