tcp: enforce tcp_min_snd_mss in tcp_mtu_probing()
[pandora-kernel.git] / mm / readahead.c
index 867f9dd..b771c4b 100644 (file)
@@ -11,7 +11,7 @@
 #include <linux/fs.h>
 #include <linux/gfp.h>
 #include <linux/mm.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/blkdev.h>
 #include <linux/backing-dev.h>
 #include <linux/task_io_accounting_ops.h>
@@ -399,6 +399,7 @@ ondemand_readahead(struct address_space *mapping,
                   unsigned long req_size)
 {
        unsigned long max = max_sane_readahead(ra->ra_pages);
+       pgoff_t prev_offset;
 
        /*
         * start of file
@@ -450,8 +451,11 @@ ondemand_readahead(struct address_space *mapping,
 
        /*
         * sequential cache miss
+        * trivial case: (offset - prev_offset) == 1
+        * unaligned reads: (offset - prev_offset) == 0
         */
-       if (offset - (ra->prev_pos >> PAGE_CACHE_SHIFT) <= 1UL)
+       prev_offset = (unsigned long long)ra->prev_pos >> PAGE_CACHE_SHIFT;
+       if (offset - prev_offset <= 1UL)
                goto initial_readahead;
 
        /*