public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.15-rc5] hugetlb: make make_huge_pte global and fix coding style
@ 2005-12-09 16:39 Mark Rustad
  2005-12-09 17:05 ` Adam Litke
  2005-12-09 17:16 ` Dave Hansen
  0 siblings, 2 replies; 11+ messages in thread
From: Mark Rustad @ 2005-12-09 16:39 UTC (permalink / raw)
  To: linux-kernel


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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-12-10  6:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-09 16:39 [PATCH 2.6.15-rc5] hugetlb: make make_huge_pte global and fix coding style Mark Rustad
2005-12-09 17:05 ` Adam Litke
2005-12-09 17:50   ` Mark Rustad
2005-12-09 17:16 ` Dave Hansen
2005-12-09 17:55   ` Mark Rustad
2005-12-09 18:08     ` Dave Hansen
2005-12-09 19:51       ` Mark Rustad
2005-12-09 20:37         ` Hugh Dickins
2005-12-09 21:18           ` Mark Rustad
2005-12-09 22:12             ` Hugh Dickins
2005-12-10  6:01               ` Mark Rustad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox