[PATCH 1/4] Hugetlb: Remove duplicate i_size check

Adam Litke
2005-11-09T23:37:44Z

Hugetlb: Remove duplicate i_size check

On Wed, 2005-10-26 at 12:00 +1000, David Gibson wrote:
> - The check against i_size was duplicated: once in
> find_lock_huge_page() and again in hugetlb_fault() after taking the
> page_table_lock. We only really need the locked one, so remove the
> other.

Original post by David Gibson <david@gibson.dropbear.id.au>

Version 2: Wed 9 Nov 2005
Split this cleanup out into a standalone patch

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Adam Litke <agl@us.ibm.com>
---
hugetlb.c | 7 -------
1 files changed, 7 deletions(-)
diff -upN reference/mm/hugetlb.c current/mm/hugetlb.c
--- reference/mm/hugetlb.c
+++ current/mm/hugetlb.c
@@ -344,19 +344,12 @@ static struct page *find_lock_huge_page(
{
struct page *page;
int err;
- struct inode *inode = mapping->host;
- unsigned long size;

retry:
page = find_lock_page(mapping, idx);
if (page)
goto out;

- /* Check to make sure the mapping hasn't been truncated */
- size = i_size_read(inode) >> HPAGE_SHIFT;
- if (idx >= size)
- goto out;
-
if (hugetlb_get_quota(mapping))
goto out;
page = alloc_huge_page();

--
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center