From 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 16 Apr 2005 15:20:36 -0700 Subject: Linux-2.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! --- fs/smbfs/ioctl.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 fs/smbfs/ioctl.c (limited to 'fs/smbfs/ioctl.c') diff --git a/fs/smbfs/ioctl.c b/fs/smbfs/ioctl.c new file mode 100644 index 00000000000..dbae1f8ea26 --- /dev/null +++ b/fs/smbfs/ioctl.c @@ -0,0 +1,67 @@ +/* + * ioctl.c + * + * 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 +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include "proto.h" + +int +smb_ioctl(struct inode *inode, struct file *filp, + unsigned int cmd, unsigned long arg) +{ + struct smb_sb_info *server = server_from_inode(inode); + struct smb_conn_opt opt; + int result = -EINVAL; + + switch (cmd) { + uid16_t uid16; + uid_t uid32; + case SMB_IOC_GETMOUNTUID: + SET_UID(uid16, server->mnt->mounted_uid); + result = put_user(uid16, (uid16_t __user *) arg); + break; + case SMB_IOC_GETMOUNTUID32: + SET_UID(uid32, server->mnt->mounted_uid); + result = put_user(uid32, (uid_t __user *) arg); + break; + + case SMB_IOC_NEWCONN: + /* arg is smb_conn_opt, or NULL if no connection was made */ + if (!arg) { + result = 0; + smb_lock_server(server); + server->state = CONN_RETRIED; + printk(KERN_ERR "Connection attempt failed! [%d]\n", + server->conn_error); + smbiod_flush(server); + smb_unlock_server(server); + break; + } + + result = -EFAULT; + if (!copy_from_user(&opt, (void __user *)arg, sizeof(opt))) + result = smb_newconn(server, &opt); + break; + default: + break; + } + + return result; +} -- cgit v1.2.3