]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/mpage.c
OMAP: dmtimer: enable all timers to be wakeup events
[linux-2.6-omap-h63xx.git] / fs / mpage.c
index 552b80b3facc01414967771ec6d59d9029276cdb..16c3ef37eae348ed97ad90229d427449699315a3 100644 (file)
@@ -241,7 +241,6 @@ do_mpage_readpage(struct bio *bio, struct page *page, unsigned nr_pages,
                                first_hole = page_block;
                        page_block++;
                        block_in_file++;
-                       clear_buffer_mapped(map_bh);
                        continue;
                }
 
@@ -308,7 +307,10 @@ alloc_new:
                goto alloc_new;
        }
 
-       if (buffer_boundary(map_bh) || (first_hole != blocks_per_page))
+       relative_block = block_in_file - *first_logical_block;
+       nblocks = map_bh->b_size >> blkbits;
+       if ((buffer_boundary(map_bh) && relative_block == nblocks) ||
+           (first_hole != blocks_per_page))
                bio = mpage_bio_submit(READ, bio);
        else
                *last_block_in_bio = blocks[blocks_per_page - 1];