X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fllite%2Frw.c;fp=lustre%2Fllite%2Frw.c;h=04cf0e7505588bdae8f2a6146d4a8ff5890e69b4;hp=3f16b3eceebd17e182cd34e68bdf555db2a63d6d;hb=4fc127428f00d6a3b179a143a61ddc78e5d8ca7c;hpb=791f656a031f710ce21674b508ce8b331783a5b7 diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index 3f16b3e..04cf0e7 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -89,8 +89,9 @@ static unsigned long ll_ra_count_get(struct ll_sb_info *sbi, ENTRY; + WARN_ON_ONCE(pages_min > pages); /** - * Don't try readahead agreesively if we are limited + * Don't try readahead aggresively if we are limited * LRU pages, otherwise, it could cause deadlock. */ pages = min(sbi->ll_cache->ccc_lru_max >> 2, pages); @@ -99,7 +100,7 @@ static unsigned long ll_ra_count_get(struct ll_sb_info *sbi, * this will make us leak @ra_cur_pages, because * ll_ra_count_put() acutally freed @pages. */ - if (WARN_ON_ONCE(pages_min > pages)) + if (unlikely(pages_min > pages)) pages_min = pages; /* @@ -823,7 +824,8 @@ static int ll_readahead(const struct lu_env *env, struct cl_io *io, /* don't over reserved for mmap range read */ if (skip_index) pages_min = 0; - + if (pages_min > pages) + pages = pages_min; ria->ria_reserved = ll_ra_count_get(ll_i2sbi(inode), ria, pages, pages_min); if (ria->ria_reserved < pages)