]> git.proxmox.com Git - mirror_qemu.git/commitdiff
util/mmap-alloc: Remove qemu_mempath_getpagesize()
authorThomas Huth <thuth@redhat.com>
Wed, 10 Aug 2022 12:57:20 +0000 (14:57 +0200)
committerThomas Huth <thuth@redhat.com>
Fri, 26 Aug 2022 11:34:21 +0000 (13:34 +0200)
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>
include/qemu/mmap-alloc.h
util/mmap-alloc.c

index 5076695cc8115e873d844f1e6bdbab37212bb675..2825e231a723e513ca55ef206103f84238c068c4 100644 (file)
@@ -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.
  *
index 5b90cb68ea7d5e811283d513b5b1f7b078f35915..5ed7d29183ec8c8cc1eb8f6a664a34c4b04b1476 100644 (file)
@@ -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)
 {