From 4a653a8bc060c56fd5446336ea6b55c512e5a64c Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Wed, 25 Jul 2018 10:04:23 -0700 Subject: [PATCH] dll: fuse3: testing --- src/dll/fuse/library.h | 2 +- src/dll/fuse3/fuse2to3.c | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/dll/fuse/library.h b/src/dll/fuse/library.h index 8a40b055..c7b544cb 100644 --- a/src/dll/fuse/library.h +++ b/src/dll/fuse/library.h @@ -56,12 +56,12 @@ struct fuse FSP_FILE_SYSTEM *FileSystem; FSP_SERVICE *Service; /* weak */ volatile int exited; + struct fuse3 *fuse3; }; struct fsp_fuse_context_header { char *PosixPath; - struct fuse3 *fuse3; __declspec(align(MEMORY_ALLOCATION_ALIGNMENT)) UINT8 ContextBuf[]; }; diff --git a/src/dll/fuse3/fuse2to3.c b/src/dll/fuse3/fuse2to3.c index e5eee1de..ead8de3b 100644 --- a/src/dll/fuse3/fuse2to3.c +++ b/src/dll/fuse3/fuse2to3.c @@ -19,7 +19,7 @@ static inline struct fuse3 *fuse2to3_getfuse3(void) { - return FSP_FUSE_HDR_FROM_CONTEXT(fsp_fuse_get_context_internal())->fuse3; + return fsp_fuse_get_context_internal()->fuse->fuse3; } static inline void fuse2to3_fi2from3(struct fuse_file_info *fi, struct fuse3_file_info *fi3) @@ -280,11 +280,8 @@ static int fuse2to3_fsyncdir(const char *path, int datasync, struct fuse_file_in static void *fuse2to3_init(struct fuse_conn_info *conn) { struct fuse_context *context = fsp_fuse_get_context_internal(); - struct fuse3 *f3 = context->private_data; struct fuse *f = context->fuse; - - FSP_FUSE_HDR_FROM_CONTEXT(context)->fuse3 = f3; - context->private_data = f->data = f3->data; + struct fuse3 *f3 = f->fuse3; struct fuse3_conn_info conn3; fuse2to3_conn3from2(&conn3, conn); @@ -602,7 +599,7 @@ FSP_FUSE_API int fsp_fuse3_mount(struct fsp_fuse_env *env, if (0 == ch) goto fail; - f = fsp_fuse_new(env, ch, &f3->args, &fuse2to3_ops, sizeof fuse2to3_ops, f3); + f = fsp_fuse_new(env, ch, &f3->args, &fuse2to3_ops, sizeof fuse2to3_ops, f3->data); if (0 == f) goto fail; @@ -620,6 +617,7 @@ FSP_FUSE_API int fsp_fuse3_mount(struct fsp_fuse_env *env, /* Free the args which are no longer needed. */ fsp_fuse_opt_free_args(env, &f3->args); + f->fuse3 = f3; f3->fuse = f; return 0;