aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/dir.c
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-09-18 19:20:26 -0400
committerSteve French <smfrench@gmail.com>2012-09-24 22:46:26 -0400
commitfb1214e48f735cdb68446adb77ec37aa3de60697 (patch)
tree158dbfbedaf396f013e70f5288fdc906e990391c /fs/cifs/dir.c
parent4b4de76e35518fc0c636f628abca8c1b19ad6689 (diff)
CIFS: Move open code to ops struct
Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r--fs/cifs/dir.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 781025be48bc..70823dc4f960 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -377,11 +377,12 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
377 unsigned int xid; 377 unsigned int xid;
378 struct tcon_link *tlink; 378 struct tcon_link *tlink;
379 struct cifs_tcon *tcon; 379 struct cifs_tcon *tcon;
380 __u16 fileHandle; 380 struct cifs_fid fid;
381 __u32 oplock; 381 __u32 oplock;
382 struct cifsFileInfo *pfile_info; 382 struct cifsFileInfo *file_info;
383 383
384 /* Posix open is only called (at lookup time) for file create now. For 384 /*
385 * Posix open is only called (at lookup time) for file create now. For
385 * opens (rather than creates), because we do not know if it is a file 386 * opens (rather than creates), because we do not know if it is a file
386 * or directory yet, and current Samba no longer allows us to do posix 387 * or directory yet, and current Samba no longer allows us to do posix
387 * open on dirs, we could end up wasting an open call on what turns out 388 * open on dirs, we could end up wasting an open call on what turns out
@@ -415,20 +416,20 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
415 tcon = tlink_tcon(tlink); 416 tcon = tlink_tcon(tlink);
416 417
417 rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode, 418 rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode,
418 &oplock, &fileHandle, opened); 419 &oplock, &fid.netfid, opened);
419 420
420 if (rc) 421 if (rc)
421 goto out; 422 goto out;
422 423
423 rc = finish_open(file, direntry, generic_file_open, opened); 424 rc = finish_open(file, direntry, generic_file_open, opened);
424 if (rc) { 425 if (rc) {
425 CIFSSMBClose(xid, tcon, fileHandle); 426 CIFSSMBClose(xid, tcon, fid.netfid);
426 goto out; 427 goto out;
427 } 428 }
428 429
429 pfile_info = cifs_new_fileinfo(fileHandle, file, tlink, oplock); 430 file_info = cifs_new_fileinfo(&fid, file, tlink, oplock);
430 if (pfile_info == NULL) { 431 if (file_info == NULL) {
431 CIFSSMBClose(xid, tcon, fileHandle); 432 CIFSSMBClose(xid, tcon, fid.netfid);
432 rc = -ENOMEM; 433 rc = -ENOMEM;
433 } 434 }
434 435