Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

get rid of BKL in fs/efs

Only readdir() really needed it, and that's easily fixable by switch to
generic_file_llseek()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro e7ec952f 536c9490

+3 -18
+1 -4
fs/efs/dir.c
··· 5 5 */ 6 6 7 7 #include <linux/buffer_head.h> 8 - #include <linux/smp_lock.h> 9 8 #include "efs.h" 10 9 11 10 static int efs_readdir(struct file *, void *, filldir_t); 12 11 13 12 const struct file_operations efs_dir_operations = { 13 + .llseek = generic_file_llseek, 14 14 .read = generic_read_dir, 15 15 .readdir = efs_readdir, 16 16 }; ··· 32 32 33 33 if (inode->i_size & (EFS_DIRBSIZE-1)) 34 34 printk(KERN_WARNING "EFS: WARNING: readdir(): directory size not a multiple of EFS_DIRBSIZE\n"); 35 - 36 - lock_kernel(); 37 35 38 36 /* work out where this entry can be found */ 39 37 block = filp->f_pos >> EFS_DIRBSIZE_BITS; ··· 105 107 106 108 filp->f_pos = (block << EFS_DIRBSIZE_BITS) | slot; 107 109 out: 108 - unlock_kernel(); 109 110 return 0; 110 111 } 111 112
+1 -8
fs/efs/namei.c
··· 8 8 9 9 #include <linux/buffer_head.h> 10 10 #include <linux/string.h> 11 - #include <linux/smp_lock.h> 12 11 #include <linux/exportfs.h> 13 12 #include "efs.h" 14 13 ··· 62 63 efs_ino_t inodenum; 63 64 struct inode * inode = NULL; 64 65 65 - lock_kernel(); 66 66 inodenum = efs_find_entry(dir, dentry->d_name.name, dentry->d_name.len); 67 67 if (inodenum) { 68 68 inode = efs_iget(dir->i_sb, inodenum); 69 - if (IS_ERR(inode)) { 70 - unlock_kernel(); 69 + if (IS_ERR(inode)) 71 70 return ERR_CAST(inode); 72 - } 73 71 } 74 - unlock_kernel(); 75 72 76 73 return d_splice_alias(inode, dentry); 77 74 } ··· 110 115 struct dentry *parent = ERR_PTR(-ENOENT); 111 116 efs_ino_t ino; 112 117 113 - lock_kernel(); 114 118 ino = efs_find_entry(child->d_inode, "..", 2); 115 119 if (ino) 116 120 parent = d_obtain_alias(efs_iget(child->d_inode->i_sb, ino)); 117 - unlock_kernel(); 118 121 119 122 return parent; 120 123 }
+1 -6
fs/efs/symlink.c
··· 9 9 #include <linux/string.h> 10 10 #include <linux/pagemap.h> 11 11 #include <linux/buffer_head.h> 12 - #include <linux/smp_lock.h> 13 12 #include "efs.h" 14 13 15 14 static int efs_symlink_readpage(struct file *file, struct page *page) ··· 21 22 22 23 err = -ENAMETOOLONG; 23 24 if (size > 2 * EFS_BLOCKSIZE) 24 - goto fail_notlocked; 25 + goto fail; 25 26 26 - lock_kernel(); 27 27 /* read first 512 bytes of link target */ 28 28 err = -EIO; 29 29 bh = sb_bread(inode->i_sb, efs_bmap(inode, 0)); ··· 38 40 brelse(bh); 39 41 } 40 42 link[size] = '\0'; 41 - unlock_kernel(); 42 43 SetPageUptodate(page); 43 44 kunmap(page); 44 45 unlock_page(page); 45 46 return 0; 46 47 fail: 47 - unlock_kernel(); 48 - fail_notlocked: 49 48 SetPageError(page); 50 49 kunmap(page); 51 50 unlock_page(page);