diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2014-01-16 12:53:36 +0100 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2014-01-20 16:52:13 +0100 |
commit | d81b8a40e2ece0a9ab57b1fe1798e291e75bf8fc (patch) | |
tree | a3fd90c8172375499b2ad8f5f21ba633a3e522b3 /fs/cifs/dir.c | |
parent | CIFS: Remove extra indentation in cifs_sfu_type (diff) | |
download | linux-d81b8a40e2ece0a9ab57b1fe1798e291e75bf8fc.tar.xz linux-d81b8a40e2ece0a9ab57b1fe1798e291e75bf8fc.zip |
CIFS: Cleanup cifs open codepath
Rename CIFSSMBOpen to CIFS_open and make it take
cifs_open_parms structure as a parm.
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r-- | fs/cifs/dir.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 0850325c3b44..d3a6796caa5a 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -570,7 +570,8 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, char *full_path = NULL; struct inode *newinode = NULL; int oplock = 0; - u16 netfid; + struct cifs_fid fid; + struct cifs_open_parms oparms; FILE_ALL_INFO *buf = NULL; unsigned int bytes_written; struct win_dev *pdev; @@ -640,10 +641,16 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, if (backup_cred(cifs_sb)) create_options |= CREATE_OPEN_BACKUP_INTENT; - rc = CIFSSMBOpen(xid, tcon, full_path, FILE_CREATE, - GENERIC_WRITE, create_options, - &netfid, &oplock, buf, cifs_sb->local_nls, - cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); + oparms.tcon = tcon; + oparms.cifs_sb = cifs_sb; + oparms.desired_access = GENERIC_WRITE; + oparms.create_options = create_options; + oparms.disposition = FILE_CREATE; + oparms.path = full_path; + oparms.fid = &fid; + oparms.reconnect = false; + + rc = CIFS_open(xid, &oparms, &oplock, buf); if (rc) goto mknod_out; @@ -653,7 +660,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, */ pdev = (struct win_dev *)buf; - io_parms.netfid = netfid; + io_parms.netfid = fid.netfid; io_parms.pid = current->tgid; io_parms.tcon = tcon; io_parms.offset = 0; @@ -671,7 +678,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode, rc = CIFSSMBWrite(xid, &io_parms, &bytes_written, (char *)pdev, NULL, 0); } /* else if (S_ISFIFO) */ - CIFSSMBClose(xid, tcon, netfid); + CIFSSMBClose(xid, tcon, fid.netfid); d_drop(direntry); /* FIXME: add code here to set EAs */ |