Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 69597
b: refs/heads/master
c: 7ff8107
h: refs/heads/master
i:
  69595: a37656b
v: v3
  • Loading branch information
Fengguang Wu authored and Linus Torvalds committed Oct 16, 2007
1 parent 560c587 commit 54c0b6d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6b10c6c9fbfe754e8482efb8c8b84f8e40c0f2eb
refs/heads/master: 7ff81078d8b9f3d05a27b7bd3786ffb1ef1b0d1f
20 changes: 9 additions & 11 deletions trunk/mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ static void shrink_readahead_size_eio(struct file *filp,
* It may be NULL.
*/
void do_generic_mapping_read(struct address_space *mapping,
struct file_ra_state *_ra,
struct file_ra_state *ra,
struct file *filp,
loff_t *ppos,
read_descriptor_t *desc,
Expand All @@ -874,13 +874,12 @@ void do_generic_mapping_read(struct address_space *mapping,
unsigned int prev_offset;
struct page *cached_page;
int error;
struct file_ra_state ra = *_ra;

cached_page = NULL;
index = *ppos >> PAGE_CACHE_SHIFT;
next_index = index;
prev_index = ra.prev_pos >> PAGE_CACHE_SHIFT;
prev_offset = ra.prev_pos & (PAGE_CACHE_SIZE-1);
prev_index = ra->prev_pos >> PAGE_CACHE_SHIFT;
prev_offset = ra->prev_pos & (PAGE_CACHE_SIZE-1);
last_index = (*ppos + desc->count + PAGE_CACHE_SIZE-1) >> PAGE_CACHE_SHIFT;
offset = *ppos & ~PAGE_CACHE_MASK;

Expand All @@ -895,15 +894,15 @@ void do_generic_mapping_read(struct address_space *mapping,
page = find_get_page(mapping, index);
if (!page) {
page_cache_sync_readahead(mapping,
&ra, filp,
ra, filp,
index, last_index - index);
page = find_get_page(mapping, index);
if (unlikely(page == NULL))
goto no_cached_page;
}
if (PageReadahead(page)) {
page_cache_async_readahead(mapping,
&ra, filp, page,
ra, filp, page,
index, last_index - index);
}
if (!PageUptodate(page))
Expand Down Expand Up @@ -1014,7 +1013,7 @@ void do_generic_mapping_read(struct address_space *mapping,
}
unlock_page(page);
error = -EIO;
shrink_readahead_size_eio(filp, &ra);
shrink_readahead_size_eio(filp, ra);
goto readpage_error;
}
unlock_page(page);
Expand Down Expand Up @@ -1054,10 +1053,9 @@ void do_generic_mapping_read(struct address_space *mapping,
}

out:
*_ra = ra;
_ra->prev_pos = prev_index;
_ra->prev_pos <<= PAGE_CACHE_SHIFT;
_ra->prev_pos |= prev_offset;
ra->prev_pos = prev_index;
ra->prev_pos <<= PAGE_CACHE_SHIFT;
ra->prev_pos |= prev_offset;

*ppos = ((loff_t)index << PAGE_CACHE_SHIFT) + offset;
if (cached_page)
Expand Down

0 comments on commit 54c0b6d

Please sign in to comment.