aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/dir.c
diff options
context:
space:
mode:
authorPavel Shilovsky <piastry@etersoft.ru>2014-01-16 15:53:36 +0400
committerSteve French <smfrench@gmail.com>2014-01-20 09:52:13 -0600
commitd81b8a40e2ece0a9ab57b1fe1798e291e75bf8fc (patch)
treea3fd90c8172375499b2ad8f5f21ba633a3e522b3 /fs/cifs/dir.c
parent0360d605a236355f9501d21175e405536e2acd48 (diff)
downloadlinux-d81b8a40e2ece0a9ab57b1fe1798e291e75bf8fc.tar.gz
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.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 0850325c3b4497..d3a6796caa5a3f 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 */