[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 23/26] DAX:virtiofsd: implement FUSE_INIT map_alignment field
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PATCH v3 23/26] DAX:virtiofsd: implement FUSE_INIT map_alignment field |
Date: |
Wed, 28 Apr 2021 12:00:57 +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 6930574aaf..50fc5c8d5a 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 v3 11/26] DAX: virtiofsd Add cache accessor functions, (continued)
- [PATCH v3 11/26] DAX: virtiofsd Add cache accessor functions, Dr. David Alan Gilbert (git), 2021/04/28
- [PATCH v3 12/26] DAX: virtiofsd: Add setup/remove mappings fuse commands, Dr. David Alan Gilbert (git), 2021/04/28
- [PATCH v3 14/26] DAX: virtiofsd: Wire up passthrough_ll's lo_setupmapping, Dr. David Alan Gilbert (git), 2021/04/28
- [PATCH v3 13/26] DAX: virtiofsd: Add setup/remove mapping handlers to passthrough_ll, Dr. David Alan Gilbert (git), 2021/04/28
- [PATCH v3 15/26] DAX: virtiofsd: Make lo_removemapping() work, Dr. David Alan Gilbert (git), 2021/04/28
- [PATCH v3 16/26] DAX: virtiofsd: route se down to destroy method, Dr. David Alan Gilbert (git), 2021/04/28
- [PATCH v3 17/26] DAX: virtiofsd: Perform an unmap on destroy, Dr. David Alan Gilbert (git), 2021/04/28
- [PATCH v3 18/26] DAX/unmap: virtiofsd: Add VHOST_USER_SLAVE_FS_IO, Dr. David Alan Gilbert (git), 2021/04/28
- [PATCH v3 19/26] DAX/unmap virtiofsd: Add wrappers for VHOST_USER_SLAVE_FS_IO, Dr. David Alan Gilbert (git), 2021/04/28
- [PATCH v3 21/26] DAX/unmap virtiofsd: Route unmappable reads, Dr. David Alan Gilbert (git), 2021/04/28
- [PATCH v3 23/26] DAX:virtiofsd: implement FUSE_INIT map_alignment field,
Dr. David Alan Gilbert (git) <=
- [PATCH v3 20/26] DAX/unmap virtiofsd: Parse unmappable elements, Dr. David Alan Gilbert (git), 2021/04/28
- [PATCH v3 22/26] DAX/unmap virtiofsd: route unmappable write to slave command, Dr. David Alan Gilbert (git), 2021/04/28
- [PATCH v3 24/26] vhost-user-fs: Extend VhostUserFSSlaveMsg to pass additional info, Dr. David Alan Gilbert (git), 2021/04/28
- [PATCH v3 25/26] vhost-user-fs: Implement drop CAP_FSETID functionality, Dr. David Alan Gilbert (git), 2021/04/28
- [PATCH v3 26/26] virtiofsd: Ask qemu to drop CAP_FSETID if client asked for it, Dr. David Alan Gilbert (git), 2021/04/28
- Re: [PATCH v3 00/26] virtiofs dax patches, no-reply, 2021/04/28