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