]> git.hungrycats.org Git - linux/commitdiff
[PATCH] use find_get_page() in do_generic_mapping_read()
authorAndrew Morton <akpm@digeo.com>
Tue, 25 Feb 2003 01:06:04 +0000 (17:06 -0800)
committerJeff Garzik <jgarzik@redhat.com>
Tue, 25 Feb 2003 01:06:04 +0000 (17:06 -0800)
do_generic_mapping_read() has an open-coded version of find_get_page() hidden
inside it.

mm/filemap.c

index f6009bff74670d2c953d24eaecf01a67ee112bc8..fb0092191c0ca28c581dea69ba24115f0832d730 100644 (file)
@@ -559,21 +559,12 @@ void do_generic_mapping_read(struct address_space *mapping,
                page_cache_readahead(mapping, ra, filp, index);
 
                nr = nr - offset;
-
-               /*
-                * Try to find the data in the page cache..
-                */
 find_page:
-               read_lock(&mapping->page_lock);
-               page = radix_tree_lookup(&mapping->page_tree, index);
-               if (!page) {
-                       read_unlock(&mapping->page_lock);
-                       handle_ra_miss(mapping,ra);
+               page = find_get_page(mapping, index);
+               if (unlikely(page == NULL)) {
+                       handle_ra_miss(mapping, ra);
                        goto no_cached_page;
                }
-               page_cache_get(page);
-               read_unlock(&mapping->page_lock);
-
                if (!PageUptodate(page))
                        goto page_not_up_to_date;
 page_ok: