From patchwork Fri Oct 8 17:30:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 241741 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 o98HVGcg020619 for ; Fri, 8 Oct 2010 17:31:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758805Ab0JHRbQ (ORCPT ); Fri, 8 Oct 2010 13:31:16 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.123]:33716 "EHLO cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758912Ab0JHRbO (ORCPT ); Fri, 8 Oct 2010 13:31:14 -0400 X-Authority-Analysis: v=1.1 cv=tl/FS04gSkLncqxOIKBEYmN/gODDJX05BQMXZ5l6AuI= c=1 sm=0 a=E3lUqHwKfW4A:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=20KFwNOVAAAA:8 a=VnNF1IyMAAAA:8 a=cGv2zo06fA8P85bJdT4A:9 a=NCHqgmFrd6TfzABe6tYA:7 a=jgLvgjXGFNqLnKEHPek__r6jwxkA: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:45739] helo=mail.poochiereds.net) by cdptpa-oedge03.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id 35/BC-19342-0655FAC4; Fri, 08 Oct 2010 17:31:13 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id B44A258180; Fri, 8 Oct 2010 13:31:12 -0400 (EDT) From: Jeff Layton To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org Subject: [PATCH 01/15] cifs: keep dentry reference in cifsFileInfo instead of inode reference Date: Fri, 8 Oct 2010 13:30:58 -0400 Message-Id: <1286559072-29032-2-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:17 +0000 (UTC) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index eef5df1..8fa4ccf 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -387,7 +387,7 @@ struct cifsFileInfo { /* BB add lock scope info here if needed */ ; /* lock scope id (0 if none) */ struct file *pfile; /* needed for writepage */ - struct inode *pInode; /* needed for oplock break */ + struct dentry *dentry; struct vfsmount *mnt; struct tcon_link *tlink; struct mutex lock_mutex; @@ -412,7 +412,7 @@ static inline void cifsFileInfo_put(struct cifsFileInfo *cifs_file) { if (atomic_dec_and_test(&cifs_file->count)) { cifs_put_tlink(cifs_file->tlink); - iput(cifs_file->pInode); + dput(cifs_file->dentry); kfree(cifs_file); } } diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index e249b56..6887c41 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -135,6 +135,7 @@ cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, struct file *file, struct vfsmount *mnt, struct tcon_link *tlink, unsigned int oflags, __u32 oplock) { + struct dentry *dentry = file->f_path.dentry; struct cifsFileInfo *pCifsFile; struct cifsInodeInfo *pCifsInode; @@ -145,7 +146,7 @@ cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, struct file *file, pCifsFile->netfid = fileHandle; pCifsFile->pid = current->tgid; pCifsFile->uid = current_fsuid(); - pCifsFile->pInode = igrab(newinode); + pCifsFile->dentry = dget(dentry); pCifsFile->mnt = mnt; pCifsFile->pfile = file; pCifsFile->invalidHandle = false; diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 80856f1..c302b9c 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -2335,7 +2335,7 @@ void cifs_oplock_break(struct work_struct *work) { struct cifsFileInfo *cfile = container_of(work, struct cifsFileInfo, oplock_break); - struct inode *inode = cfile->pInode; + struct inode *inode = cfile->dentry->d_inode; struct cifsInodeInfo *cinode = CIFS_I(inode); int rc, waitrc = 0; diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index 252f276..9bac3e7 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c @@ -578,7 +578,7 @@ is_valid_oplock_break(struct smb_hdr *buf, struct TCP_Server_Info *srv) } cFYI(1, "file id match, oplock break"); - pCifsInode = CIFS_I(netfile->pInode); + pCifsInode = CIFS_I(netfile->dentry->d_inode); pCifsInode->clientCanCacheAll = false; if (pSMB->OplockLevel == 0) pCifsInode->clientCanCacheRead = false;