lkml.org 
[lkml]   [2007]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 06/14] readahead: call scheme: cleanup
    Merge two similar page_cache_readahead_adaptive() calls into one.

    No behavior change.

    Signed-off-by: Fengguang Wu <wfg@mail.ustc.edu.cn>
    ---
    mm/filemap.c | 18 ++++++------------
    1 file changed, 6 insertions(+), 12 deletions(-)

    --- linux-2.6.21-rc3-mm2.orig/mm/filemap.c
    +++ linux-2.6.21-rc3-mm2/mm/filemap.c
    @@ -934,17 +934,13 @@ void do_generic_mapping_read(struct addr
    find_page:
    page = find_get_page(mapping, index);
    if (prefer_adaptive_readahead()) {
    - if (unlikely(page == NULL)) {
    - ra.prev_page = prev_index;
    - page_cache_readahead_adaptive(mapping,
    - &ra, filp, NULL,
    - index, last_index - index);
    - page = find_get_page(mapping, index);
    - } else if (PageReadahead(page)) {
    + if (!page || PageReadahead(page)) {
    ra.prev_page = prev_index;
    page_cache_readahead_adaptive(mapping,
    &ra, filp, page,
    index, last_index - index);
    + if (!page)
    + page = find_get_page(mapping, index);
    }
    }
    if (unlikely(page == NULL)) {
    @@ -1394,13 +1390,11 @@ struct page *filemap_fault(struct vm_are
    retry_find:
    page = find_lock_page(mapping, fdata->pgoff);
    if (prefer_adaptive_readahead() && VM_SequentialReadHint(vma)) {
    - if (!page) {
    - page_cache_readahead_adaptive(mapping, ra, file, NULL,
    - fdata->pgoff, 1);
    - page = find_lock_page(mapping, fdata->pgoff);
    - } else if (PageReadahead(page)) {
    + if (!page || PageReadahead(page)) {
    page_cache_readahead_adaptive(mapping, ra, file, page,
    fdata->pgoff, 1);
    + if (!page)
    + page = find_lock_page(mapping, fdata->pgoff);
    }
    }
    if (!page) {
    --
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2007-03-16 09:57    [W:0.022 / U:2.120 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site