diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/coda/pioctl.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/fs/coda/pioctl.c b/fs/coda/pioctl.c index 96ace2ce7e6c..ca25d96d45c9 100644 --- a/fs/coda/pioctl.c +++ b/fs/coda/pioctl.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Pioctl operations for Coda. | 2 | * Pioctl operations for Coda. |
3 | * Original version: (C) 1996 Peter Braam | 3 | * Original version: (C) 1996 Peter Braam |
4 | * Rewritten for Linux 2.1: (C) 1997 Carnegie Mellon University | 4 | * Rewritten for Linux 2.1: (C) 1997 Carnegie Mellon University |
5 | * | 5 | * |
6 | * Carnegie Mellon encourages users of this code to contribute improvements | 6 | * Carnegie Mellon encourages users of this code to contribute improvements |
@@ -31,8 +31,7 @@ static long coda_pioctl(struct file *filp, unsigned int cmd, | |||
31 | unsigned long user_data); | 31 | unsigned long user_data); |
32 | 32 | ||
33 | /* exported from this file */ | 33 | /* exported from this file */ |
34 | const struct inode_operations coda_ioctl_inode_operations = | 34 | const struct inode_operations coda_ioctl_inode_operations = { |
35 | { | ||
36 | .permission = coda_ioctl_permission, | 35 | .permission = coda_ioctl_permission, |
37 | .setattr = coda_setattr, | 36 | .setattr = coda_setattr, |
38 | }; | 37 | }; |
@@ -52,28 +51,28 @@ static long coda_pioctl(struct file *filp, unsigned int cmd, | |||
52 | unsigned long user_data) | 51 | unsigned long user_data) |
53 | { | 52 | { |
54 | struct path path; | 53 | struct path path; |
55 | int error; | 54 | int error; |
56 | struct PioctlData data; | 55 | struct PioctlData data; |
57 | struct inode *inode = filp->f_dentry->d_inode; | 56 | struct inode *inode = filp->f_dentry->d_inode; |
58 | struct inode *target_inode = NULL; | 57 | struct inode *target_inode = NULL; |
59 | struct coda_inode_info *cnp; | 58 | struct coda_inode_info *cnp; |
60 | 59 | ||
61 | lock_kernel(); | 60 | lock_kernel(); |
62 | 61 | ||
63 | /* get the Pioctl data arguments from user space */ | 62 | /* get the Pioctl data arguments from user space */ |
64 | if (copy_from_user(&data, (void __user *)user_data, sizeof(data))) { | 63 | if (copy_from_user(&data, (void __user *)user_data, sizeof(data))) { |
65 | error = -EINVAL; | 64 | error = -EINVAL; |
66 | goto out; | 65 | goto out; |
67 | } | 66 | } |
68 | 67 | ||
69 | /* | 68 | /* |
70 | * Look up the pathname. Note that the pathname is in | 69 | * Look up the pathname. Note that the pathname is in |
71 | * user memory, and namei takes care of this | 70 | * user memory, and namei takes care of this |
72 | */ | 71 | */ |
73 | if (data.follow) | 72 | if (data.follow) |
74 | error = user_path(data.path, &path); | 73 | error = user_path(data.path, &path); |
75 | else | 74 | else |
76 | error = user_lpath(data.path, &path); | 75 | error = user_lpath(data.path, &path); |
77 | 76 | ||
78 | if (error) | 77 | if (error) |
79 | goto out; | 78 | goto out; |
@@ -81,14 +80,14 @@ static long coda_pioctl(struct file *filp, unsigned int cmd, | |||
81 | target_inode = path.dentry->d_inode; | 80 | target_inode = path.dentry->d_inode; |
82 | 81 | ||
83 | /* return if it is not a Coda inode */ | 82 | /* return if it is not a Coda inode */ |
84 | if ( target_inode->i_sb != inode->i_sb ) { | 83 | if (target_inode->i_sb != inode->i_sb) { |
85 | path_put(&path); | 84 | path_put(&path); |
86 | error = -EINVAL; | 85 | error = -EINVAL; |
87 | goto out; | 86 | goto out; |
88 | } | 87 | } |
89 | 88 | ||
90 | /* now proceed to make the upcall */ | 89 | /* now proceed to make the upcall */ |
91 | cnp = ITOC(target_inode); | 90 | cnp = ITOC(target_inode); |
92 | 91 | ||
93 | error = venus_pioctl(inode->i_sb, &(cnp->c_fid), cmd, &data); | 92 | error = venus_pioctl(inode->i_sb, &(cnp->c_fid), cmd, &data); |
94 | 93 | ||
@@ -96,5 +95,5 @@ static long coda_pioctl(struct file *filp, unsigned int cmd, | |||
96 | 95 | ||
97 | out: | 96 | out: |
98 | unlock_kernel(); | 97 | unlock_kernel(); |
99 | return error; | 98 | return error; |
100 | } | 99 | } |