In article <[EMAIL PROTECTED]>,
Mike Galbraith <[EMAIL PROTECTED]> wrote:
>On Thu, 19 Oct 2000 [EMAIL PROTECTED] wrote:
>
>> can anyone tell the subsitute for MAP_NR in version 2.4?
>> or is MAP_NR still there?
>
>Hi,
>
>MAP_NR() became virt_to_page() as of test6-pre8.
Not quite.
The expression "(mem_map + MAP_NR(x))" has become "virt_to_page(x)".
There is nothing that is exactly the same as MAP_NR(), because the
concept doesn't really exist any more (there are now architectures out
there that have multiple page maps, so a single number is not sufficient
to describe the page).
Now, in 99% of all cases, this is how MAP_NR() was used, and most of the
time it's a simple 1:1 translation. In some cases there was one level of
indirection, something like
int i;
for (i = MAP_NR(x) ; i < MAP_NR(y); i++) {
...
... i + mem_map ...
...
}
and in those cases it needs to be slightly rewritten to use "struct
page" pointers instead, ie something like
struct page *page, *end;
page = virt_to_page(x);
end = virt_to_page(y);
do {
..
} while (++page < end);
rather than just a simple expression replacement.
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/