linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: Andrew Morton <akpm@digeo.com>
Cc: linux-mm@kvack.org
Subject: [PATCH] remove __pmd_offset
Date: Tue, 04 Mar 2003 15:02:23 -0800	[thread overview]
Message-ID: <3E65307F.7040008@us.ibm.com> (raw)
In-Reply-To: <3E653012.5040503@us.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 127 bytes --]

Same thing as the __pgd_offset one, just for pmds this time to keep the
naming consistent.
-- 
Dave Hansen
haveblue@us.ibm.com

[-- Attachment #2: pmdindex-2.5.63-0.patch --]
[-- Type: text/plain, Size: 5412 bytes --]

diff -ru linux-2.5.63-pgdindex/arch/i386/mm/init.c linux-2.5.63-pmdindex/arch/i386/mm/init.c
--- linux-2.5.63-pgdindex/arch/i386/mm/init.c	Tue Mar  4 14:38:43 2003
+++ linux-2.5.63-pmdindex/arch/i386/mm/init.c	Tue Mar  4 14:40:45 2003
@@ -98,12 +98,12 @@
 {
 	pgd_t *pgd;
 	pmd_t *pmd;
-	int pgd_idx, pmd_ofs;
+	int pgd_idx, pmd_idx;
 	unsigned long vaddr;
 
 	vaddr = start;
 	pgd_idx = pgd_index(vaddr);
-	pmd_ofs = __pmd_offset(vaddr);
+	pmd_idx = pmd_index(vaddr);
 	pgd = pgd_base + pgd_idx;
 
 	for ( ; (pgd_idx < PTRS_PER_PGD) && (vaddr != end); pgd++, pgd_idx++) {
@@ -111,13 +111,13 @@
 			one_md_table_init(pgd);
 
 		pmd = pmd_offset(pgd, vaddr);
-		for (; (pmd_ofs < PTRS_PER_PMD) && (vaddr != end); pmd++, pmd_ofs++) {
+		for (; (pmd_idx < PTRS_PER_PMD) && (vaddr != end); pmd++, pmd_idx++) {
 			if (pmd_none(*pmd)) 
 				one_page_table_init(pmd);
 
 			vaddr += PMD_SIZE;
 		}
-		pmd_ofs = 0;
+		pmd_idx = 0;
 	}
 }
 
@@ -132,7 +132,7 @@
 	pgd_t *pgd;
 	pmd_t *pmd;
 	pte_t *pte;
-	int pgd_idx, pmd_ofs, pte_ofs;
+	int pgd_idx, pmd_idx, pte_ofs;
 
 	pgd_idx = pgd_index(PAGE_OFFSET);
 	pgd = pgd_base + pgd_idx;
@@ -142,7 +142,7 @@
 		pmd = one_md_table_init(pgd);
 		if (pfn >= max_low_pfn)
 			continue;
-		for (pmd_ofs = 0; pmd_ofs < PTRS_PER_PMD && pfn < max_low_pfn; pmd++, pmd_ofs++) {
+		for (pmd_idx = 0; pmd_idx < PTRS_PER_PMD && pfn < max_low_pfn; pmd++, pmd_idx++) {
 			/* Map with big pages if possible, otherwise create normal page tables. */
 			if (cpu_has_pse) {
 				set_pmd(pmd, pfn_pmd(pfn, PAGE_KERNEL_LARGE));
diff -ru linux-2.5.63-pgdindex/arch/um/kernel/mem.c linux-2.5.63-pmdindex/arch/um/kernel/mem.c
--- linux-2.5.63-pgdindex/arch/um/kernel/mem.c	Tue Mar  4 14:34:13 2003
+++ linux-2.5.63-pmdindex/arch/um/kernel/mem.c	Tue Mar  4 14:40:54 2003
@@ -155,7 +155,7 @@
 
 	vaddr = start;
 	i = pgd_index(vaddr);
-	j = __pmd_offset(vaddr);
+	j = pmd_index(vaddr);
 	pgd = pgd_base + i;
 
 	for ( ; (i < PTRS_PER_PGD) && (vaddr < end); pgd++, i++) {
Only in linux-2.5.63-pmdindex/include/asm-i386: .pgtable.h.swp
diff -ru linux-2.5.63-pgdindex/include/asm-i386/pgtable-3level.h linux-2.5.63-pmdindex/include/asm-i386/pgtable-3level.h
--- linux-2.5.63-pgdindex/include/asm-i386/pgtable-3level.h	Tue Mar  4 14:23:09 2003
+++ linux-2.5.63-pmdindex/include/asm-i386/pgtable-3level.h	Tue Mar  4 14:41:30 2003
@@ -69,7 +69,7 @@
 
 /* Find an entry in the second-level page table.. */
 #define pmd_offset(dir, address) ((pmd_t *) pgd_page(*(dir)) + \
-			__pmd_offset(address))
+			pmd_index(address))
 
 static inline pte_t ptep_get_and_clear(pte_t *ptep)
 {
diff -ru linux-2.5.63-pgdindex/include/asm-i386/pgtable.h linux-2.5.63-pmdindex/include/asm-i386/pgtable.h
--- linux-2.5.63-pgdindex/include/asm-i386/pgtable.h	Tue Mar  4 14:24:36 2003
+++ linux-2.5.63-pmdindex/include/asm-i386/pgtable.h	Tue Mar  4 14:39:45 2003
@@ -241,7 +241,7 @@
 /* to find an entry in a kernel page-table-directory */
 #define pgd_offset_k(address) pgd_offset(&init_mm, address)
 
-#define __pmd_offset(address) \
+#define pmd_index(address) \
 		(((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
 
 /* Find an entry in the third-level page table.. */
diff -ru linux-2.5.63-pgdindex/include/asm-s390x/pgtable.h linux-2.5.63-pmdindex/include/asm-s390x/pgtable.h
--- linux-2.5.63-pgdindex/include/asm-s390x/pgtable.h	Tue Mar  4 14:23:08 2003
+++ linux-2.5.63-pmdindex/include/asm-s390x/pgtable.h	Tue Mar  4 14:41:35 2003
@@ -488,9 +488,9 @@
 #define pgd_offset_k(address) pgd_offset(&init_mm, address)
 
 /* Find an entry in the second-level page table.. */
-#define __pmd_offset(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
+#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
 #define pmd_offset(dir,addr) \
-	((pmd_t *) pgd_page_kernel(*(dir)) + __pmd_offset(addr))
+	((pmd_t *) pgd_page_kernel(*(dir)) + pmd_index(addr))
 
 /* Find an entry in the third-level page table.. */
 #define __pte_offset(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE-1))
diff -ru linux-2.5.63-pgdindex/include/asm-um/pgtable.h linux-2.5.63-pmdindex/include/asm-um/pgtable.h
--- linux-2.5.63-pgdindex/include/asm-um/pgtable.h	Tue Mar  4 14:32:42 2003
+++ linux-2.5.63-pmdindex/include/asm-um/pgtable.h	Tue Mar  4 14:39:54 2003
@@ -365,7 +365,7 @@
 /* to find an entry in a kernel page-table-directory */
 #define pgd_offset_k(address) pgd_offset(&init_mm, address)
 
-#define __pmd_offset(address) \
+#define pmd_index(address) \
 		(((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
 
 /* Find an entry in the second-level page table.. */
diff -ru linux-2.5.63-pgdindex/include/asm-x86_64/pgtable.h linux-2.5.63-pmdindex/include/asm-x86_64/pgtable.h
--- linux-2.5.63-pgdindex/include/asm-x86_64/pgtable.h	Tue Mar  4 14:23:09 2003
+++ linux-2.5.63-pmdindex/include/asm-x86_64/pgtable.h	Tue Mar  4 14:41:38 2003
@@ -321,9 +321,9 @@
 #define pmd_page_kernel(pmd) ((unsigned long) __va(pmd_val(pmd) & PTE_MASK))
 #define pmd_page(pmd)		(pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
 
-#define __pmd_offset(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
+#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
 #define pmd_offset(dir, address) ((pmd_t *) pgd_page(*(dir)) + \
-			__pmd_offset(address))
+			pmd_index(address))
 #define pmd_none(x)	(!pmd_val(x))
 #define pmd_present(x)	(pmd_val(x) & _PAGE_PRESENT)
 #define pmd_clear(xp)	do { set_pmd(xp, __pmd(0)); } while (0)

  reply	other threads:[~2003-03-04 23:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-04 23:00 [PATCH] remove __pgd_offset Dave Hansen
2003-03-04 23:02 ` Dave Hansen [this message]
2003-03-04 23:03 ` [PATCH] remove __pte_offset Dave Hansen
2003-03-04 23:10   ` Benjamin LaHaise
2003-03-04 23:09     ` Martin J. Bligh
2003-03-04 23:22       ` Andrew Morton
2003-03-04 23:25       ` Dave Hansen
2003-03-04 23:26       ` Benjamin LaHaise
2003-03-04 23:29         ` Martin J. Bligh
2003-03-04 23:57         ` Dave Hansen
2003-03-05  0:01           ` Andrew Morton
2003-03-05  1:43             ` Martin J. Bligh
2003-03-05  2:04               ` Andrew Morton
2003-03-05  3:32                 ` Randy.Dunlap
2003-03-04 23:16     ` Dave Hansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E65307F.7040008@us.ibm.com \
    --to=haveblue@us.ibm.com \
    --cc=akpm@digeo.com \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox