提交 2e396b83 编写于 作者: J Jeff Layton 提交者: Steve French

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: NJeff Layton <jlayton@redhat.com>
Reviewed-by: NSuresh Jayaraman <sjayaraman@suse.de>
Acked-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: NSteve French <sfrench@us.ibm.com>
上级 7da4b49a
...@@ -388,7 +388,6 @@ struct cifsFileInfo { ...@@ -388,7 +388,6 @@ struct cifsFileInfo {
__u16 netfid; /* file id from remote */ __u16 netfid; /* file id from remote */
/* BB add lock scope info here if needed */ ; /* BB add lock scope info here if needed */ ;
/* lock scope id (0 if none) */ /* lock scope id (0 if none) */
struct file *pfile; /* needed for writepage */
struct dentry *dentry; struct dentry *dentry;
unsigned int f_flags; unsigned int f_flags;
struct tcon_link *tlink; struct tcon_link *tlink;
......
...@@ -148,7 +148,6 @@ cifs_new_fileinfo(__u16 fileHandle, struct file *file, ...@@ -148,7 +148,6 @@ cifs_new_fileinfo(__u16 fileHandle, struct file *file,
pCifsFile->uid = current_fsuid(); pCifsFile->uid = current_fsuid();
pCifsFile->dentry = dget(dentry); pCifsFile->dentry = dget(dentry);
pCifsFile->f_flags = file->f_flags; pCifsFile->f_flags = file->f_flags;
pCifsFile->pfile = file;
pCifsFile->invalidHandle = false; pCifsFile->invalidHandle = false;
pCifsFile->closePend = false; pCifsFile->closePend = false;
pCifsFile->tlink = cifs_get_tlink(tlink); pCifsFile->tlink = cifs_get_tlink(tlink);
......
...@@ -1144,8 +1144,7 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode, ...@@ -1144,8 +1144,7 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
continue; continue;
if (fsuid_only && open_file->uid != current_fsuid()) if (fsuid_only && open_file->uid != current_fsuid())
continue; continue;
if (open_file->pfile && ((open_file->pfile->f_flags & O_RDWR) || if (OPEN_FMODE(open_file->f_flags) & FMODE_READ) {
(open_file->pfile->f_flags & O_RDONLY))) {
if (!open_file->invalidHandle) { if (!open_file->invalidHandle) {
/* found a good file */ /* found a good file */
/* lock it so it will not be closed on us */ /* lock it so it will not be closed on us */
...@@ -1194,9 +1193,7 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode, ...@@ -1194,9 +1193,7 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode,
continue; continue;
if (fsuid_only && open_file->uid != current_fsuid()) if (fsuid_only && open_file->uid != current_fsuid())
continue; continue;
if (open_file->pfile && if (OPEN_FMODE(open_file->f_flags) & FMODE_WRITE) {
((open_file->pfile->f_flags & O_RDWR) ||
(open_file->pfile->f_flags & O_WRONLY))) {
cifsFileInfo_get(open_file); cifsFileInfo_get(open_file);
if (!open_file->invalidHandle) { if (!open_file->invalidHandle) {
...@@ -2160,9 +2157,7 @@ static int is_inode_writable(struct cifsInodeInfo *cifs_inode) ...@@ -2160,9 +2157,7 @@ static int is_inode_writable(struct cifsInodeInfo *cifs_inode)
list_for_each_entry(open_file, &cifs_inode->openFileList, flist) { list_for_each_entry(open_file, &cifs_inode->openFileList, flist) {
if (open_file->closePend) if (open_file->closePend)
continue; continue;
if (open_file->pfile && if (OPEN_FMODE(open_file->f_flags) & FMODE_WRITE) {
((open_file->pfile->f_flags & O_RDWR) ||
(open_file->pfile->f_flags & O_WRONLY))) {
read_unlock(&GlobalSMBSeslock); read_unlock(&GlobalSMBSeslock);
return 1; return 1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册