]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - mm/truncate.c
HID: multitouch: Support PTP Stick and Touchpad device
[mirror_ubuntu-zesty-kernel.git] / mm / truncate.c
index dd7b24e083c5b1f76851eb0b5e3359dde92d910e..c2d7deae28bb013f268eedad5db30c731f1bf0db 100644 (file)
@@ -66,17 +66,14 @@ static void truncate_exceptional_entry(struct address_space *mapping,
 
 /*
  * Invalidate exceptional entry if easily possible. This handles exceptional
- * entries for invalidate_inode_pages() so for DAX it evicts only unlocked and
- * clean entries.
+ * entries for invalidate_inode_pages().
  */
 static int invalidate_exceptional_entry(struct address_space *mapping,
                                        pgoff_t index, void *entry)
 {
-       /* Handled by shmem itself */
-       if (shmem_mapping(mapping))
+       /* Handled by shmem itself, or for DAX we do nothing. */
+       if (shmem_mapping(mapping) || dax_mapping(mapping))
                return 1;
-       if (dax_mapping(mapping))
-               return dax_invalidate_mapping_entry(mapping, index);
        clear_shadow_entry(mapping, index, entry);
        return 1;
 }
@@ -685,6 +682,17 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
                cond_resched();
                index++;
        }
+       /*
+        * For DAX we invalidate page tables after invalidating radix tree.  We
+        * could invalidate page tables while invalidating each entry however
+        * that would be expensive. And doing range unmapping before doesn't
+        * work as we have no cheap way to find whether radix tree entry didn't
+        * get remapped later.
+        */
+       if (dax_mapping(mapping)) {
+               unmap_mapping_range(mapping, (loff_t)start << PAGE_SHIFT,
+                                   (loff_t)(end - start + 1) << PAGE_SHIFT, 0);
+       }
        cleancache_invalidate_inode(mapping);
        return ret;
 }