[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 3/3] util/mmap-alloc: Remove qemu_mempath_getpagesize()
From: |
Claudio Imbrenda |
Subject: |
Re: [PATCH v2 3/3] util/mmap-alloc: Remove qemu_mempath_getpagesize() |
Date: |
Wed, 10 Aug 2022 15:16:53 +0200 |
On Wed, 10 Aug 2022 14:57:20 +0200
Thomas Huth <thuth@redhat.com> wrote:
> The last user of this function has just been removed, so we can
> drop this function now, too.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> ---
> include/qemu/mmap-alloc.h | 2 --
> util/mmap-alloc.c | 31 -------------------------------
> 2 files changed, 33 deletions(-)
>
> diff --git a/include/qemu/mmap-alloc.h b/include/qemu/mmap-alloc.h
> index 5076695cc8..2825e231a7 100644
> --- a/include/qemu/mmap-alloc.h
> +++ b/include/qemu/mmap-alloc.h
> @@ -4,8 +4,6 @@
>
> size_t qemu_fd_getpagesize(int fd);
>
> -size_t qemu_mempath_getpagesize(const char *mem_path);
> -
> /**
> * qemu_ram_mmap: mmap anonymous memory, the specified file or device.
> *
> diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
> index 5b90cb68ea..5ed7d29183 100644
> --- a/util/mmap-alloc.c
> +++ b/util/mmap-alloc.c
> @@ -53,37 +53,6 @@ size_t qemu_fd_getpagesize(int fd)
> return qemu_real_host_page_size();
> }
>
> -size_t qemu_mempath_getpagesize(const char *mem_path)
> -{
> -#ifdef CONFIG_LINUX
> - struct statfs fs;
> - int ret;
> -
> - if (mem_path) {
> - do {
> - ret = statfs(mem_path, &fs);
> - } while (ret != 0 && errno == EINTR);
> -
> - if (ret != 0) {
> - fprintf(stderr, "Couldn't statfs() memory path: %s\n",
> - strerror(errno));
> - exit(1);
> - }
> -
> - if (fs.f_type == HUGETLBFS_MAGIC) {
> - /* It's hugepage, return the huge page size */
> - return fs.f_bsize;
> - }
> - }
> -#ifdef __sparc__
> - /* SPARC Linux needs greater alignment than the pagesize */
> - return QEMU_VMALLOC_ALIGN;
> -#endif
> -#endif
> -
> - return qemu_real_host_page_size();
> -}
> -
> #define OVERCOMMIT_MEMORY_PATH "/proc/sys/vm/overcommit_memory"
> static bool map_noreserve_effective(int fd, uint32_t qemu_map_flags)
> {
- [PATCH v2 0/3] Fix hugepages with memfd on s390x and clean up related code, Thomas Huth, 2022/08/10
- [PATCH v2 3/3] util/mmap-alloc: Remove qemu_mempath_getpagesize(), Thomas Huth, 2022/08/10
- [PATCH v2 1/3] backends/hostmem: Fix support of memory-backend-memfd in qemu_maxrampagesize(), Thomas Huth, 2022/08/10
- [PATCH v2 2/3] softmmu/physmem: Remove the ifdef __linux__ around the pagesize functions, Thomas Huth, 2022/08/10
- Re: [PATCH v2 0/3] Fix hugepages with memfd on s390x and clean up related code, Claudio Imbrenda, 2022/08/10
- Re: [PATCH v2 0/3] Fix hugepages with memfd on s390x and clean up related code, Thomas Huth, 2022/08/26