diff options
author | Jeff Layton <jlayton@redhat.com> | 2010-10-15 21:34:01 +0200 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-10-18 03:07:20 +0200 |
commit | 2e396b83f6087b78dac5a18d6d0cf9f8426a00b3 (patch) | |
tree | 890c0af098920fe79e85f475a25fcc2f0d8c00bc /fs/cifs/file.c | |
parent | cifs: cifs_write argument change and cleanup (diff) | |
download | linux-2e396b83f6087b78dac5a18d6d0cf9f8426a00b3.tar.xz linux-2e396b83f6087b78dac5a18d6d0cf9f8426a00b3.zip |
cifs: eliminate pfile pointer from cifsFileInfo
All the remaining users of cifsFileInfo->pfile just use it to get
at the f_flags/f_mode. Now that we store that separately in the
cifsFileInfo, there's no need to consult the pfile at all from
a cifsFileInfo pointer.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Suresh Jayaraman <sjayaraman@suse.de>
Acked-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index d5f3007364e3..7935816fa111 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -1144,8 +1144,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 */ @@ -1194,9 +1193,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) { @@ -2160,9 +2157,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; } |