From fa45f8dab9613993c042176ea2d25552bfebc955 Mon Sep 17 00:00:00 2001 From: Peter Xu Date: Wed, 19 Apr 2023 12:17:36 -0400 Subject: util/mmap-alloc: qemu_fd_getfs() This new helper fetches file system type for a fd. Only Linux is implemented so far. Currently only tmpfs and hugetlbfs are defined, but it can grow as needed. Signed-off-by: Peter Xu Reviewed-by: David Hildenbrand Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela --- include/qemu/mmap-alloc.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/qemu') diff --git a/include/qemu/mmap-alloc.h b/include/qemu/mmap-alloc.h index 2825e23..8344daa 100644 --- a/include/qemu/mmap-alloc.h +++ b/include/qemu/mmap-alloc.h @@ -1,8 +1,15 @@ #ifndef QEMU_MMAP_ALLOC_H #define QEMU_MMAP_ALLOC_H +typedef enum { + QEMU_FS_TYPE_UNKNOWN = 0, + QEMU_FS_TYPE_TMPFS, + QEMU_FS_TYPE_HUGETLBFS, + QEMU_FS_TYPE_NUM, +} QemuFsType; size_t qemu_fd_getpagesize(int fd); +QemuFsType qemu_fd_getfs(int fd); /** * qemu_ram_mmap: mmap anonymous memory, the specified file or device. -- cgit v1.1