linux/fs/coda/pioctl.c
<<
>>
Prefs
   1/*
   2 * Pioctl operations for Coda.
   3 * Original version: (C) 1996 Peter Braam
   4 * Rewritten for Linux 2.1: (C) 1997 Carnegie Mellon University
   5 *
   6 * Carnegie Mellon encourages users of this code to contribute improvements
   7 * to the Coda project. Contact Peter Braam <coda@cs.cmu.edu>.
   8 */
   9
  10#include <linux/types.h>
  11#include <linux/kernel.h>
  12#include <linux/time.h>
  13#include <linux/fs.h>
  14#include <linux/stat.h>
  15#include <linux/errno.h>
  16#include <linux/string.h>
  17#include <linux/namei.h>
  18#include <linux/module.h>
  19#include <asm/uaccess.h>
  20
  21#include <linux/coda.h>
  22#include <linux/coda_psdev.h>
  23
  24#include "coda_linux.h"
  25
  26/* pioctl ops */
  27static int coda_ioctl_permission(struct inode *inode, int mask);
  28static long coda_pioctl(struct file *filp, unsigned int cmd,
  29                        unsigned long user_data);
  30
  31/* exported from this file */
  32const struct inode_operations coda_ioctl_inode_operations = {
  33        .permission     = coda_ioctl_permission,
  34        .setattr        = coda_setattr,
  35};
  36
  37const struct file_operations coda_ioctl_operations = {
  38        .owner          = THIS_MODULE,
  39        .unlocked_ioctl = coda_pioctl,
  40        .llseek         = noop_llseek,
  41};
  42
  43/* the coda pioctl inode ops */
  44static int coda_ioctl_permission(struct inode *inode, int mask)
  45{
  46        return (mask & MAY_EXEC) ? -EACCES : 0;
  47}
  48
  49static long coda_pioctl(struct file *filp, unsigned int cmd,
  50                        unsigned long user_data)
  51{
  52        struct path path;
  53        int error;
  54        struct PioctlData data;
  55        struct inode *inode = filp->f_dentry->d_inode;
  56        struct inode *target_inode = NULL;
  57        struct coda_inode_info *cnp;
  58
  59        /* get the Pioctl data arguments from user space */
  60        if (copy_from_user(&data, (void __user *)user_data, sizeof(data)))
  61                return -EINVAL;
  62
  	  >
  v2.6.14.1E/d="L63" class="line" name="L63">  	  >
 u>
  
         6struc6omment"> *
   6 * Carnegie Mellon ennnnnnnn*s/coda/pioctl.c#L60" id="L60" class="line" na6e="L57">  57       6struc67href="+code=copy_from_user" cladata)))
  58
error;
of(;
)))
path;
  59       6  60       7if (<7          unsigned lor" class="sref">error;
of(;
)))
path;
  61       7     71da/pioctl.c#L63" id="L63" class=7line" na7e="L62">  62
error;
  	  >
  v2.6.17.1E/d73 return -error;

  e7"L63">  	  >
 usv2.6. c7ass="74da/pioctl.c#L63" id="L63" class=7line" na7e="L55">  55       7struc7 target_inode = path;
f_dentry->d_inode;
   6   7  	  >
code=EINcopit is=not aact Pe
  58
target_inode = >inode *  59       7error;
EINVAL;
  60       8if (<8          unsigned logotoor" class="sref"outr          =utoda/pioctl.c#L62" id="L62" class=8line" na8e="L61">  61       8     8  return -  62
  	  >
  v2.6.18.1E/d8"L63" class="line" name="L63">  	  >
=noweterceedt. Cmakegumenupcallr*s/coda/pioctl.c#L60" id="L60" class=8	  >
  e8"L63">  	  >
 usv2.6. c8ass="84;
ITO_EXEC) ? -target_inode =   55       8struc8oda/pioctl.c#L26" id="L26" class=8ine" nam8e="L6">   6error;
venusf">coda_pioctl(strvenusf">coda+code_from_user" cla>inode *;
cmd,
data)))
   7          =utoda/:ioctl.c#L30" id="L30" class=8ine" namee="L8">   8          fs/c_put+code=data" class="sref">path;
  59       8error;
  60       9if (<90oda/pioctl.c#L48" id="L48" class=9line" na9e="L61">  61       9     9omment/pre    
   

ntent">

  footer">
Tmeno) 1996 PLXR softwarenbygumenoctl.c#L4http://sourcefo hr.net/ter Bras/lxr">LXR 63">un"fs/ca/p 
  	6 Peter Brnbygoctl.c#L4mailto:lxr@a hrefno">lxr@a hrefnooda/e
ntent">
  subfooter">
lxr.a hrefno kindly hos*/Redpill7 Cater AS/ca/p a hriderntriLCarnef="+ulting and>.


/body">
/html