]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - mm/readahead.c
smb3: request more credits on normal (non-large read/write) ops
[linux.git] / mm / readahead.c
index f3d6f9656a3cc83c93420210dd938b8d0b54648e..1ae16522412aee1430f112aa0fdf33e63b0c75ad 100644 (file)
@@ -270,17 +270,15 @@ static unsigned long get_init_ra_size(unsigned long size, unsigned long max)
  *  return it as the new window size.
  */
 static unsigned long get_next_ra_size(struct file_ra_state *ra,
-                                               unsigned long max)
+                                     unsigned long max)
 {
        unsigned long cur = ra->size;
-       unsigned long newsize;
 
        if (cur < max / 16)
-               newsize = 4 * cur;
-       else
-               newsize = 2 * cur;
-
-       return min(newsize, max);
+               return 4 * cur;
+       if (cur <= max / 2)
+               return 2 * cur;
+       return max;
 }
 
 /*