diff options
author | Peter Xu <peterx@redhat.com> | 2023-04-19 12:17:36 -0400 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2023-04-24 11:29:00 +0200 |
commit | fa45f8dab9613993c042176ea2d25552bfebc955 (patch) | |
tree | 09908fc64511b6020efff4f8539998f65cfc75b2 /include/qemu | |
parent | 403d18ae384239876764bbfa111d6cc5dcb673d1 (diff) | |
download | qemu-fa45f8dab9613993c042176ea2d25552bfebc955.zip qemu-fa45f8dab9613993c042176ea2d25552bfebc955.tar.gz qemu-fa45f8dab9613993c042176ea2d25552bfebc955.tar.bz2 |
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 <peterx@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'include/qemu')
-rw-r--r-- | include/qemu/mmap-alloc.h | 7 |
1 files changed, 7 insertions, 0 deletions
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. |