[openib-general] [PATCH] SDP warnings on x86_64

Grant Grundler iod00d at hp.com
Fri Feb 11 23:52:38 PST 2005


On Fri, Feb 11, 2005 at 09:58:27PM -0800, Grant Grundler wrote:
> I'm guessing _sdp_iocb_page_save() is just broken.
> The ia64 kernel builds fine.
> And every other use of pmd_offset() looks like this:
> 	mm/rmap.c:      pmd = pmd_offset(pud, address);

The following patch makes _sdp_iocb_page_save() look like the
code in mm/rmap.c. I have no clue if it's right or not.
But it now builds on ia64. Not tested yet.

And rmap.c uses pXX_present() macro.
I don't know if that should be used as well.

Signed-off-by: Grant Grundler <grant.grundler at hp.com>


Index: ulp/sdp/sdp_iocb.c
===================================================================
--- ulp/sdp/sdp_iocb.c	(revision 1781)
+++ ulp/sdp/sdp_iocb.c	(working copy)
@@ -139,6 +139,7 @@ static int _sdp_iocb_page_save(struct sd
 	struct page *page;
 	unsigned long pfn;
 	pgd_t *pgd;
+	pud_t *pud;
 	pmd_t *pmd;
 	pte_t *ptep;
 	pte_t  pte;
@@ -186,12 +187,17 @@ static int _sdp_iocb_page_save(struct sd
 	     0 < size;
 	     counter++, addr += PAGE_SIZE, size -= PAGE_SIZE) {
 
-		pgd = pgd_offset_gate(iocb->mm, addr);
+		pgd = pgd_offset(iocb->mm, addr);
 		if (!pgd || pgd_none(*pgd)) {
 			break;
 		}
-		
-		pmd = pmd_offset(pgd, addr);
+
+		pud = pud_offset(pgd, addr);
+		if (!pud || pud_none(*pud)) {
+			break;
+		}
+
+		pmd = pmd_offset(pud, addr);
 		if (!pmd || pmd_none(*pmd)) {
 			break;
 		}



More information about the general mailing list