[patch 3/4] readahead: context based method - fix *remain counting

From: Wu Fengguang
Date: Tue May 30 2006 - 04:47:12 EST


*remain in query_page_cache_segment() is over counted by 1, fix it.

Signed-off-by: Wu Fengguang <wfg@xxxxxxxxxxxxxxxx>
---


--- linux-2.6.17-rc4-mm3.orig/mm/readahead.c
+++ linux-2.6.17-rc4-mm3/mm/readahead.c
@@ -1334,7 +1334,7 @@ static unsigned long query_page_cache_se
index = radix_tree_scan_hole_backward(&mapping->page_tree,
offset - 1, ra_max);

- *remain = offset - index;
+ *remain = (offset - 1) - index;

if (offset == ra->readahead_index && ra_cache_hit_ok(ra))
count = *remain;

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/