aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2022-08-10 14:57:20 +0200
committerThomas Huth <thuth@redhat.com>2022-08-26 13:34:21 +0200
commit90d994619383c2665cf4f4712872c43ad2728bec (patch)
tree2c68c465b97b00192b2a3c5e035578b5104fd812
parent90de559a669b99919e2a95ee85cb6b9b2e7256cb (diff)
downloadqemu-90d994619383c2665cf4f4712872c43ad2728bec.zip
qemu-90d994619383c2665cf4f4712872c43ad2728bec.tar.gz
qemu-90d994619383c2665cf4f4712872c43ad2728bec.tar.bz2
util/mmap-alloc: Remove qemu_mempath_getpagesize()
The last user of this function has just been removed, so we can drop this function now, too. Message-Id: <20220810125720.3849835-4-thuth@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
-rw-r--r--include/qemu/mmap-alloc.h2
-rw-r--r--util/mmap-alloc.c31
2 files changed, 0 insertions, 33 deletions
diff --git a/include/qemu/mmap-alloc.h b/include/qemu/mmap-alloc.h
index 5076695..2825e23 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 5b90cb6..5ed7d29 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)
{