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