Pull one more egcs 1.1.2 workaround.
[linux-2.6/linux-mips.git] / fs / smbfs / ioctl.c
blobc9ede0b72a3e4d0c0e0a4f09a575ff9cb3fc61c8
1 /*
2 * ioctl.c
4 * Copyright (C) 1995, 1996 by Volker Lendecke
5 * Copyright (C) 1997 by Volker Lendecke
7 * Please add a note about your changes to smbfs in the ChangeLog file.
8 */
10 #include <linux/errno.h>
11 #include <linux/fs.h>
12 #include <linux/ioctl.h>
13 #include <linux/time.h>
14 #include <linux/mm.h>
15 #include <linux/highuid.h>
17 #include <linux/smb_fs.h>
18 #include <linux/smb_mount.h>
20 #include <asm/uaccess.h>
22 #include "proto.h"
24 int
25 smb_ioctl(struct inode *inode, struct file *filp,
26 unsigned int cmd, unsigned long arg)
28 struct smb_sb_info *server = server_from_inode(inode);
29 struct smb_conn_opt opt;
30 int result = -EINVAL;
32 switch (cmd) {
33 case SMB_IOC_GETMOUNTUID:
34 result = put_user(NEW_TO_OLD_UID(server->mnt->mounted_uid),
35 (uid16_t *) arg);
36 break;
37 case SMB_IOC_GETMOUNTUID32:
38 result = put_user(server->mnt->mounted_uid, (uid_t *) arg);
39 break;
41 case SMB_IOC_NEWCONN:
42 /* arg is smb_conn_opt, or NULL if no connection was made */
43 if (!arg) {
44 result = 0;
45 smb_lock_server(server);
46 server->state = CONN_RETRIED;
47 printk(KERN_ERR "Connection attempt failed! [%d]\n",
48 server->conn_error);
49 smbiod_flush(server);
50 smb_unlock_server(server);
51 break;
54 result = -EFAULT;
55 if (!copy_from_user(&opt, (void *)arg, sizeof(opt)))
56 result = smb_newconn(server, &opt);
57 break;
58 default:
59 break;
62 return result;