aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/cifs/file.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index fee993c92f1a..429337eb7afe 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -201,17 +201,6 @@ static inline int cifs_open_inode_helper(struct inode *inode, struct file *file,
201 struct timespec temp; 201 struct timespec temp;
202 int rc; 202 int rc;
203 203
204 /* want handles we can use to read with first
205 in the list so we do not have to walk the
206 list to search for one in write_begin */
207 if ((file->f_flags & O_ACCMODE) == O_WRONLY) {
208 list_add_tail(&pCifsFile->flist,
209 &pCifsInode->openFileList);
210 } else {
211 list_add(&pCifsFile->flist,
212 &pCifsInode->openFileList);
213 }
214 write_unlock(&GlobalSMBSeslock);
215 if (pCifsInode->clientCanCacheRead) { 204 if (pCifsInode->clientCanCacheRead) {
216 /* we have the inode open somewhere else 205 /* we have the inode open somewhere else
217 no need to discard cache data */ 206 no need to discard cache data */
@@ -397,6 +386,7 @@ int cifs_open(struct inode *inode, struct file *file)
397 cFYI(1, ("cifs_open returned 0x%x", rc)); 386 cFYI(1, ("cifs_open returned 0x%x", rc));
398 goto out; 387 goto out;
399 } 388 }
389
400 pCifsFile = cifs_new_fileinfo(inode, netfid, file, file->f_path.mnt, 390 pCifsFile = cifs_new_fileinfo(inode, netfid, file, file->f_path.mnt,
401 file->f_flags); 391 file->f_flags);
402 file->private_data = pCifsFile; 392 file->private_data = pCifsFile;
@@ -405,14 +395,8 @@ int cifs_open(struct inode *inode, struct file *file)
405 goto out; 395 goto out;
406 } 396 }
407 397
408 pCifsInode = CIFS_I(file->f_path.dentry->d_inode); 398 rc = cifs_open_inode_helper(inode, file, pCifsInode, pCifsFile, tcon,
409 if (pCifsInode) { 399 &oplock, buf, full_path, xid);
410 rc = cifs_open_inode_helper(inode, file, pCifsInode,
411 pCifsFile, tcon,
412 &oplock, buf, full_path, xid);
413 } else {
414 write_unlock(&GlobalSMBSeslock);
415 }
416 400
417 if (oplock & CIFS_CREATE_ACTION) { 401 if (oplock & CIFS_CREATE_ACTION) {
418 /* time to set mode which we can not set earlier due to 402 /* time to set mode which we can not set earlier due to