Commit 4688a066ecf60086ea82f68edb3b036b567d2c08
1 parent
f5412be599
Exists in
master
and in
4 other branches
adfs: remove the big kernel lock
According to Russell King, adfs was written to not require the big kernel lock, and all inode updates are done under adfs_dir_lock. All other metadata in adfs is read-only and does not require locking. The use of the BKL is the result of various pushdowns from the VFS operations. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Russell King <rmk@arm.linux.org.uk> Cc: Stuart Swales <stuart.swales.croftnuisk@gmail.com>
Showing 4 changed files with 1 additions and 25 deletions Side-by-side Diff
fs/adfs/Kconfig
fs/adfs/dir.c
... | ... | @@ -9,7 +9,6 @@ |
9 | 9 | * |
10 | 10 | * Common directory handling for ADFS |
11 | 11 | */ |
12 | -#include <linux/smp_lock.h> | |
13 | 12 | #include "adfs.h" |
14 | 13 | |
15 | 14 | /* |
... | ... | @@ -27,8 +26,6 @@ |
27 | 26 | struct adfs_dir dir; |
28 | 27 | int ret = 0; |
29 | 28 | |
30 | - lock_kernel(); | |
31 | - | |
32 | 29 | if (filp->f_pos >> 32) |
33 | 30 | goto out; |
34 | 31 | |
... | ... | @@ -70,7 +67,6 @@ |
70 | 67 | ops->free(&dir); |
71 | 68 | |
72 | 69 | out: |
73 | - unlock_kernel(); | |
74 | 70 | return ret; |
75 | 71 | } |
76 | 72 | |
... | ... | @@ -276,7 +272,6 @@ |
276 | 272 | struct object_info obj; |
277 | 273 | int error; |
278 | 274 | |
279 | - lock_kernel(); | |
280 | 275 | error = adfs_dir_lookup_byname(dir, &dentry->d_name, &obj); |
281 | 276 | if (error == 0) { |
282 | 277 | error = -EACCES; |
... | ... | @@ -288,7 +283,6 @@ |
288 | 283 | if (inode) |
289 | 284 | error = 0; |
290 | 285 | } |
291 | - unlock_kernel(); | |
292 | 286 | d_add(dentry, inode); |
293 | 287 | return ERR_PTR(error); |
294 | 288 | } |
fs/adfs/inode.c
... | ... | @@ -7,7 +7,6 @@ |
7 | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | 8 | * published by the Free Software Foundation. |
9 | 9 | */ |
10 | -#include <linux/smp_lock.h> | |
11 | 10 | #include <linux/buffer_head.h> |
12 | 11 | #include <linux/writeback.h> |
13 | 12 | #include "adfs.h" |
... | ... | @@ -316,8 +315,6 @@ |
316 | 315 | unsigned int ia_valid = attr->ia_valid; |
317 | 316 | int error; |
318 | 317 | |
319 | - lock_kernel(); | |
320 | - | |
321 | 318 | error = inode_change_ok(inode, attr); |
322 | 319 | |
323 | 320 | /* |
... | ... | @@ -359,7 +356,6 @@ |
359 | 356 | if (ia_valid & (ATTR_SIZE | ATTR_MTIME | ATTR_MODE)) |
360 | 357 | mark_inode_dirty(inode); |
361 | 358 | out: |
362 | - unlock_kernel(); | |
363 | 359 | return error; |
364 | 360 | } |
365 | 361 | |
... | ... | @@ -374,7 +370,6 @@ |
374 | 370 | struct object_info obj; |
375 | 371 | int ret; |
376 | 372 | |
377 | - lock_kernel(); | |
378 | 373 | obj.file_id = inode->i_ino; |
379 | 374 | obj.name_len = 0; |
380 | 375 | obj.parent_id = ADFS_I(inode)->parent_id; |
... | ... | @@ -384,7 +379,6 @@ |
384 | 379 | obj.size = inode->i_size; |
385 | 380 | |
386 | 381 | ret = adfs_dir_update(sb, &obj, wbc->sync_mode == WB_SYNC_ALL); |
387 | - unlock_kernel(); | |
388 | 382 | return ret; |
389 | 383 | } |
fs/adfs/super.c
... | ... | @@ -14,7 +14,6 @@ |
14 | 14 | #include <linux/mount.h> |
15 | 15 | #include <linux/seq_file.h> |
16 | 16 | #include <linux/slab.h> |
17 | -#include <linux/smp_lock.h> | |
18 | 17 | #include <linux/statfs.h> |
19 | 18 | #include "adfs.h" |
20 | 19 | #include "dir_f.h" |
21 | 20 | |
... | ... | @@ -120,15 +119,11 @@ |
120 | 119 | int i; |
121 | 120 | struct adfs_sb_info *asb = ADFS_SB(sb); |
122 | 121 | |
123 | - lock_kernel(); | |
124 | - | |
125 | 122 | for (i = 0; i < asb->s_map_size; i++) |
126 | 123 | brelse(asb->s_map[i].dm_bh); |
127 | 124 | kfree(asb->s_map); |
128 | 125 | kfree(asb); |
129 | 126 | sb->s_fs_info = NULL; |
130 | - | |
131 | - unlock_kernel(); | |
132 | 127 | } |
133 | 128 | |
134 | 129 | static int adfs_show_options(struct seq_file *seq, struct vfsmount *mnt) |
135 | 130 | |
136 | 131 | |
... | ... | @@ -359,15 +354,11 @@ |
359 | 354 | struct adfs_sb_info *asb; |
360 | 355 | struct inode *root; |
361 | 356 | |
362 | - lock_kernel(); | |
363 | - | |
364 | 357 | sb->s_flags |= MS_NODIRATIME; |
365 | 358 | |
366 | 359 | asb = kzalloc(sizeof(*asb), GFP_KERNEL); |
367 | - if (!asb) { | |
368 | - unlock_kernel(); | |
360 | + if (!asb) | |
369 | 361 | return -ENOMEM; |
370 | - } | |
371 | 362 | sb->s_fs_info = asb; |
372 | 363 | |
373 | 364 | /* set default options */ |
... | ... | @@ -485,7 +476,6 @@ |
485 | 476 | adfs_error(sb, "get root inode failed\n"); |
486 | 477 | goto error; |
487 | 478 | } |
488 | - unlock_kernel(); | |
489 | 479 | return 0; |
490 | 480 | |
491 | 481 | error_free_bh: |
... | ... | @@ -493,7 +483,6 @@ |
493 | 483 | error: |
494 | 484 | sb->s_fs_info = NULL; |
495 | 485 | kfree(asb); |
496 | - unlock_kernel(); | |
497 | 486 | return -EINVAL; |
498 | 487 | } |
499 | 488 |