1 ext4: cleanup handling of bh->b_state in DAX mmap
3 From: Jan Kara <jack@suse.cz>
5 ext4_dax_mmap_get_block() updates bh->b_state directly instead of using
6 ext4_update_bh_state(). This is mostly a cosmetic issue since DAX code
7 always passes on-stack buffer_head but clean this up to make code more
10 Signed-off-by: Jan Kara <jack@suse.cz>
11 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 fs/ext4/inode.c | 5 ++---
14 1 file changed, 2 insertions(+), 3 deletions(-)
16 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
17 index ef590607b4a7..e38c88b37e2e 100644
20 @@ -3180,13 +3180,12 @@ out:
21 WARN_ON_ONCE(ret == 0 && create);
23 map_bh(bh_result, inode->i_sb, map.m_pblk);
24 - bh_result->b_state = (bh_result->b_state & ~EXT4_MAP_FLAGS) |
27 * At least for now we have to clear BH_New so that DAX code
28 * doesn't attempt to zero blocks again in a racy way.
30 - bh_result->b_state &= ~(1 << BH_New);
31 + map.m_flags &= ~EXT4_MAP_NEW;
32 + ext4_update_bh_state(bh_result, map.m_flags);
33 bh_result->b_size = map.m_len << inode->i_blkbits;