patch-2.2.17 linux/fs/smbfs/ioctl.c
Next file: linux/fs/smbfs/proc.c
Previous file: linux/fs/smbfs/inode.c
Back to the patch index
Back to the overall index
- Lines: 61
- Date:
Mon Sep 4 18:39:27 2000
- Orig file:
v2.2.16/fs/smbfs/ioctl.c
- Orig date:
Mon Sep 4 18:37:06 2000
diff -u --recursive --new-file v2.2.16/fs/smbfs/ioctl.c linux/fs/smbfs/ioctl.c
@@ -4,6 +4,7 @@
* Copyright (C) 1995, 1996 by Volker Lendecke
* Copyright (C) 1997 by Volker Lendecke
*
+ * Please add a note about your changes to smbfs in the ChangeLog file.
*/
#include <linux/errno.h>
@@ -17,41 +18,31 @@
#include <asm/uaccess.h>
+
int
smb_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg)
{
struct smb_sb_info *server = SMB_SERVER(inode);
+ struct smb_conn_opt opt;
int result = -EINVAL;
- switch (cmd)
- {
+ switch (cmd) {
case SMB_IOC_GETMOUNTUID:
result = put_user(server->mnt->mounted_uid, (uid_t *) arg);
break;
case SMB_IOC_NEWCONN:
- {
- struct smb_conn_opt opt;
-
- if (arg)
- {
- result = -EFAULT;
- if (!copy_from_user(&opt, (void *)arg, sizeof(opt)))
- result = smb_newconn(server, &opt);
- }
- else
- {
-#if 0
- /* obsolete option ... print a warning */
- printk("SMBFS: ioctl deprecated, please upgrade "
- "smbfs package\n");
-#endif
- result = 0;
- }
+ /* require an argument == the mount data, else it is EINVAL */
+ if (!arg)
+ break;
+
+ result = -EFAULT;
+ if (!copy_from_user(&opt, (void *)arg, sizeof(opt)))
+ result = smb_newconn(server, &opt);
break;
- }
default:
}
+
return result;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)