diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-12-06 23:51:34 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1997-12-06 23:51:34 +0000 |
commit | 230e5ab6a084ed50470f101934782dbf54b0d06b (patch) | |
tree | 5dd821c8d33f450470588e7a543f74bf74306e9e /fs/smbfs/ioctl.c | |
parent | c9b1c8a64c6444d189856f1e26bdcb8b4cd0113a (diff) |
Merge with Linux 2.1.67.
Diffstat (limited to 'fs/smbfs/ioctl.c')
-rw-r--r-- | fs/smbfs/ioctl.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/fs/smbfs/ioctl.c b/fs/smbfs/ioctl.c index 45bebd2fe..5eb3dc88f 100644 --- a/fs/smbfs/ioctl.c +++ b/fs/smbfs/ioctl.c @@ -8,10 +8,11 @@ #include <linux/errno.h> #include <linux/fs.h> -#include <linux/smb_fs.h> #include <linux/ioctl.h> #include <linux/sched.h> #include <linux/mm.h> +#include <linux/smb_fs.h> +#include <linux/smb_mount.h> #include <asm/uaccess.h> @@ -19,33 +20,33 @@ int smb_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { + int result = -EINVAL; + switch (cmd) { case SMB_IOC_GETMOUNTUID: - return put_user(SMB_SERVER(inode)->m.mounted_uid, + result = put_user(SMB_SERVER(inode)->mnt->mounted_uid, (uid_t *) arg); + break; case SMB_IOC_NEWCONN: { struct smb_conn_opt opt; - int result; if (arg == 0) { /* The process offers a new connection upon SIGUSR1 */ - return smb_offerconn(SMB_SERVER(inode)); + result = smb_offerconn(SMB_SERVER(inode)); } - - if ((result = verify_area(VERIFY_READ, (uid_t *) arg, - sizeof(opt))) != 0) + else { - return result; + result = -EFAULT; + if (!copy_from_user(&opt, (void *)arg, sizeof(opt))) + result = smb_newconn(SMB_SERVER(inode), &opt); } - copy_from_user(&opt, (void *)arg, sizeof(opt)); - - return smb_newconn(SMB_SERVER(inode), &opt); + break; } default: - return -EINVAL; } + return result; } |