From patchwork Fri Oct 8 17:31:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 241761 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 o98HVGci020619 for ; Fri, 8 Oct 2010 17:31:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758961Ab0JHRbR (ORCPT ); Fri, 8 Oct 2010 13:31:17 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.123]:42534 "EHLO cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758672Ab0JHRbP (ORCPT ); Fri, 8 Oct 2010 13:31:15 -0400 X-Authority-Analysis: v=1.1 cv=UAZ0ep3suvkVn+xl78ZyFqEJZfCyw4fsauT9kMdOA88= c=1 sm=0 a=TdJtleq1SBwA:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=20KFwNOVAAAA:8 a=VnNF1IyMAAAA:8 a=2GpXGhI54dqowOPU-2kA:9 a=erSEvZiv78X56zhADokA:7 a=4QnM1fCCxWKnLQFeW1vBaNSTdy8A: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:45746] helo=mail.poochiereds.net) by cdptpa-oedge04.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id 53/6D-03860-1655FAC4; Fri, 08 Oct 2010 17:31:13 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id 3204A58189; Fri, 8 Oct 2010 13:31:13 -0400 (EDT) From: Jeff Layton To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org Subject: [PATCH 08/15] cifs: eliminate pfile pointer from cifsFileInfo Date: Fri, 8 Oct 2010 13:31:05 -0400 Message-Id: <1286559072-29032-9-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 3c8904e..6dcd911 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -386,7 +386,6 @@ struct cifsFileInfo { __u16 netfid; /* file id from remote */ /* BB add lock scope info here if needed */ ; /* lock scope id (0 if none) */ - struct file *pfile; /* needed for writepage */ struct dentry *dentry; unsigned int f_flags; struct tcon_link *tlink; diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 5fe1d89..0ad8eef 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -148,7 +148,6 @@ cifs_new_fileinfo(__u16 fileHandle, struct file *file, pCifsFile->uid = current_fsuid(); pCifsFile->dentry = dget(dentry); pCifsFile->f_flags = file->f_flags; - pCifsFile->pfile = file; pCifsFile->invalidHandle = false; pCifsFile->closePend = false; pCifsFile->tlink = cifs_get_tlink(tlink); diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 57fbfad..83e16d6 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -1080,8 +1080,7 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode, continue; if (fsuid_only && open_file->uid != current_fsuid()) continue; - if (open_file->pfile && ((open_file->pfile->f_flags & O_RDWR) || - (open_file->pfile->f_flags & O_RDONLY))) { + if (OPEN_FMODE(open_file->f_flags) & FMODE_READ) { if (!open_file->invalidHandle) { /* found a good file */ /* lock it so it will not be closed on us */ @@ -1130,9 +1129,7 @@ refind_writable: continue; if (fsuid_only && open_file->uid != current_fsuid()) continue; - if (open_file->pfile && - ((open_file->pfile->f_flags & O_RDWR) || - (open_file->pfile->f_flags & O_WRONLY))) { + if (OPEN_FMODE(open_file->f_flags) & FMODE_WRITE) { cifsFileInfo_get(open_file); if (!open_file->invalidHandle) { @@ -2096,9 +2093,7 @@ static int is_inode_writable(struct cifsInodeInfo *cifs_inode) list_for_each_entry(open_file, &cifs_inode->openFileList, flist) { if (open_file->closePend) continue; - if (open_file->pfile && - ((open_file->pfile->f_flags & O_RDWR) || - (open_file->pfile->f_flags & O_WRONLY))) { + if (OPEN_FMODE(open_file->f_flags) & FMODE_WRITE) { read_unlock(&GlobalSMBSeslock); return 1; }