~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to mm/readahead.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
static int read_pages(struct address_space *mapping, struct file *filp,
110
110
                struct list_head *pages, unsigned nr_pages)
111
111
{
 
112
        struct blk_plug plug;
112
113
        unsigned page_idx;
113
114
        int ret;
114
115
 
 
116
        blk_start_plug(&plug);
 
117
 
115
118
        if (mapping->a_ops->readpages) {
116
119
                ret = mapping->a_ops->readpages(filp, mapping, pages, nr_pages);
117
120
                /* Clean up the remaining pages */
129
132
                page_cache_release(page);
130
133
        }
131
134
        ret = 0;
 
135
 
132
136
out:
 
137
        blk_finish_plug(&plug);
 
138
 
133
139
        return ret;
134
140
}
135
141
 
174
180
                if (page)
175
181
                        continue;
176
182
 
177
 
                page = page_cache_alloc_cold(mapping);
 
183
                page = page_cache_alloc_readahead(mapping);
178
184
                if (!page)
179
185
                        break;
180
186
                page->index = page_offset;
555
561
 
556
562
        /* do read-ahead */
557
563
        ondemand_readahead(mapping, ra, filp, true, offset, req_size);
558
 
 
559
 
#ifdef CONFIG_BLOCK
560
 
        /*
561
 
         * Normally the current page is !uptodate and lock_page() will be
562
 
         * immediately called to implicitly unplug the device. However this
563
 
         * is not always true for RAID conifgurations, where data arrives
564
 
         * not strictly in their submission order. In this case we need to
565
 
         * explicitly kick off the IO.
566
 
         */
567
 
        if (PageUptodate(page))
568
 
                blk_run_backing_dev(mapping->backing_dev_info, NULL);
569
 
#endif
570
564
}
571
565
EXPORT_SYMBOL_GPL(page_cache_async_readahead);