Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73697
b: refs/heads/master
c: c79fb75
h: refs/heads/master
i:
  73695: 816f3df
v: v3
  • Loading branch information
Adam Litke authored and Linus Torvalds committed Nov 15, 2007
1 parent 32e94f9 commit 19ad9bc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 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: 348ea204cc23cda35faf962414b674c57da647d7
refs/heads/master: c79fb75e5a514a5a35f22c229042aa29f4237e3a
1 change: 0 additions & 1 deletion trunk/fs/hugetlbfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ static void truncate_hugepages(struct inode *inode, loff_t lstart)
++next;
truncate_huge_page(page);
unlock_page(page);
hugetlb_put_quota(mapping);
freed++;
}
huge_pagevec_release(&pvec);
Expand Down
13 changes: 10 additions & 3 deletions trunk/mm/hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ static void update_and_free_page(struct page *page)
static void free_huge_page(struct page *page)
{
int nid = page_to_nid(page);
struct address_space *mapping;

mapping = (struct address_space *) page_private(page);
BUG_ON(page_count(page));
INIT_LIST_HEAD(&page->lru);

Expand All @@ -129,6 +131,9 @@ static void free_huge_page(struct page *page)
enqueue_huge_page(page);
}
spin_unlock(&hugetlb_lock);
if (mapping)
hugetlb_put_quota(mapping);
set_page_private(page, 0);
}

/*
Expand Down Expand Up @@ -388,8 +393,10 @@ static struct page *alloc_huge_page(struct vm_area_struct *vma,
page = alloc_huge_page_shared(vma, addr);
else
page = alloc_huge_page_private(vma, addr);
if (page)
if (page) {
set_page_refcounted(page);
set_page_private(page, (unsigned long) vma->vm_file->f_mapping);
}
return page;
}

Expand Down Expand Up @@ -730,6 +737,8 @@ static int hugetlb_cow(struct mm_struct *mm, struct vm_area_struct *vma,
set_huge_ptep_writable(vma, address, ptep);
return 0;
}
if (hugetlb_get_quota(vma->vm_file->f_mapping))
return VM_FAULT_SIGBUS;

page_cache_get(old_page);
new_page = alloc_huge_page(vma, address);
Expand Down Expand Up @@ -796,7 +805,6 @@ static int hugetlb_no_page(struct mm_struct *mm, struct vm_area_struct *vma,
err = add_to_page_cache(page, mapping, idx, GFP_KERNEL);
if (err) {
put_page(page);
hugetlb_put_quota(mapping);
if (err == -EEXIST)
goto retry;
goto out;
Expand Down Expand Up @@ -830,7 +838,6 @@ static int hugetlb_no_page(struct mm_struct *mm, struct vm_area_struct *vma,

backout:
spin_unlock(&mm->page_table_lock);
hugetlb_put_quota(mapping);
unlock_page(page);
put_page(page);
goto out;
Expand Down

0 comments on commit 19ad9bc

Please sign in to comment.