add patch fix-compile-error-while-opening-the-macros-DOUBLE_CHECK
[ext4-patch-queue.git] / cleanup-handling-of-bh-b_state-in-DAX-mmap
blobbf1143c6d6f45ef2af41dda23e8a5f6dc045bcf2
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
8 uniform.
10 Signed-off-by: Jan Kara <jack@suse.cz>
11 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 ---
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
18 --- a/fs/ext4/inode.c
19 +++ b/fs/ext4/inode.c
20 @@ -3180,13 +3180,12 @@ out:
21         WARN_ON_ONCE(ret == 0 && create);
22         if (ret > 0) {
23                 map_bh(bh_result, inode->i_sb, map.m_pblk);
24 -               bh_result->b_state = (bh_result->b_state & ~EXT4_MAP_FLAGS) |
25 -                                       map.m_flags;
26                 /*
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.
29                  */
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;
34                 ret = 0;
35         }
36 -- 
37 2.6.2