BFS: clean up the superblock usage
BFS is a very simple FS and its superblocks contains only static information and is never changed. However, the BFS code for some misterious reasons marked its buffer head as dirty from time to time, but nothing in that buffer was ever changed. This patch removes all the BFS superblock manipulation, simply because it is not needed. It removes: 1. The si_sbh filed from 'struct bfs_sb_info' because it is not needed. We only need to read the SB once on mount to get the start of data blocks and the FS size. After this, we can forget about the SB. 2. All instances of 'mark_buffer_dirty(sbh)' for BFS SB because it is never changed. 3. The '->sync_fs()' method because there is nothing to sync (inodes are synched by VFS). 4. The '->write_super()' method, again, because the SB is never changed. Tested-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:

committed by
Al Viro

parent
7435d50611
commit
4e29d50a28
@@ -70,7 +70,6 @@ static int bfs_get_block(struct inode *inode, sector_t block,
|
||||
struct super_block *sb = inode->i_sb;
|
||||
struct bfs_sb_info *info = BFS_SB(sb);
|
||||
struct bfs_inode_info *bi = BFS_I(inode);
|
||||
struct buffer_head *sbh = info->si_sbh;
|
||||
|
||||
phys = bi->i_sblock + block;
|
||||
if (!create) {
|
||||
@@ -112,7 +111,6 @@ static int bfs_get_block(struct inode *inode, sector_t block,
|
||||
info->si_freeb -= phys - bi->i_eblock;
|
||||
info->si_lf_eblk = bi->i_eblock = phys;
|
||||
mark_inode_dirty(inode);
|
||||
mark_buffer_dirty(sbh);
|
||||
err = 0;
|
||||
goto out;
|
||||
}
|
||||
@@ -147,7 +145,6 @@ static int bfs_get_block(struct inode *inode, sector_t block,
|
||||
*/
|
||||
info->si_freeb -= bi->i_eblock - bi->i_sblock + 1 - inode->i_blocks;
|
||||
mark_inode_dirty(inode);
|
||||
mark_buffer_dirty(sbh);
|
||||
map_bh(bh_result, sb, phys);
|
||||
out:
|
||||
mutex_unlock(&info->bfs_lock);
|
||||
|
Reference in New Issue
Block a user