vfs,ext2: introduce IS_DAX(inode)
[deliverable/linux.git] / fs / ext2 / inode.c
index 36d35c36311d69a025c5b804e8d8597cbd9cb2b2..0cb04486577d63791c362831d8fb14fbf02d9b15 100644 (file)
@@ -731,7 +731,7 @@ static int ext2_get_blocks(struct inode *inode,
                goto cleanup;
        }
 
-       if (ext2_use_xip(inode->i_sb)) {
+       if (IS_DAX(inode)) {
                /*
                 * we need to clear the block
                 */
@@ -1201,7 +1201,7 @@ static int ext2_setsize(struct inode *inode, loff_t newsize)
 
        inode_dio_wait(inode);
 
-       if (mapping_is_xip(inode->i_mapping))
+       if (IS_DAX(inode))
                error = xip_truncate_page(inode->i_mapping, newsize);
        else if (test_opt(inode->i_sb, NOBH))
                error = nobh_truncate_page(inode->i_mapping,
@@ -1273,7 +1273,8 @@ void ext2_set_inode_flags(struct inode *inode)
 {
        unsigned int flags = EXT2_I(inode)->i_flags;
 
-       inode->i_flags &= ~(S_SYNC|S_APPEND|S_IMMUTABLE|S_NOATIME|S_DIRSYNC);
+       inode->i_flags &= ~(S_SYNC | S_APPEND | S_IMMUTABLE | S_NOATIME |
+                               S_DIRSYNC | S_DAX);
        if (flags & EXT2_SYNC_FL)
                inode->i_flags |= S_SYNC;
        if (flags & EXT2_APPEND_FL)
@@ -1284,6 +1285,8 @@ void ext2_set_inode_flags(struct inode *inode)
                inode->i_flags |= S_NOATIME;
        if (flags & EXT2_DIRSYNC_FL)
                inode->i_flags |= S_DIRSYNC;
+       if (test_opt(inode->i_sb, XIP))
+               inode->i_flags |= S_DAX;
 }
 
 /* Propagate flags from i_flags to EXT2_I(inode)->i_flags */
This page took 0.026556 seconds and 5 git commands to generate.