aboutsummaryrefslogtreecommitdiffstats
path: root/fs/coda/pioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/coda/pioctl.c')
-rw-r--r--fs/coda/pioctl.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/fs/coda/pioctl.c b/fs/coda/pioctl.c
index ca25d96d45c9..cb140ef293e4 100644
--- a/fs/coda/pioctl.c
+++ b/fs/coda/pioctl.c
@@ -19,14 +19,12 @@
19#include <asm/uaccess.h> 19#include <asm/uaccess.h>
20 20
21#include <linux/coda.h> 21#include <linux/coda.h>
22#include <linux/coda_linux.h>
23#include <linux/coda_fs_i.h>
24#include <linux/coda_psdev.h> 22#include <linux/coda_psdev.h>
25 23
26#include <linux/smp_lock.h> 24#include "coda_linux.h"
27 25
28/* pioctl ops */ 26/* pioctl ops */
29static int coda_ioctl_permission(struct inode *inode, int mask); 27static int coda_ioctl_permission(struct inode *inode, int mask, unsigned int flags);
30static long coda_pioctl(struct file *filp, unsigned int cmd, 28static long coda_pioctl(struct file *filp, unsigned int cmd,
31 unsigned long user_data); 29 unsigned long user_data);
32 30
@@ -39,10 +37,11 @@ const struct inode_operations coda_ioctl_inode_operations = {
39const struct file_operations coda_ioctl_operations = { 37const struct file_operations coda_ioctl_operations = {
40 .owner = THIS_MODULE, 38 .owner = THIS_MODULE,
41 .unlocked_ioctl = coda_pioctl, 39 .unlocked_ioctl = coda_pioctl,
40 .llseek = noop_llseek,
42}; 41};
43 42
44/* the coda pioctl inode ops */ 43/* the coda pioctl inode ops */
45static int coda_ioctl_permission(struct inode *inode, int mask) 44static int coda_ioctl_permission(struct inode *inode, int mask, unsigned int flags)
46{ 45{
47 return (mask & MAY_EXEC) ? -EACCES : 0; 46 return (mask & MAY_EXEC) ? -EACCES : 0;
48} 47}
@@ -57,13 +56,9 @@ static long coda_pioctl(struct file *filp, unsigned int cmd,
57 struct inode *target_inode = NULL; 56 struct inode *target_inode = NULL;
58 struct coda_inode_info *cnp; 57 struct coda_inode_info *cnp;
59 58
60 lock_kernel();
61
62 /* get the Pioctl data arguments from user space */ 59 /* get the Pioctl data arguments from user space */
63 if (copy_from_user(&data, (void __user *)user_data, sizeof(data))) { 60 if (copy_from_user(&data, (void __user *)user_data, sizeof(data)))
64 error = -EINVAL; 61 return -EINVAL;
65 goto out;
66 }
67 62
68 /* 63 /*
69 * Look up the pathname. Note that the pathname is in 64 * Look up the pathname. Note that the pathname is in
@@ -75,13 +70,12 @@ static long coda_pioctl(struct file *filp, unsigned int cmd,
75 error = user_lpath(data.path, &path); 70 error = user_lpath(data.path, &path);
76 71
77 if (error) 72 if (error)
78 goto out; 73 return error;
79 else 74
80 target_inode = path.dentry->d_inode; 75 target_inode = path.dentry->d_inode;
81 76
82 /* return if it is not a Coda inode */ 77 /* return if it is not a Coda inode */
83 if (target_inode->i_sb != inode->i_sb) { 78 if (target_inode->i_sb != inode->i_sb) {
84 path_put(&path);
85 error = -EINVAL; 79 error = -EINVAL;
86 goto out; 80 goto out;
87 } 81 }
@@ -90,10 +84,7 @@ static long coda_pioctl(struct file *filp, unsigned int cmd,
90 cnp = ITOC(target_inode); 84 cnp = ITOC(target_inode);
91 85
92 error = venus_pioctl(inode->i_sb, &(cnp->c_fid), cmd, &data); 86 error = venus_pioctl(inode->i_sb, &(cnp->c_fid), cmd, &data);
93
94 path_put(&path);
95
96out: 87out:
97 unlock_kernel(); 88 path_put(&path);
98 return error; 89 return error;
99} 90}