]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/ext2/inode.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
[karo-tx-linux.git] / fs / ext2 / inode.c
index 3ccd5fd47d661639551c953a1abc777e18c41396..6434bc00012517a30ace1cb97f2160b0c48eea3a 100644 (file)
@@ -34,7 +34,6 @@
 #include <linux/aio.h>
 #include "ext2.h"
 #include "acl.h"
-#include "xip.h"
 #include "xattr.h"
 
 static int __ext2_write_inode(struct inode *inode, int do_sync);
@@ -733,10 +732,12 @@ static int ext2_get_blocks(struct inode *inode,
 
        if (IS_DAX(inode)) {
                /*
-                * we need to clear the block
+                * block must be initialised before we put it in the tree
+                * so that it's not found by another thread before it's
+                * initialised
                 */
-               err = ext2_clear_xip_target (inode,
-                       le32_to_cpu(chain[depth-1].key));
+               err = dax_clear_blocks(inode, le32_to_cpu(chain[depth-1].key),
+                                               1 << inode->i_blkbits);
                if (err) {
                        mutex_unlock(&ei->truncate_mutex);
                        goto cleanup;
@@ -890,12 +891,6 @@ const struct address_space_operations ext2_aops = {
        .error_remove_page      = generic_error_remove_page,
 };
 
-const struct address_space_operations ext2_aops_xip = {
-       .bmap                   = ext2_bmap,
-       .get_xip_mem            = ext2_get_xip_mem,
-       .direct_IO              = ext2_direct_IO,
-};
-
 const struct address_space_operations ext2_nobh_aops = {
        .readpage               = ext2_readpage,
        .readpages              = ext2_readpages,
@@ -1208,7 +1203,7 @@ static int ext2_setsize(struct inode *inode, loff_t newsize)
        inode_dio_wait(inode);
 
        if (IS_DAX(inode))
-               error = xip_truncate_page(inode->i_mapping, newsize);
+               error = dax_truncate_page(inode, newsize, ext2_get_block);
        else if (test_opt(inode->i_sb, NOBH))
                error = nobh_truncate_page(inode->i_mapping,
                                newsize, ext2_get_block);
@@ -1291,7 +1286,7 @@ 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))
+       if (test_opt(inode->i_sb, DAX))
                inode->i_flags |= S_DAX;
 }
 
@@ -1393,9 +1388,9 @@ struct inode *ext2_iget (struct super_block *sb, unsigned long ino)
 
        if (S_ISREG(inode->i_mode)) {
                inode->i_op = &ext2_file_inode_operations;
-               if (ext2_use_xip(inode->i_sb)) {
-                       inode->i_mapping->a_ops = &ext2_aops_xip;
-                       inode->i_fop = &ext2_xip_file_operations;
+               if (test_opt(inode->i_sb, DAX)) {
+                       inode->i_mapping->a_ops = &ext2_aops;
+                       inode->i_fop = &ext2_dax_file_operations;
                } else if (test_opt(inode->i_sb, NOBH)) {
                        inode->i_mapping->a_ops = &ext2_nobh_aops;
                        inode->i_fop = &ext2_file_operations;