[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 22/25] DAX:virtiofsd: implement FUSE_INIT map_alignment field
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PATCH v2 22/25] DAX:virtiofsd: implement FUSE_INIT map_alignment field |
Date: |
Wed, 14 Apr 2021 16:51:34 +0100 |
From: Stefan Hajnoczi <stefanha@redhat.com>
Communicate the host page size to the FUSE client so that
FUSE_SETUPMAPPING/FUSE_REMOVEMAPPING requests are aware of our alignment
constraints.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
tools/virtiofsd/fuse_lowlevel.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c
index e82edce72a..08999a6bc5 100644
--- a/tools/virtiofsd/fuse_lowlevel.c
+++ b/tools/virtiofsd/fuse_lowlevel.c
@@ -10,6 +10,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/host-utils.h"
#include "fuse_i.h"
#include "standard-headers/linux/fuse.h"
#include "fuse_misc.h"
@@ -2194,6 +2195,12 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid,
outarg.max_background = se->conn.max_background;
outarg.congestion_threshold = se->conn.congestion_threshold;
outarg.time_gran = se->conn.time_gran;
+ if (arg->flags & FUSE_MAP_ALIGNMENT) {
+ outarg.flags |= FUSE_MAP_ALIGNMENT;
+
+ /* This constraint comes from mmap(2) and munmap(2) */
+ outarg.map_alignment = ctz64(sysconf(_SC_PAGE_SIZE));
+ }
if (se->conn.want & FUSE_CAP_HANDLE_KILLPRIV_V2) {
outarg.flags |= FUSE_HANDLE_KILLPRIV_V2;
@@ -2207,6 +2214,7 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid,
fuse_log(FUSE_LOG_DEBUG, " congestion_threshold=%i\n",
outarg.congestion_threshold);
fuse_log(FUSE_LOG_DEBUG, " time_gran=%u\n", outarg.time_gran);
+ fuse_log(FUSE_LOG_DEBUG, " map_alignment=%u\n", outarg.map_alignment);
send_reply_ok(req, &outarg, outargsize);
}
--
2.31.1
- [PATCH v2 16/25] DAX: virtiofsd: Perform an unmap on destroy, (continued)
- [PATCH v2 16/25] DAX: virtiofsd: Perform an unmap on destroy, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 15/25] DAX: virtiofsd: route se down to destroy method, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 17/25] DAX/unmap: virtiofsd: Add VHOST_USER_SLAVE_FS_IO, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 18/25] DAX/unmap virtiofsd: Add wrappers for VHOST_USER_SLAVE_FS_IO, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 20/25] DAX/unmap virtiofsd: Route unmappable reads, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 24/25] vhost-user-fs: Implement drop CAP_FSETID functionality, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 25/25] virtiofsd: Ask qemu to drop CAP_FSETID if client asked for it, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 21/25] DAX/unmap virtiofsd: route unmappable write to slave command, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 11/25] DAX: virtiofsd: Add setup/remove mappings fuse commands, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 23/25] vhost-user-fs: Extend VhostUserFSSlaveMsg to pass additional info, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 22/25] DAX:virtiofsd: implement FUSE_INIT map_alignment field,
Dr. David Alan Gilbert (git) <=
- [PATCH v2 19/25] DAX/unmap virtiofsd: Parse unmappable elements, Dr. David Alan Gilbert (git), 2021/04/14