]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - mm/readahead.c
PM / sleep: enable suspend-to-idle even without registered suspend_ops
[mirror_ubuntu-zesty-kernel.git] / mm / readahead.c
index 65ec288dc057e874a661fd372501454c32cc2bd4..c8a955b1297e0b60fb2efffdf3fc2bb71cfc4630 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <linux/kernel.h>
+#include <linux/dax.h>
 #include <linux/gfp.h>
 #include <linux/export.h>
 #include <linux/blkdev.h>
@@ -544,6 +545,14 @@ do_readahead(struct address_space *mapping, struct file *filp,
        if (!mapping || !mapping->a_ops)
                return -EINVAL;
 
+       /*
+        * Readahead doesn't make sense for DAX inodes, but we don't want it
+        * to report a failure either.  Instead, we just return success and
+        * don't do any work.
+        */
+       if (dax_mapping(mapping))
+               return 0;
+
        return force_page_cache_readahead(mapping, filp, index, nr);
 }