BKL: remove BKL from freevxfs

All uses of the BKL in freevxfs 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>
Cc: Christoph Hellwig <hch@infradead.org>

+2 -22
+2 -12
fs/freevxfs/vxfs_lookup.c
··· 36 36 #include <linux/highmem.h> 37 37 #include <linux/kernel.h> 38 38 #include <linux/pagemap.h> 39 - #include <linux/smp_lock.h> 40 39 41 40 #include "vxfs.h" 42 41 #include "vxfs_dir.h" ··· 211 212 if (dp->d_name.len > VXFS_NAMELEN) 212 213 return ERR_PTR(-ENAMETOOLONG); 213 214 214 - lock_kernel(); 215 215 ino = vxfs_inode_by_name(dip, dp); 216 216 if (ino) { 217 217 ip = vxfs_iget(dip->i_sb, ino); 218 - if (IS_ERR(ip)) { 219 - unlock_kernel(); 218 + if (IS_ERR(ip)) 220 219 return ERR_CAST(ip); 221 - } 222 220 } 223 - unlock_kernel(); 224 221 d_add(dp, ip); 225 222 return NULL; 226 223 } ··· 243 248 u_long page, npages, block, pblocks, nblocks, offset; 244 249 loff_t pos; 245 250 246 - lock_kernel(); 247 - 248 251 switch ((long)fp->f_pos) { 249 252 case 0: 250 253 if (filler(retp, ".", 1, fp->f_pos, ip->i_ino, DT_DIR) < 0) ··· 258 265 259 266 pos = fp->f_pos - 2; 260 267 261 - if (pos > VXFS_DIRROUND(ip->i_size)) { 262 - unlock_kernel(); 268 + if (pos > VXFS_DIRROUND(ip->i_size)) 263 269 return 0; 264 - } 265 270 266 271 npages = dir_pages(ip); 267 272 nblocks = dir_blocks(ip); ··· 318 327 done: 319 328 fp->f_pos = ((page << PAGE_CACHE_SHIFT) | offset) + 2; 320 329 out: 321 - unlock_kernel(); 322 330 return 0; 323 331 }
-10
fs/freevxfs/vxfs_super.c
··· 38 38 #include <linux/buffer_head.h> 39 39 #include <linux/kernel.h> 40 40 #include <linux/slab.h> 41 - #include <linux/smp_lock.h> 42 41 #include <linux/stat.h> 43 42 #include <linux/vfs.h> 44 43 #include <linux/mount.h> ··· 80 81 { 81 82 struct vxfs_sb_info *infp = VXFS_SBI(sbp); 82 83 83 - lock_kernel(); 84 - 85 84 vxfs_put_fake_inode(infp->vsi_fship); 86 85 vxfs_put_fake_inode(infp->vsi_ilist); 87 86 vxfs_put_fake_inode(infp->vsi_stilist); 88 87 89 88 brelse(infp->vsi_bp); 90 89 kfree(infp); 91 - 92 - unlock_kernel(); 93 90 } 94 91 95 92 /** ··· 154 159 struct inode *root; 155 160 int ret = -EINVAL; 156 161 157 - lock_kernel(); 158 - 159 162 sbp->s_flags |= MS_RDONLY; 160 163 161 164 infp = kzalloc(sizeof(*infp), GFP_KERNEL); 162 165 if (!infp) { 163 166 printk(KERN_WARNING "vxfs: unable to allocate incore superblock\n"); 164 - unlock_kernel(); 165 167 return -ENOMEM; 166 168 } 167 169 ··· 231 239 goto out_free_ilist; 232 240 } 233 241 234 - unlock_kernel(); 235 242 return 0; 236 243 237 244 out_free_ilist: ··· 240 249 out: 241 250 brelse(bp); 242 251 kfree(infp); 243 - unlock_kernel(); 244 252 return ret; 245 253 } 246 254