Messages in this thread Patch in this message |  | | | Date | Fri, 9 Dec 2005 10:39:14 -0600 | | From | Mark Rustad <> | | Subject | [PATCH 2.6.15-rc5] hugetlb: make make_huge_pte global and fix coding style |
| |
This patch makes the function make_huge_pte non-static, so it can be used by drivers that want to mmap huge pages. Consequently, a prototype for the function is added to hugetlb.h. Since I was looking here, I noticed some coding style problems in the function and fix them with this patch.
Signed-off-by: Mark Rustad <MRustad@mac.com>
include/linux/hugetlb.h | 1 + mm/hugetlb.c | 13 ++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) --- a/include/linux/hugetlb.h 2005-11-28 15:58:37.000000000 -0600 +++ b/include/linux/hugetlb.h 2005-12-08 10:38:36.099028314 -0600 @@ -24,6 +24,7 @@ int is_hugepage_mem_enough(size_t); unsigned long hugetlb_total_pages(void); struct page *alloc_huge_page(void); void free_huge_page(struct page *); +pte_t make_huge_pte(struct vm_area_struct *vma, struct page *page); int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, int write_access); --- a/mm/hugetlb.c 2005-11-29 12:11:43.794928597 -0600 +++ b/mm/hugetlb.c 2005-12-08 10:43:43.983294767 -0600 @@ -261,16 +261,15 @@ struct vm_operations_struct hugetlb_vm_o .nopage = hugetlb_nopage, }; -static pte_t make_huge_pte(struct vm_area_struct *vma, struct page *page) +pte_t make_huge_pte(struct vm_area_struct *vma, struct page *page) { pte_t entry; - if (vma->vm_flags & VM_WRITE) { - entry = - pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot))); - } else { - entry = pte_wrprotect(mk_pte(page, vma->vm_page_prot)); - } + entry = mk_pte(page, vma->vm_page_prot); + if (vma->vm_flags & VM_WRITE) + entry = pte_mkwrite(pte_mkdirty(entry)); + else + entry = pte_wrprotect(entry); entry = pte_mkyoung(entry); entry = pte_mkhuge(entry); -- Mark Rustad, mrustad@mac.com - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |