The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/fs/smbfs/ioctl.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    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/sched.h>
   14 #include <linux/mm.h>
   15 #include <linux/highuid.h>
   16 
   17 #include <linux/smb_fs.h>
   18 #include <linux/smb_mount.h>
   19 
   20 #include <asm/uaccess.h>
   21 
   22 #include "proto.h"
   23 
   24 int
   25 smb_ioctl(struct inode *inode, struct file *filp,
   26           unsigned int cmd, unsigned long arg)
   27 {
   28         struct smb_sb_info *server = server_from_inode(inode);
   29         struct smb_conn_opt opt;
   30         int result = -EINVAL;
   31 
   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;
   40 
   41         case SMB_IOC_NEWCONN:
   42                 /* arg is smb_conn_opt, or NULL if no connection was made */
   43                 if (!arg) {
   44                         result = smb_wakeup(server);
   45                         break;
   46                 }
   47 
   48                 result = -EFAULT;
   49                 if (!copy_from_user(&opt, (void *)arg, sizeof(opt)))
   50                         result = smb_newconn(server, &opt);
   51                 break;
   52         default:
   53                 break;
   54         }
   55 
   56         return result;
   57 }

Cache object: a8597e550b4f704725c87fa2da84fb96


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.