[PATCH 1/9] introduce virt_to_pagoff()

YOSHIFUJI Hideaki / 吉藤英明
2003-08-10T11:00:41Z

In article <20030810020444.48cb740b.davem@redhat.com> (at Sun, 10 Aug 2003 02:04:44 -0700), "David S. Miller" <davem@redhat.com> says:

> Yoshfuji, feel free to do your conversions, and use this
> linux/mm.h placement of the virt_to_pageoff() macro instead
> of having to put it into every asm header.

[1/9] introduce virt_to_pageoff().

Index: linux-2.6/Documentation/DMA-mapping.txt
===================================================================
RCS file: /home/cvs/linux-2.5/Documentation/DMA-mapping.txt,v
retrieving revision 1.17
diff -u -r1.17 DMA-mapping.txt
--- linux-2.6/Documentation/DMA-mapping.txt 1 Aug 2003 19:02:34 -0000 1.17
+++ linux-2.6/Documentation/DMA-mapping.txt 10 Aug 2003 08:40:50 -0000
@@ -689,7 +689,7 @@
and offset using something like this:

struct page *page = virt_to_page(ptr);
- unsigned long offset = ((unsigned long)ptr & ~PAGE_MASK);
+ unsigned long offset = virt_to_pageoff(ptr);

Here are the interfaces:

Index: linux-2.6/include/linux/mm.h
===================================================================
RCS file: /home/cvs/linux-2.5/include/linux/mm.h,v
retrieving revision 1.125
diff -u -r1.125 mm.h
--- linux-2.6/include/linux/mm.h 1 Aug 2003 17:02:32 -0000 1.125
+++ linux-2.6/include/linux/mm.h 10 Aug 2003 08:40:55 -0000
@@ -400,6 +400,8 @@
#define VM_FAULT_MINOR 1
#define VM_FAULT_MAJOR 2

+#define virt_to_pageoff(p) ((unsigned long)(p) & ~PAGE_MASK)
+
extern void show_free_areas(void);

struct page *shmem_nopage(struct vm_area_struct * vma,

--
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@linux-ipv6.org>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA