|
@@ -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) ||
|
|
|
|
- (open_file->pfile->f_flags & O_RDONLY))) {
|
|
|
|
|
|
+ if (OPEN_FMODE(open_file->f_flags) & FMODE_READ) {
|
|
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 @@ refind_writable:
|
|
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) ||
|
|
|
|
- (open_file->pfile->f_flags & O_WRONLY))) {
|
|
|
|
|
|
+ if (OPEN_FMODE(open_file->f_flags) & FMODE_WRITE) {
|
|
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)
|
|
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 &&
|
|
|
|
- ((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);
|
|
read_unlock(&GlobalSMBSeslock);
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|