diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2010-10-21 09:53:15 -0400 |
|---|---|---|
| committer | Arnd Bergmann <arnd@arndb.de> | 2010-10-21 12:48:04 -0400 |
| commit | 073c21416268658bd1bc573af85eeac2ebb56ed5 (patch) | |
| tree | 66553303809cc8c1ef7229058d8d5a5670bb301f | |
| parent | 5a44a73b9015e89cfb280ba0534dfcbf1ef29d05 (diff) | |
BKL: remove BKL from qnx4
All uses of the BKL in qnx4 were the result of a pushdown into
code that doesn't really need it. As Christoph points out, this
is a read-only file system, which eliminates most of the races in
readdir/lookup.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Anders Larsen <al@alarsen.net>
Cc: Christoph Hellwig <hch@infradead.org>
| -rw-r--r-- | fs/qnx4/dir.c | 4 | ||||
| -rw-r--r-- | fs/qnx4/inode.c | 14 | ||||
| -rw-r--r-- | fs/qnx4/namei.c | 4 |
3 files changed, 1 insertions, 21 deletions
diff --git a/fs/qnx4/dir.c b/fs/qnx4/dir.c index 6e8fc62b40a8..7b0329468a5d 100644 --- a/fs/qnx4/dir.c +++ b/fs/qnx4/dir.c | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | * 20-06-1998 by Frank Denis : Linux 2.1.99+ & dcache support. | 11 | * 20-06-1998 by Frank Denis : Linux 2.1.99+ & dcache support. |
| 12 | */ | 12 | */ |
| 13 | 13 | ||
| 14 | #include <linux/smp_lock.h> | ||
| 15 | #include <linux/buffer_head.h> | 14 | #include <linux/buffer_head.h> |
| 16 | #include "qnx4.h" | 15 | #include "qnx4.h" |
| 17 | 16 | ||
| @@ -29,8 +28,6 @@ static int qnx4_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
| 29 | QNX4DEBUG((KERN_INFO "qnx4_readdir:i_size = %ld\n", (long) inode->i_size)); | 28 | QNX4DEBUG((KERN_INFO "qnx4_readdir:i_size = %ld\n", (long) inode->i_size)); |
| 30 | QNX4DEBUG((KERN_INFO "filp->f_pos = %ld\n", (long) filp->f_pos)); | 29 | QNX4DEBUG((KERN_INFO "filp->f_pos = %ld\n", (long) filp->f_pos)); |
| 31 | 30 | ||
| 32 | lock_kernel(); | ||
| 33 | |||
| 34 | while (filp->f_pos < inode->i_size) { | 31 | while (filp->f_pos < inode->i_size) { |
| 35 | blknum = qnx4_block_map( inode, filp->f_pos >> QNX4_BLOCK_SIZE_BITS ); | 32 | blknum = qnx4_block_map( inode, filp->f_pos >> QNX4_BLOCK_SIZE_BITS ); |
| 36 | bh = sb_bread(inode->i_sb, blknum); | 33 | bh = sb_bread(inode->i_sb, blknum); |
| @@ -71,7 +68,6 @@ static int qnx4_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
| 71 | brelse(bh); | 68 | brelse(bh); |
| 72 | } | 69 | } |
| 73 | out: | 70 | out: |
| 74 | unlock_kernel(); | ||
| 75 | return 0; | 71 | return 0; |
| 76 | } | 72 | } |
| 77 | 73 | ||
diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c index 86a7be1399a8..01bad30026fc 100644 --- a/fs/qnx4/inode.c +++ b/fs/qnx4/inode.c | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
| 17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
| 18 | #include <linux/highuid.h> | 18 | #include <linux/highuid.h> |
| 19 | #include <linux/smp_lock.h> | ||
| 20 | #include <linux/pagemap.h> | 19 | #include <linux/pagemap.h> |
| 21 | #include <linux/buffer_head.h> | 20 | #include <linux/buffer_head.h> |
| 22 | #include <linux/writeback.h> | 21 | #include <linux/writeback.h> |
| @@ -157,8 +156,6 @@ static int qnx4_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
| 157 | struct super_block *sb = dentry->d_sb; | 156 | struct super_block *sb = dentry->d_sb; |
| 158 | u64 id = huge_encode_dev(sb->s_bdev->bd_dev); | 157 | u64 id = huge_encode_dev(sb->s_bdev->bd_dev); |
| 159 | 158 | ||
| 160 | lock_kernel(); | ||
| 161 | |||
| 162 | buf->f_type = sb->s_magic; | 159 | buf->f_type = sb->s_magic; |
| 163 | buf->f_bsize = sb->s_blocksize; | 160 | buf->f_bsize = sb->s_blocksize; |
| 164 | buf->f_blocks = le32_to_cpu(qnx4_sb(sb)->BitMap->di_size) * 8; | 161 | buf->f_blocks = le32_to_cpu(qnx4_sb(sb)->BitMap->di_size) * 8; |
| @@ -168,8 +165,6 @@ static int qnx4_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
| 168 | buf->f_fsid.val[0] = (u32)id; | 165 | buf->f_fsid.val[0] = (u32)id; |
| 169 | buf->f_fsid.val[1] = (u32)(id >> 32); | 166 | buf->f_fsid.val[1] = (u32)(id >> 32); |
| 170 | 167 | ||
| 171 | unlock_kernel(); | ||
| 172 | |||
| 173 | return 0; | 168 | return 0; |
| 174 | } | 169 | } |
| 175 | 170 | ||
| @@ -234,13 +229,9 @@ static int qnx4_fill_super(struct super_block *s, void *data, int silent) | |||
| 234 | struct qnx4_sb_info *qs; | 229 | struct qnx4_sb_info *qs; |
| 235 | int ret = -EINVAL; | 230 | int ret = -EINVAL; |
| 236 | 231 | ||
| 237 | lock_kernel(); | ||
| 238 | |||
| 239 | qs = kzalloc(sizeof(struct qnx4_sb_info), GFP_KERNEL); | 232 | qs = kzalloc(sizeof(struct qnx4_sb_info), GFP_KERNEL); |
| 240 | if (!qs) { | 233 | if (!qs) |
| 241 | unlock_kernel(); | ||
| 242 | return -ENOMEM; | 234 | return -ENOMEM; |
| 243 | } | ||
| 244 | s->s_fs_info = qs; | 235 | s->s_fs_info = qs; |
| 245 | 236 | ||
| 246 | sb_set_blocksize(s, QNX4_BLOCK_SIZE); | 237 | sb_set_blocksize(s, QNX4_BLOCK_SIZE); |
| @@ -287,8 +278,6 @@ static int qnx4_fill_super(struct super_block *s, void *data, int silent) | |||
| 287 | goto outi; | 278 | goto outi; |
| 288 | 279 | ||
| 289 | brelse(bh); | 280 | brelse(bh); |
| 290 | |||
| 291 | unlock_kernel(); | ||
| 292 | return 0; | 281 | return 0; |
| 293 | 282 | ||
| 294 | outi: | 283 | outi: |
| @@ -298,7 +287,6 @@ static int qnx4_fill_super(struct super_block *s, void *data, int silent) | |||
| 298 | outnobh: | 287 | outnobh: |
| 299 | kfree(qs); | 288 | kfree(qs); |
| 300 | s->s_fs_info = NULL; | 289 | s->s_fs_info = NULL; |
| 301 | unlock_kernel(); | ||
| 302 | return ret; | 290 | return ret; |
| 303 | } | 291 | } |
| 304 | 292 | ||
diff --git a/fs/qnx4/namei.c b/fs/qnx4/namei.c index 58703ebba879..275327b5615e 100644 --- a/fs/qnx4/namei.c +++ b/fs/qnx4/namei.c | |||
| @@ -12,7 +12,6 @@ | |||
| 12 | * 04-07-1998 by Frank Denis : first step for rmdir/unlink. | 12 | * 04-07-1998 by Frank Denis : first step for rmdir/unlink. |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #include <linux/smp_lock.h> | ||
| 16 | #include <linux/buffer_head.h> | 15 | #include <linux/buffer_head.h> |
| 17 | #include "qnx4.h" | 16 | #include "qnx4.h" |
| 18 | 17 | ||
| @@ -109,7 +108,6 @@ struct dentry * qnx4_lookup(struct inode *dir, struct dentry *dentry, struct nam | |||
| 109 | int len = dentry->d_name.len; | 108 | int len = dentry->d_name.len; |
| 110 | struct inode *foundinode = NULL; | 109 | struct inode *foundinode = NULL; |
| 111 | 110 | ||
| 112 | lock_kernel(); | ||
| 113 | if (!(bh = qnx4_find_entry(len, dir, name, &de, &ino))) | 111 | if (!(bh = qnx4_find_entry(len, dir, name, &de, &ino))) |
| 114 | goto out; | 112 | goto out; |
| 115 | /* The entry is linked, let's get the real info */ | 113 | /* The entry is linked, let's get the real info */ |
| @@ -123,13 +121,11 @@ struct dentry * qnx4_lookup(struct inode *dir, struct dentry *dentry, struct nam | |||
| 123 | 121 | ||
| 124 | foundinode = qnx4_iget(dir->i_sb, ino); | 122 | foundinode = qnx4_iget(dir->i_sb, ino); |
| 125 | if (IS_ERR(foundinode)) { | 123 | if (IS_ERR(foundinode)) { |
| 126 | unlock_kernel(); | ||
| 127 | QNX4DEBUG((KERN_ERR "qnx4: lookup->iget -> error %ld\n", | 124 | QNX4DEBUG((KERN_ERR "qnx4: lookup->iget -> error %ld\n", |
| 128 | PTR_ERR(foundinode))); | 125 | PTR_ERR(foundinode))); |
| 129 | return ERR_CAST(foundinode); | 126 | return ERR_CAST(foundinode); |
| 130 | } | 127 | } |
| 131 | out: | 128 | out: |
| 132 | unlock_kernel(); | ||
| 133 | d_add(dentry, foundinode); | 129 | d_add(dentry, foundinode); |
| 134 | 130 | ||
| 135 | return NULL; | 131 | return NULL; |
