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>

+1 -21
-4
fs/qnx4/dir.c
··· 11 11 * 20-06-1998 by Frank Denis : Linux 2.1.99+ & dcache support. 12 12 */ 13 13 14 - #include <linux/smp_lock.h> 15 14 #include <linux/buffer_head.h> 16 15 #include "qnx4.h" 17 16 ··· 27 28 28 29 QNX4DEBUG((KERN_INFO "qnx4_readdir:i_size = %ld\n", (long) inode->i_size)); 29 30 QNX4DEBUG((KERN_INFO "filp->f_pos = %ld\n", (long) filp->f_pos)); 30 - 31 - lock_kernel(); 32 31 33 32 while (filp->f_pos < inode->i_size) { 34 33 blknum = qnx4_block_map( inode, filp->f_pos >> QNX4_BLOCK_SIZE_BITS ); ··· 68 71 brelse(bh); 69 72 } 70 73 out: 71 - unlock_kernel(); 72 74 return 0; 73 75 } 74 76
+1 -13
fs/qnx4/inode.c
··· 16 16 #include <linux/init.h> 17 17 #include <linux/slab.h> 18 18 #include <linux/highuid.h> 19 - #include <linux/smp_lock.h> 20 19 #include <linux/pagemap.h> 21 20 #include <linux/buffer_head.h> 22 21 #include <linux/writeback.h> ··· 156 157 struct super_block *sb = dentry->d_sb; 157 158 u64 id = huge_encode_dev(sb->s_bdev->bd_dev); 158 159 159 - lock_kernel(); 160 - 161 160 buf->f_type = sb->s_magic; 162 161 buf->f_bsize = sb->s_blocksize; 163 162 buf->f_blocks = le32_to_cpu(qnx4_sb(sb)->BitMap->di_size) * 8; ··· 164 167 buf->f_namelen = QNX4_NAME_MAX; 165 168 buf->f_fsid.val[0] = (u32)id; 166 169 buf->f_fsid.val[1] = (u32)(id >> 32); 167 - 168 - unlock_kernel(); 169 170 170 171 return 0; 171 172 } ··· 229 234 struct qnx4_sb_info *qs; 230 235 int ret = -EINVAL; 231 236 232 - lock_kernel(); 233 - 234 237 qs = kzalloc(sizeof(struct qnx4_sb_info), GFP_KERNEL); 235 - if (!qs) { 236 - unlock_kernel(); 238 + if (!qs) 237 239 return -ENOMEM; 238 - } 239 240 s->s_fs_info = qs; 240 241 241 242 sb_set_blocksize(s, QNX4_BLOCK_SIZE); ··· 278 287 goto outi; 279 288 280 289 brelse(bh); 281 - 282 - unlock_kernel(); 283 290 return 0; 284 291 285 292 outi: ··· 287 298 outnobh: 288 299 kfree(qs); 289 300 s->s_fs_info = NULL; 290 - unlock_kernel(); 291 301 return ret; 292 302 } 293 303
-4
fs/qnx4/namei.c
··· 12 12 * 04-07-1998 by Frank Denis : first step for rmdir/unlink. 13 13 */ 14 14 15 - #include <linux/smp_lock.h> 16 15 #include <linux/buffer_head.h> 17 16 #include "qnx4.h" 18 17 ··· 108 109 int len = dentry->d_name.len; 109 110 struct inode *foundinode = NULL; 110 111 111 - lock_kernel(); 112 112 if (!(bh = qnx4_find_entry(len, dir, name, &de, &ino))) 113 113 goto out; 114 114 /* The entry is linked, let's get the real info */ ··· 121 123 122 124 foundinode = qnx4_iget(dir->i_sb, ino); 123 125 if (IS_ERR(foundinode)) { 124 - unlock_kernel(); 125 126 QNX4DEBUG((KERN_ERR "qnx4: lookup->iget -> error %ld\n", 126 127 PTR_ERR(foundinode))); 127 128 return ERR_CAST(foundinode); 128 129 } 129 130 out: 130 - unlock_kernel(); 131 131 d_add(dentry, foundinode); 132 132 133 133 return NULL;