diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-16 23:35:46 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-17 00:36:36 -0400 |
commit | e7ec952f6aa6ac1649ac49eb5e4de5b92c829d1e (patch) | |
tree | cfe58a2f9b82ab94bd5ddbbaefb38b4790bdc65c /fs | |
parent | 536c94901eb8f2eb6fccf81ae6be814899a9f6e8 (diff) |
get rid of BKL in fs/efs
Only readdir() really needed it, and that's easily fixable by switch to
generic_file_llseek()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/efs/dir.c | 5 | ||||
-rw-r--r-- | fs/efs/namei.c | 9 | ||||
-rw-r--r-- | fs/efs/symlink.c | 7 |
3 files changed, 3 insertions, 18 deletions
diff --git a/fs/efs/dir.c b/fs/efs/dir.c index 49308a29798a..7ee6f7e3a608 100644 --- a/fs/efs/dir.c +++ b/fs/efs/dir.c | |||
@@ -5,12 +5,12 @@ | |||
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include <linux/buffer_head.h> | 7 | #include <linux/buffer_head.h> |
8 | #include <linux/smp_lock.h> | ||
9 | #include "efs.h" | 8 | #include "efs.h" |
10 | 9 | ||
11 | static int efs_readdir(struct file *, void *, filldir_t); | 10 | static int efs_readdir(struct file *, void *, filldir_t); |
12 | 11 | ||
13 | const struct file_operations efs_dir_operations = { | 12 | const struct file_operations efs_dir_operations = { |
13 | .llseek = generic_file_llseek, | ||
14 | .read = generic_read_dir, | 14 | .read = generic_read_dir, |
15 | .readdir = efs_readdir, | 15 | .readdir = efs_readdir, |
16 | }; | 16 | }; |
@@ -33,8 +33,6 @@ static int efs_readdir(struct file *filp, void *dirent, filldir_t filldir) { | |||
33 | if (inode->i_size & (EFS_DIRBSIZE-1)) | 33 | if (inode->i_size & (EFS_DIRBSIZE-1)) |
34 | printk(KERN_WARNING "EFS: WARNING: readdir(): directory size not a multiple of EFS_DIRBSIZE\n"); | 34 | printk(KERN_WARNING "EFS: WARNING: readdir(): directory size not a multiple of EFS_DIRBSIZE\n"); |
35 | 35 | ||
36 | lock_kernel(); | ||
37 | |||
38 | /* work out where this entry can be found */ | 36 | /* work out where this entry can be found */ |
39 | block = filp->f_pos >> EFS_DIRBSIZE_BITS; | 37 | block = filp->f_pos >> EFS_DIRBSIZE_BITS; |
40 | 38 | ||
@@ -107,7 +105,6 @@ static int efs_readdir(struct file *filp, void *dirent, filldir_t filldir) { | |||
107 | 105 | ||
108 | filp->f_pos = (block << EFS_DIRBSIZE_BITS) | slot; | 106 | filp->f_pos = (block << EFS_DIRBSIZE_BITS) | slot; |
109 | out: | 107 | out: |
110 | unlock_kernel(); | ||
111 | return 0; | 108 | return 0; |
112 | } | 109 | } |
113 | 110 | ||
diff --git a/fs/efs/namei.c b/fs/efs/namei.c index c3fb5f9c4a44..1511bf9e5f80 100644 --- a/fs/efs/namei.c +++ b/fs/efs/namei.c | |||
@@ -8,7 +8,6 @@ | |||
8 | 8 | ||
9 | #include <linux/buffer_head.h> | 9 | #include <linux/buffer_head.h> |
10 | #include <linux/string.h> | 10 | #include <linux/string.h> |
11 | #include <linux/smp_lock.h> | ||
12 | #include <linux/exportfs.h> | 11 | #include <linux/exportfs.h> |
13 | #include "efs.h" | 12 | #include "efs.h" |
14 | 13 | ||
@@ -63,16 +62,12 @@ struct dentry *efs_lookup(struct inode *dir, struct dentry *dentry, struct namei | |||
63 | efs_ino_t inodenum; | 62 | efs_ino_t inodenum; |
64 | struct inode * inode = NULL; | 63 | struct inode * inode = NULL; |
65 | 64 | ||
66 | lock_kernel(); | ||
67 | inodenum = efs_find_entry(dir, dentry->d_name.name, dentry->d_name.len); | 65 | inodenum = efs_find_entry(dir, dentry->d_name.name, dentry->d_name.len); |
68 | if (inodenum) { | 66 | if (inodenum) { |
69 | inode = efs_iget(dir->i_sb, inodenum); | 67 | inode = efs_iget(dir->i_sb, inodenum); |
70 | if (IS_ERR(inode)) { | 68 | if (IS_ERR(inode)) |
71 | unlock_kernel(); | ||
72 | return ERR_CAST(inode); | 69 | return ERR_CAST(inode); |
73 | } | ||
74 | } | 70 | } |
75 | unlock_kernel(); | ||
76 | 71 | ||
77 | return d_splice_alias(inode, dentry); | 72 | return d_splice_alias(inode, dentry); |
78 | } | 73 | } |
@@ -115,11 +110,9 @@ struct dentry *efs_get_parent(struct dentry *child) | |||
115 | struct dentry *parent = ERR_PTR(-ENOENT); | 110 | struct dentry *parent = ERR_PTR(-ENOENT); |
116 | efs_ino_t ino; | 111 | efs_ino_t ino; |
117 | 112 | ||
118 | lock_kernel(); | ||
119 | ino = efs_find_entry(child->d_inode, "..", 2); | 113 | ino = efs_find_entry(child->d_inode, "..", 2); |
120 | if (ino) | 114 | if (ino) |
121 | parent = d_obtain_alias(efs_iget(child->d_inode->i_sb, ino)); | 115 | parent = d_obtain_alias(efs_iget(child->d_inode->i_sb, ino)); |
122 | unlock_kernel(); | ||
123 | 116 | ||
124 | return parent; | 117 | return parent; |
125 | } | 118 | } |
diff --git a/fs/efs/symlink.c b/fs/efs/symlink.c index 41911ec83aaf..75117d0dac2b 100644 --- a/fs/efs/symlink.c +++ b/fs/efs/symlink.c | |||
@@ -9,7 +9,6 @@ | |||
9 | #include <linux/string.h> | 9 | #include <linux/string.h> |
10 | #include <linux/pagemap.h> | 10 | #include <linux/pagemap.h> |
11 | #include <linux/buffer_head.h> | 11 | #include <linux/buffer_head.h> |
12 | #include <linux/smp_lock.h> | ||
13 | #include "efs.h" | 12 | #include "efs.h" |
14 | 13 | ||
15 | static int efs_symlink_readpage(struct file *file, struct page *page) | 14 | static int efs_symlink_readpage(struct file *file, struct page *page) |
@@ -22,9 +21,8 @@ static int efs_symlink_readpage(struct file *file, struct page *page) | |||
22 | 21 | ||
23 | err = -ENAMETOOLONG; | 22 | err = -ENAMETOOLONG; |
24 | if (size > 2 * EFS_BLOCKSIZE) | 23 | if (size > 2 * EFS_BLOCKSIZE) |
25 | goto fail_notlocked; | 24 | goto fail; |
26 | 25 | ||
27 | lock_kernel(); | ||
28 | /* read first 512 bytes of link target */ | 26 | /* read first 512 bytes of link target */ |
29 | err = -EIO; | 27 | err = -EIO; |
30 | bh = sb_bread(inode->i_sb, efs_bmap(inode, 0)); | 28 | bh = sb_bread(inode->i_sb, efs_bmap(inode, 0)); |
@@ -40,14 +38,11 @@ static int efs_symlink_readpage(struct file *file, struct page *page) | |||
40 | brelse(bh); | 38 | brelse(bh); |
41 | } | 39 | } |
42 | link[size] = '\0'; | 40 | link[size] = '\0'; |
43 | unlock_kernel(); | ||
44 | SetPageUptodate(page); | 41 | SetPageUptodate(page); |
45 | kunmap(page); | 42 | kunmap(page); |
46 | unlock_page(page); | 43 | unlock_page(page); |
47 | return 0; | 44 | return 0; |
48 | fail: | 45 | fail: |
49 | unlock_kernel(); | ||
50 | fail_notlocked: | ||
51 | SetPageError(page); | 46 | SetPageError(page); |
52 | kunmap(page); | 47 | kunmap(page); |
53 | unlock_page(page); | 48 | unlock_page(page); |