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.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/fs/coda/pioctl.c b/fs/coda/pioctl.c
index 028a9a0f588b..2fd89b5c5c7b 100644
--- a/fs/coda/pioctl.c
+++ b/fs/coda/pioctl.c
@@ -23,8 +23,6 @@
23#include <linux/coda_fs_i.h> 23#include <linux/coda_fs_i.h>
24#include <linux/coda_psdev.h> 24#include <linux/coda_psdev.h>
25 25
26#include <linux/smp_lock.h>
27
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);
30static long coda_pioctl(struct file *filp, unsigned int cmd, 28static long coda_pioctl(struct file *filp, unsigned int cmd,
@@ -58,13 +56,9 @@ static long coda_pioctl(struct file *filp, unsigned int cmd,
58 struct inode *target_inode = NULL; 56 struct inode *target_inode = NULL;
59 struct coda_inode_info *cnp; 57 struct coda_inode_info *cnp;
60 58
61 lock_kernel();
62
63 /* get the Pioctl data arguments from user space */ 59 /* get the Pioctl data arguments from user space */
64 if (copy_from_user(&data, (void __user *)user_data, sizeof(data))) { 60 if (copy_from_user(&data, (void __user *)user_data, sizeof(data)))
65 error = -EINVAL; 61 return -EINVAL;
66 goto out;
67 }
68 62
69 /* 63 /*
70 * Look up the pathname. Note that the pathname is in 64 * Look up the pathname. Note that the pathname is in
@@ -76,13 +70,12 @@ static long coda_pioctl(struct file *filp, unsigned int cmd,
76 error = user_lpath(data.path, &path); 70 error = user_lpath(data.path, &path);
77 71
78 if (error) 72 if (error)
79 goto out; 73 return error;
80 else 74
81 target_inode = path.dentry->d_inode; 75 target_inode = path.dentry->d_inode;
82 76
83 /* return if it is not a Coda inode */ 77 /* return if it is not a Coda inode */
84 if (target_inode->i_sb != inode->i_sb) { 78 if (target_inode->i_sb != inode->i_sb) {
85 path_put(&path);
86 error = -EINVAL; 79 error = -EINVAL;
87 goto out; 80 goto out;
88 } 81 }
@@ -91,10 +84,7 @@ static long coda_pioctl(struct file *filp, unsigned int cmd,
91 cnp = ITOC(target_inode); 84 cnp = ITOC(target_inode);
92 85
93 error = venus_pioctl(inode->i_sb, &(cnp->c_fid), cmd, &data); 86 error = venus_pioctl(inode->i_sb, &(cnp->c_fid), cmd, &data);
94
95 path_put(&path);
96
97out: 87out:
98 unlock_kernel(); 88 path_put(&path);
99 return error; 89 return error;
100} 90}