Skip to content

Commit 16e08b1

Browse files
zhangyi089tytso
authored andcommitted
ext4: cleanup clean_bdev_aliases() calls
Now, we have already handle all cases of forgetting buffer in jbd2_journal_forget(), the buffer should not be mapped to blockdevice when reallocating it. So this patch remove all clean_bdev_aliases() and clean_bdev_bh_alias() calls which were invoked by ext4 explicitly. Suggested-by: Jan Kara <[email protected]> Signed-off-by: zhangyi (F) <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]> Reviewed-by: Jan Kara <[email protected]>
1 parent 5975992 commit 16e08b1

File tree

3 files changed

+2
-21
lines changed

3 files changed

+2
-21
lines changed

fs/ext4/extents.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4048,18 +4048,8 @@ ext4_ext_handle_unwritten_extents(handle_t *handle, struct inode *inode,
40484048
} else
40494049
allocated = ret;
40504050
map->m_flags |= EXT4_MAP_NEW;
4051-
/*
4052-
* if we allocated more blocks than requested
4053-
* we need to make sure we unmap the extra block
4054-
* allocated. The actual needed block will get
4055-
* unmapped later when we find the buffer_head marked
4056-
* new.
4057-
*/
4058-
if (allocated > map->m_len) {
4059-
clean_bdev_aliases(inode->i_sb->s_bdev, newblock + map->m_len,
4060-
allocated - map->m_len);
4051+
if (allocated > map->m_len)
40614052
allocated = map->m_len;
4062-
}
40634053
map->m_len = allocated;
40644054

40654055
map_out:

fs/ext4/inode.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -678,8 +678,6 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode,
678678
if (flags & EXT4_GET_BLOCKS_ZERO &&
679679
map->m_flags & EXT4_MAP_MAPPED &&
680680
map->m_flags & EXT4_MAP_NEW) {
681-
clean_bdev_aliases(inode->i_sb->s_bdev, map->m_pblk,
682-
map->m_len);
683681
ret = ext4_issue_zeroout(inode, map->m_lblk,
684682
map->m_pblk, map->m_len);
685683
if (ret) {
@@ -1194,7 +1192,6 @@ static int ext4_block_write_begin(struct page *page, loff_t pos, unsigned len,
11941192
if (err)
11951193
break;
11961194
if (buffer_new(bh)) {
1197-
clean_bdev_bh_alias(bh);
11981195
if (PageUptodate(page)) {
11991196
clear_buffer_new(bh);
12001197
set_buffer_uptodate(bh);
@@ -2490,10 +2487,6 @@ static int mpage_map_one_extent(handle_t *handle, struct mpage_da_data *mpd)
24902487
}
24912488

24922489
BUG_ON(map->m_len == 0);
2493-
if (map->m_flags & EXT4_MAP_NEW) {
2494-
clean_bdev_aliases(inode->i_sb->s_bdev, map->m_pblk,
2495-
map->m_len);
2496-
}
24972490
return 0;
24982491
}
24992492

fs/ext4/page-io.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,8 @@ int ext4_bio_write_page(struct ext4_io_submit *io,
467467
ext4_io_submit(io);
468468
continue;
469469
}
470-
if (buffer_new(bh)) {
470+
if (buffer_new(bh))
471471
clear_buffer_new(bh);
472-
clean_bdev_bh_alias(bh);
473-
}
474472
set_buffer_async_write(bh);
475473
nr_to_submit++;
476474
} while ((bh = bh->b_this_page) != head);

0 commit comments

Comments
 (0)