]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ext4: cleanup handling of bh->b_state in DAX mmap
authorJan Kara <jack@suse.cz>
Thu, 10 Mar 2016 04:03:27 +0000 (23:03 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 10 Mar 2016 04:03:27 +0000 (23:03 -0500)
ext4_dax_mmap_get_block() updates bh->b_state directly instead of using
ext4_update_bh_state(). This is mostly a cosmetic issue since DAX code
always passes on-stack buffer_head but clean this up to make code more
uniform.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/inode.c

index 1a156ec043a026863687c946a501cddd6bc872bf..fddc6ddc53a889806338601a8dce0a9923ce3b83 100644 (file)
@@ -3272,13 +3272,12 @@ int ext4_dax_mmap_get_block(struct inode *inode, sector_t iblock,
        WARN_ON_ONCE(ret == 0 && create);
        if (ret > 0) {
                map_bh(bh_result, inode->i_sb, map.m_pblk);
-               bh_result->b_state = (bh_result->b_state & ~EXT4_MAP_FLAGS) |
-                                       map.m_flags;
                /*
                 * At least for now we have to clear BH_New so that DAX code
                 * doesn't attempt to zero blocks again in a racy way.
                 */
-               bh_result->b_state &= ~(1 << BH_New);
+               map.m_flags &= ~EXT4_MAP_NEW;
+               ext4_update_bh_state(bh_result, map.m_flags);
                bh_result->b_size = map.m_len << inode->i_blkbits;
                ret = 0;
        }