1 ext4: cleanup clean_bdev_aliases() calls
3 From: "zhangyi (F)" <yi.zhang@huawei.com>
5 Now, we have already handle all cases of forgetting buffer in
6 jbd2_journal_forget(), the buffer should not be mapped to blockdevice
7 when reallocating it. So this patch remove all clean_bdev_aliases() and
8 clean_bdev_bh_alias() calls which were invoked by ext4 explicitly.
10 Suggested-by: Jan Kara <jack@suse.cz>
11 Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
12 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 Reviewed-by: Jan Kara <jack@suse.cz>
15 fs/ext4/extents.c | 12 +-----------
16 fs/ext4/inode.c | 7 -------
17 fs/ext4/page-io.c | 4 +---
18 3 files changed, 2 insertions(+), 21 deletions(-)
20 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
21 index a054f51..ffb72d8 100644
22 --- a/fs/ext4/extents.c
23 +++ b/fs/ext4/extents.c
24 @@ -4068,18 +4068,8 @@ ext4_ext_handle_unwritten_extents(handle_t *handle, struct inode *inode,
27 map->m_flags |= EXT4_MAP_NEW;
29 - * if we allocated more blocks than requested
30 - * we need to make sure we unmap the extra block
31 - * allocated. The actual needed block will get
32 - * unmapped later when we find the buffer_head marked
35 - if (allocated > map->m_len) {
36 - clean_bdev_aliases(inode->i_sb->s_bdev, newblock + map->m_len,
37 - allocated - map->m_len);
38 + if (allocated > map->m_len)
39 allocated = map->m_len;
41 map->m_len = allocated;
44 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
45 index e7adf87..3068c83 100644
48 @@ -678,8 +678,6 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode,
49 if (flags & EXT4_GET_BLOCKS_ZERO &&
50 map->m_flags & EXT4_MAP_MAPPED &&
51 map->m_flags & EXT4_MAP_NEW) {
52 - clean_bdev_aliases(inode->i_sb->s_bdev, map->m_pblk,
54 ret = ext4_issue_zeroout(inode, map->m_lblk,
55 map->m_pblk, map->m_len);
57 @@ -1194,7 +1192,6 @@ static int ext4_block_write_begin(struct page *page, loff_t pos, unsigned len,
61 - clean_bdev_bh_alias(bh);
62 if (PageUptodate(page)) {
64 set_buffer_uptodate(bh);
65 @@ -2490,10 +2487,6 @@ static int mpage_map_one_extent(handle_t *handle, struct mpage_da_data *mpd)
68 BUG_ON(map->m_len == 0);
69 - if (map->m_flags & EXT4_MAP_NEW) {
70 - clean_bdev_aliases(inode->i_sb->s_bdev, map->m_pblk,
76 diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
77 index 2aa62d5..1559946 100644
78 --- a/fs/ext4/page-io.c
79 +++ b/fs/ext4/page-io.c
80 @@ -467,10 +467,8 @@ int ext4_bio_write_page(struct ext4_io_submit *io,
84 - if (buffer_new(bh)) {
87 - clean_bdev_bh_alias(bh);
89 set_buffer_async_write(bh);
91 } while ((bh = bh->b_this_page) != head);