public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Use page_to_pfn in BIO code
Date: Tue, 4 Jun 2002 19:47:42 +1000	[thread overview]
Message-ID: <20020604094741.GA17665@krispykreme> (raw)


Hi,

While porting the DISCONTIGMEM code to ppc64 (in order to do NUMA memory
allocation) I noticed the bio code uses page_to_phys. We should instead
be using the recently introduced page_to_pfn code.

This now limits the direct usage of mem_map (at least on ppc64) to 
two spots - page_to_pfn/pfn_to_page which makes DISCONTIGMEM support
quite trivial.

Anton

diff -urN linux-2.5_ppc64/include/linux/bio.h linux-2.5_work/include/linux/bio.h
--- linux-2.5_ppc64/include/linux/bio.h	Wed May  8 10:31:25 2002
+++ linux-2.5_work/include/linux/bio.h	Tue Jun  4 16:20:41 2002
@@ -128,8 +130,8 @@
 /*
  * will die
  */
-#define bio_to_phys(bio)	(page_to_phys(bio_page((bio))) + (unsigned long) bio_offset((bio)))
-#define bvec_to_phys(bv)	(page_to_phys((bv)->bv_page) + (unsigned long) (bv)->bv_offset)
+#define bio_to_phys(bio)	((page_to_pfn(bio_page((bio))) << PAGE_SHIFT) + (unsigned long) bio_offset((bio)))
+#define bvec_to_phys(bv)	((page_to_pfn((bv)->bv_page) << PAGE_SHIFT) + (unsigned long) (bv)->bv_offset)
 
 /*
  * queues that have highmem support enabled may still need to revert to

                 reply	other threads:[~2002-06-04  9:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20020604094741.GA17665@krispykreme \
    --to=anton@samba.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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