aboutsummaryrefslogtreecommitdiffstats
path: root/fs/coda/cnode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/coda/cnode.c')
-rw-r--r--fs/coda/cnode.c38
1 files changed, 16 insertions, 22 deletions
diff --git a/fs/coda/cnode.c b/fs/coda/cnode.c
index 6475877b0763..911cf30d057d 100644
--- a/fs/coda/cnode.c
+++ b/fs/coda/cnode.c
@@ -88,24 +88,21 @@ struct inode * coda_iget(struct super_block * sb, struct CodaFid * fid,
88 - link the two up if this is needed 88 - link the two up if this is needed
89 - fill in the attributes 89 - fill in the attributes
90*/ 90*/
91int coda_cnode_make(struct inode **inode, struct CodaFid *fid, struct super_block *sb) 91struct inode *coda_cnode_make(struct CodaFid *fid, struct super_block *sb)
92{ 92{
93 struct coda_vattr attr; 93 struct coda_vattr attr;
94 struct inode *inode;
94 int error; 95 int error;
95 96
96 /* We get inode numbers from Venus -- see venus source */ 97 /* We get inode numbers from Venus -- see venus source */
97 error = venus_getattr(sb, fid, &attr); 98 error = venus_getattr(sb, fid, &attr);
98 if ( error ) { 99 if (error)
99 *inode = NULL; 100 return ERR_PTR(error);
100 return error;
101 }
102 101
103 *inode = coda_iget(sb, fid, &attr); 102 inode = coda_iget(sb, fid, &attr);
104 if ( IS_ERR(*inode) ) { 103 if (IS_ERR(inode))
105 printk("coda_cnode_make: coda_iget failed\n"); 104 printk("coda_cnode_make: coda_iget failed\n");
106 return PTR_ERR(*inode); 105 return inode;
107 }
108 return 0;
109} 106}
110 107
111 108
@@ -156,19 +153,16 @@ struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb)
156} 153}
157 154
158/* the CONTROL inode is made without asking attributes from Venus */ 155/* the CONTROL inode is made without asking attributes from Venus */
159int coda_cnode_makectl(struct inode **inode, struct super_block *sb) 156struct inode *coda_cnode_makectl(struct super_block *sb)
160{ 157{
161 int error = -ENOMEM; 158 struct inode *inode = new_inode(sb);
162 159 if (inode) {
163 *inode = new_inode(sb); 160 inode->i_ino = CTL_INO;
164 if (*inode) { 161 inode->i_op = &coda_ioctl_inode_operations;
165 (*inode)->i_ino = CTL_INO; 162 inode->i_fop = &coda_ioctl_operations;
166 (*inode)->i_op = &coda_ioctl_inode_operations; 163 inode->i_mode = 0444;
167 (*inode)->i_fop = &coda_ioctl_operations; 164 return inode;
168 (*inode)->i_mode = 0444;
169 error = 0;
170 } 165 }
171 166 return ERR_PTR(-ENOMEM);
172 return error;
173} 167}
174 168