[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 16/25] DAX: virtiofsd: Perform an unmap on destroy
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PATCH v2 16/25] DAX: virtiofsd: Perform an unmap on destroy |
Date: |
Wed, 14 Apr 2021 16:51:28 +0100 |
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Force unmap all remaining dax cache entries on a destroy.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
tools/virtiofsd/passthrough_ll.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index 910c4831fb..726343677e 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -3128,6 +3128,20 @@ static void lo_destroy(void *userdata, struct
fuse_session *se)
{
struct lo_data *lo = (struct lo_data *)userdata;
+ if (fuse_lowlevel_is_virtio(se)) {
+ VhostUserFSSlaveMsg *msg = g_malloc0(sizeof(VhostUserFSSlaveMsg) +
+ sizeof(VhostUserFSSlaveMsgEntry));
+
+ msg->count = 0;
+ msg->entries[0].len = ~(uint64_t)0; /* Special: means 'all' */
+ msg->entries[0].c_offset = 0;
+ if (fuse_virtio_unmap(se, msg)) {
+ fuse_log(FUSE_LOG_ERR, "%s: unmap during destroy failed\n",
+ __func__);
+ }
+ g_free(msg);
+ }
+
pthread_mutex_lock(&lo->mutex);
while (true) {
GHashTableIter iter;
--
2.31.1
- [PATCH v2 10/25] DAX: virtiofsd Add cache accessor functions, (continued)
- [PATCH v2 10/25] DAX: virtiofsd Add cache accessor functions, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 08/25] DAX: virtio-fs: Add vhost-user slave commands for mapping, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 07/25] DAX: virtio-fs: Add cache BAR, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 09/25] DAX: virtio-fs: Fill in slave commands for mapping, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 12/25] DAX: virtiofsd: Add setup/remove mapping handlers to passthrough_ll, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 06/25] DAX: virtio: Add shared memory capability, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 13/25] DAX: virtiofsd: Wire up passthrough_ll's lo_setupmapping, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 14/25] DAX: virtiofsd: Make lo_removemapping() work, Dr. David Alan Gilbert (git), 2021/04/14
- [PATCH v2 16/25] DAX: virtiofsd: Perform an unmap on destroy,
Dr. David Alan Gilbert (git) <=
- [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