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.
10 #include <linux/errno.h>
12 #include <linux/ioctl.h>
13 #include <linux/time.h>
15 #include <linux/highuid.h>
16 #include <linux/smp_lock.h>
17 #include <linux/net.h>
19 #include <linux/smb_fs.h>
20 #include <linux/smb_mount.h>
22 #include <asm/uaccess.h>
27 smb_ioctl(struct file
*filp
, unsigned int cmd
, unsigned long arg
)
29 struct smb_sb_info
*server
= server_from_inode(filp
->f_path
.dentry
->d_inode
);
30 struct smb_conn_opt opt
;
37 case SMB_IOC_GETMOUNTUID
:
38 SET_UID(uid16
, server
->mnt
->mounted_uid
);
39 result
= put_user(uid16
, (uid16_t __user
*) arg
);
41 case SMB_IOC_GETMOUNTUID32
:
42 SET_UID(uid32
, server
->mnt
->mounted_uid
);
43 result
= put_user(uid32
, (uid_t __user
*) arg
);
47 /* arg is smb_conn_opt, or NULL if no connection was made */
50 smb_lock_server(server
);
51 server
->state
= CONN_RETRIED
;
52 printk(KERN_ERR
"Connection attempt failed! [%d]\n",
55 smb_unlock_server(server
);
60 if (!copy_from_user(&opt
, (void __user
*)arg
, sizeof(opt
)))
61 result
= smb_newconn(server
, &opt
);