[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/6] libpager: Store pagemapsize as vm_size_t
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 4/6] libpager: Store pagemapsize as vm_size_t |
Date: |
Thu, 6 May 2021 23:59:54 +0200 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
Sergey Bugaev, le jeu. 06 mai 2021 15:56:29 +0300, a ecrit:
> On a 64-bit system, there can be a lot more pages
> than a 32-bit int can fit.
Indeed, applied, thanks!
> ---
> libpager/pagemap.c | 2 +-
> libpager/priv.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libpager/pagemap.c b/libpager/pagemap.c
> index 963f6567..63c5f44d 100644
> --- a/libpager/pagemap.c
> +++ b/libpager/pagemap.c
> @@ -29,7 +29,7 @@ _pager_pagemap_resize (struct pager *p, vm_address_t off)
> if (p->pagemapsize < off)
> {
> void *newaddr;
> - int newsize = round_page (off);
> + vm_size_t newsize = round_page (off);
>
> newaddr = mmap (0, newsize * sizeof (*p->pagemap),
> PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
> diff --git a/libpager/priv.h b/libpager/priv.h
> index c0a99fe3..d9d76965 100644
> --- a/libpager/priv.h
> +++ b/libpager/priv.h
> @@ -66,7 +66,7 @@ struct pager
> #endif
>
> short *pagemap;
> - int pagemapsize; /* number of elements in PAGEMAP */
> + vm_size_t pagemapsize; /* number of elements in PAGEMAP */
> };
>
> struct lock_request
> --
> 2.31.1
>
>
- [PATCH 0/6] Various libpager fixes, Sergey Bugaev, 2021/05/06
- [PATCH 1/6] libpager: Fix mixing up success and error, Sergey Bugaev, 2021/05/06
- [PATCH 2/6] libpager: Do not flush in-core pages on offer, Sergey Bugaev, 2021/05/06
- [PATCH 4/6] libpager: Store pagemapsize as vm_size_t, Sergey Bugaev, 2021/05/06
- Re: [PATCH 4/6] libpager: Store pagemapsize as vm_size_t,
Samuel Thibault <=
- [PATCH 6/6] libpager: Use libc heap for pagemap, Sergey Bugaev, 2021/05/06
- [PATCH 3/6] libpager: Add error handling to various functions, Sergey Bugaev, 2021/05/06
- [PATCH 5/6] libpager: Fix overallocating pagemap, Sergey Bugaev, 2021/05/06
- And another patch..., Sergey Bugaev, 2021/05/06