aboutsummaryrefslogtreecommitdiffstats
path: root/fs/smbfs/ioctl.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /fs/smbfs/ioctl.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'fs/smbfs/ioctl.c')
-rw-r--r--fs/smbfs/ioctl.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/fs/smbfs/ioctl.c b/fs/smbfs/ioctl.c
new file mode 100644
index 000000000000..dbae1f8ea26f
--- /dev/null
+++ b/fs/smbfs/ioctl.c
@@ -0,0 +1,67 @@
1/*
2 * ioctl.c
3 *
4 * Copyright (C) 1995, 1996 by Volker Lendecke
5 * Copyright (C) 1997 by Volker Lendecke
6 *
7 * Please add a note about your changes to smbfs in the ChangeLog file.
8 */
9
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>
16#include <linux/net.h>
17
18#include <linux/smb_fs.h>
19#include <linux/smb_mount.h>
20
21#include <asm/uaccess.h>
22
23#include "proto.h"
24
25int
26smb_ioctl(struct inode *inode, struct file *filp,
27 unsigned int cmd, unsigned long arg)
28{
29 struct smb_sb_info *server = server_from_inode(inode);
30 struct smb_conn_opt opt;
31 int result = -EINVAL;
32
33 switch (cmd) {
34 uid16_t uid16;
35 uid_t uid32;
36 case SMB_IOC_GETMOUNTUID:
37 SET_UID(uid16, server->mnt->mounted_uid);
38 result = put_user(uid16, (uid16_t __user *) arg);
39 break;
40 case SMB_IOC_GETMOUNTUID32:
41 SET_UID(uid32, server->mnt->mounted_uid);
42 result = put_user(uid32, (uid_t __user *) arg);
43 break;
44
45 case SMB_IOC_NEWCONN:
46 /* arg is smb_conn_opt, or NULL if no connection was made */
47 if (!arg) {
48 result = 0;
49 smb_lock_server(server);
50 server->state = CONN_RETRIED;
51 printk(KERN_ERR "Connection attempt failed! [%d]\n",
52 server->conn_error);
53 smbiod_flush(server);
54 smb_unlock_server(server);
55 break;
56 }
57
58 result = -EFAULT;
59 if (!copy_from_user(&opt, (void __user *)arg, sizeof(opt)))
60 result = smb_newconn(server, &opt);
61 break;
62 default:
63 break;
64 }
65
66 return result;
67}