2009-07-07 10:00:58

by Figo.zhang

[permalink] [raw]
Subject: [PATCH] vmalloc.c: fix vmap_page_range() return


vmap_page_range() would never return a positive number.

Signed-off-by: Figo.zhang <[email protected]>
---
mm/vmalloc.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index f8189a4..bbd312d 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -1109,10 +1109,6 @@ int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page ***pages)
int err;

err = vmap_page_range(addr, end, prot, *pages);
- if (err > 0) {
- *pages += err;
- err = 0;
- }

return err;
}


2009-07-07 16:20:12

by Figo.zhang

[permalink] [raw]
Subject: Re: [PATCH] vmalloc.c: fix vmap_page_range() return

On Tue, 2009-07-07 at 18:00 +0800, Figo.zhang wrote:
> vmap_page_range() would never return a positive number.

hmm, it is my mistake. vmap_pud_range() will return the succeed mapped
page number.

Best,
Figo.zhang


>
> Signed-off-by: Figo.zhang <[email protected]>
> ---
> mm/vmalloc.c | 4 ----
> 1 files changed, 0 insertions(+), 4 deletions(-)
>
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index f8189a4..bbd312d 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -1109,10 +1109,6 @@ int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page ***pages)
> int err;
>
> err = vmap_page_range(addr, end, prot, *pages);
> - if (err > 0) {
> - *pages += err;
> - err = 0;
> - }
>
> return err;
> }
>