Skip to content

Commit d769b3c

Browse files
jankaraAl Viro
authored and
Al Viro
committed
isofs: Remove global fs lock
sbi->s_mutex isn't needed for isofs at all so we can just remove it. Generally, since isofs is always mounted read-only, filesystem structure cannot change under us. So buffer_head contents stays constant after it's filled in. That leaves us with possible changes of global data structures. Superblock changes only during filesystem mount (even remount does not change it), inodes are only filled in during reading from disk. So there are no changes of these structures to bother about. Arguments why sbi->s_mutex can be removed at each place: isofs_readdir: Accesses sb, inode, filp, local variables => s_mutex not needed isofs_lookup: Protected by directory's i_mutex. Accesses sb, inode, dentry, local variables => s_mutex not needed rock_ridge_symlink_readpage: Protected by page lock. Accesses sb, inode, local variables => s_mutex not needed. Signed-off-by: Jan Kara <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent 22ba747 commit d769b3c

File tree

5 files changed

+0
-12
lines changed

5 files changed

+0
-12
lines changed

fs/isofs/dir.c

-3
Original file line numberDiff line numberDiff line change
@@ -254,19 +254,16 @@ static int isofs_readdir(struct file *filp,
254254
char *tmpname;
255255
struct iso_directory_record *tmpde;
256256
struct inode *inode = filp->f_path.dentry->d_inode;
257-
struct isofs_sb_info *sbi = ISOFS_SB(inode->i_sb);
258257

259258
tmpname = (char *)__get_free_page(GFP_KERNEL);
260259
if (tmpname == NULL)
261260
return -ENOMEM;
262261

263-
mutex_lock(&sbi->s_mutex);
264262
tmpde = (struct iso_directory_record *) (tmpname+1024);
265263

266264
result = do_isofs_readdir(inode, filp, dirent, filldir, tmpname, tmpde);
267265

268266
free_page((unsigned long) tmpname);
269-
mutex_unlock(&sbi->s_mutex);
270267
return result;
271268
}
272269

fs/isofs/inode.c

-1
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,6 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
863863
sbi->s_utf8 = opt.utf8;
864864
sbi->s_nocompress = opt.nocompress;
865865
sbi->s_overriderockperm = opt.overriderockperm;
866-
mutex_init(&sbi->s_mutex);
867866
/*
868867
* It would be incredibly stupid to allow people to mark every file
869868
* on the disk as suid, so we merely allow them to set the default

fs/isofs/isofs.h

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ struct isofs_sb_info {
5555
gid_t s_gid;
5656
uid_t s_uid;
5757
struct nls_table *s_nls_iocharset; /* Native language support table */
58-
struct mutex s_mutex; /* replaces BKL, please remove if possible */
5958
};
6059

6160
#define ISOFS_INVALID_MODE ((mode_t) -1)

fs/isofs/namei.c

-4
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,13 @@ struct dentry *isofs_lookup(struct inode *dir, struct dentry *dentry, struct nam
168168
int found;
169169
unsigned long uninitialized_var(block);
170170
unsigned long uninitialized_var(offset);
171-
struct isofs_sb_info *sbi = ISOFS_SB(dir->i_sb);
172171
struct inode *inode;
173172
struct page *page;
174173

175174
page = alloc_page(GFP_USER);
176175
if (!page)
177176
return ERR_PTR(-ENOMEM);
178177

179-
mutex_lock(&sbi->s_mutex);
180178
found = isofs_find_entry(dir, dentry,
181179
&block, &offset,
182180
page_address(page),
@@ -185,7 +183,5 @@ struct dentry *isofs_lookup(struct inode *dir, struct dentry *dentry, struct nam
185183

186184
inode = found ? isofs_iget(dir->i_sb, block, offset) : NULL;
187185

188-
mutex_unlock(&sbi->s_mutex);
189-
190186
return d_splice_alias(inode, dentry);
191187
}

fs/isofs/rock.c

-3
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,6 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page)
678678

679679
init_rock_state(&rs, inode);
680680
block = ei->i_iget5_block;
681-
mutex_lock(&sbi->s_mutex);
682681
bh = sb_bread(inode->i_sb, block);
683682
if (!bh)
684683
goto out_noread;
@@ -748,7 +747,6 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page)
748747
goto fail;
749748
brelse(bh);
750749
*rpnt = '\0';
751-
mutex_unlock(&sbi->s_mutex);
752750
SetPageUptodate(page);
753751
kunmap(page);
754752
unlock_page(page);
@@ -765,7 +763,6 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page)
765763
printk("symlink spans iso9660 blocks\n");
766764
fail:
767765
brelse(bh);
768-
mutex_unlock(&sbi->s_mutex);
769766
error:
770767
SetPageError(page);
771768
kunmap(page);

0 commit comments

Comments
 (0)