aboutsummaryrefslogtreecommitdiffstats
path: root/fs/coda/inode.c
diff options
context:
space:
mode:
authorYoshihisa Abe <yoshiabe@cs.cmu.edu>2010-10-25 02:03:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-25 11:02:40 -0400
commitf7cc02b8715618e179242ba9cc10bdc5146ae565 (patch)
tree80c1bcf6923c9982a52fbe510cb7d396fb9866fc /fs/coda/inode.c
parentb5ce1d83a62fc109d8e815b1fc71dcdb0d26bc49 (diff)
Coda: push BKL regions into coda_upcall()
Now that shared inode state is locked using the cii->c_lock, the BKL is only used to protect the upcall queues used to communicate with the userspace cache manager. The remaining state is all local and we can push the lock further down into coda_upcall(). Signed-off-by: Yoshihisa Abe <yoshiabe@cs.cmu.edu> Signed-off-by: Jan Harkes <jaharkes@cs.cmu.edu> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/coda/inode.c')
-rw-r--r--fs/coda/inode.c46
1 files changed, 20 insertions, 26 deletions
diff --git a/fs/coda/inode.c b/fs/coda/inode.c
index 0553f3bd7b1b..b7fa3e3d772f 100644
--- a/fs/coda/inode.c
+++ b/fs/coda/inode.c
@@ -150,8 +150,6 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
150 int error; 150 int error;
151 int idx; 151 int idx;
152 152
153 lock_kernel();
154
155 idx = get_device_index((struct coda_mount_data *) data); 153 idx = get_device_index((struct coda_mount_data *) data);
156 154
157 /* Ignore errors in data, for backward compatibility */ 155 /* Ignore errors in data, for backward compatibility */
@@ -161,23 +159,26 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
161 printk(KERN_INFO "coda_read_super: device index: %i\n", idx); 159 printk(KERN_INFO "coda_read_super: device index: %i\n", idx);
162 160
163 vc = &coda_comms[idx]; 161 vc = &coda_comms[idx];
162 lock_kernel();
163
164 if (!vc->vc_inuse) { 164 if (!vc->vc_inuse) {
165 printk("coda_read_super: No pseudo device\n"); 165 printk("coda_read_super: No pseudo device\n");
166 unlock_kernel(); 166 error = -EINVAL;
167 return -EINVAL; 167 goto unlock_out;
168 } 168 }
169 169
170 if ( vc->vc_sb ) { 170 if (vc->vc_sb) {
171 printk("coda_read_super: Device already mounted\n"); 171 printk("coda_read_super: Device already mounted\n");
172 unlock_kernel(); 172 error = -EBUSY;
173 return -EBUSY; 173 goto unlock_out;
174 } 174 }
175 175
176 error = bdi_setup_and_register(&vc->bdi, "coda", BDI_CAP_MAP_COPY); 176 error = bdi_setup_and_register(&vc->bdi, "coda", BDI_CAP_MAP_COPY);
177 if (error) 177 if (error)
178 goto bdi_err; 178 goto unlock_out;
179 179
180 vc->vc_sb = sb; 180 vc->vc_sb = sb;
181 unlock_kernel();
181 182
182 sb->s_fs_info = vc; 183 sb->s_fs_info = vc;
183 sb->s_flags |= MS_NOATIME; 184 sb->s_flags |= MS_NOATIME;
@@ -206,21 +207,23 @@ static int coda_fill_super(struct super_block *sb, void *data, int silent)
206 printk("coda_read_super: rootinode is %ld dev %s\n", 207 printk("coda_read_super: rootinode is %ld dev %s\n",
207 root->i_ino, root->i_sb->s_id); 208 root->i_ino, root->i_sb->s_id);
208 sb->s_root = d_alloc_root(root); 209 sb->s_root = d_alloc_root(root);
209 if (!sb->s_root) 210 if (!sb->s_root) {
211 error = -EINVAL;
210 goto error; 212 goto error;
211 unlock_kernel(); 213 }
212 return 0; 214 return 0;
213 215
214 error: 216error:
215 bdi_destroy(&vc->bdi);
216 bdi_err:
217 if (root) 217 if (root)
218 iput(root); 218 iput(root);
219 if (vc)
220 vc->vc_sb = NULL;
221 219
220 lock_kernel();
221 bdi_destroy(&vc->bdi);
222 vc->vc_sb = NULL;
223 sb->s_fs_info = NULL;
224unlock_out:
222 unlock_kernel(); 225 unlock_kernel();
223 return -EINVAL; 226 return error;
224} 227}
225 228
226static void coda_put_super(struct super_block *sb) 229static void coda_put_super(struct super_block *sb)
@@ -253,8 +256,6 @@ int coda_setattr(struct dentry *de, struct iattr *iattr)
253 struct coda_vattr vattr; 256 struct coda_vattr vattr;
254 int error; 257 int error;
255 258
256 lock_kernel();
257
258 memset(&vattr, 0, sizeof(vattr)); 259 memset(&vattr, 0, sizeof(vattr));
259 260
260 inode->i_ctime = CURRENT_TIME_SEC; 261 inode->i_ctime = CURRENT_TIME_SEC;
@@ -264,13 +265,10 @@ int coda_setattr(struct dentry *de, struct iattr *iattr)
264 /* Venus is responsible for truncating the container-file!!! */ 265 /* Venus is responsible for truncating the container-file!!! */
265 error = venus_setattr(inode->i_sb, coda_i2f(inode), &vattr); 266 error = venus_setattr(inode->i_sb, coda_i2f(inode), &vattr);
266 267
267 if ( !error ) { 268 if (!error) {
268 coda_vattr_to_iattr(inode, &vattr); 269 coda_vattr_to_iattr(inode, &vattr);
269 coda_cache_clear_inode(inode); 270 coda_cache_clear_inode(inode);
270 } 271 }
271
272 unlock_kernel();
273
274 return error; 272 return error;
275} 273}
276 274
@@ -284,12 +282,8 @@ static int coda_statfs(struct dentry *dentry, struct kstatfs *buf)
284{ 282{
285 int error; 283 int error;
286 284
287 lock_kernel();
288
289 error = venus_statfs(dentry, buf); 285 error = venus_statfs(dentry, buf);
290 286
291 unlock_kernel();
292
293 if (error) { 287 if (error) {
294 /* fake something like AFS does */ 288 /* fake something like AFS does */
295 buf->f_blocks = 9000000; 289 buf->f_blocks = 9000000;