From 32e325e72f2e3f6310b74137ffa7ab7ec21d892f Mon Sep 17 00:00:00 2001 From: Falk Werner Date: Sat, 2 Feb 2019 11:45:38 +0100 Subject: [PATCH] added fuse low level operation stubs --- CMakeLists.txt | 6 +++++ src/wsfs/operation/ll_close.c | 11 +++++++++ src/wsfs/operation/ll_getattr.c | 11 +++++++++ src/wsfs/operation/ll_lookup.c | 11 +++++++++ src/wsfs/operation/ll_open.c | 11 +++++++++ src/wsfs/operation/ll_read.c | 13 +++++++++++ src/wsfs/operation/ll_readdir.c | 13 +++++++++++ src/wsfs/operations.c | 17 ++++++++++++++ src/wsfs/operations.h | 40 ++++++++++++++++++++++++++++++++- 9 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 src/wsfs/operation/ll_close.c create mode 100644 src/wsfs/operation/ll_getattr.c create mode 100644 src/wsfs/operation/ll_lookup.c create mode 100644 src/wsfs/operation/ll_open.c create mode 100644 src/wsfs/operation/ll_read.c create mode 100644 src/wsfs/operation/ll_readdir.c diff --git a/CMakeLists.txt b/CMakeLists.txt index cffc30b..f008059 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,6 +49,12 @@ add_library(fuse-wsfs src/wsfs/operation/open.c src/wsfs/operation/close.c src/wsfs/operation/read.c + src/wsfs/operation/ll_lookup.c + src/wsfs/operation/ll_getattr.c + src/wsfs/operation/ll_readdir.c + src/wsfs/operation/ll_open.c + src/wsfs/operation/ll_close.c + src/wsfs/operation/ll_read.c src/wsfs/response_parser.c src/wsfs/server.c src/wsfs/protocol.c diff --git a/src/wsfs/operation/ll_close.c b/src/wsfs/operation/ll_close.c new file mode 100644 index 0000000..61c7452 --- /dev/null +++ b/src/wsfs/operation/ll_close.c @@ -0,0 +1,11 @@ +#include "wsfs/operations.h" +#include +#include "wsfs/util.h" + +void wsfs_operation_ll_close( + fuse_req_t request, + fuse_ino_t WSFS_UNUSED_PARAM(inode), + struct fuse_file_info * WSFS_UNUSED_PARAM(file_info)) +{ + fuse_reply_err(request, ENOENT); +} diff --git a/src/wsfs/operation/ll_getattr.c b/src/wsfs/operation/ll_getattr.c new file mode 100644 index 0000000..1f392fc --- /dev/null +++ b/src/wsfs/operation/ll_getattr.c @@ -0,0 +1,11 @@ +#include "wsfs/operations.h" +#include +#include "wsfs/util.h" + +extern void wsfs_operation_ll_getattr ( + fuse_req_t request, + fuse_ino_t WSFS_UNUSED_PARAM(inode), + struct fuse_file_info * WSFS_UNUSED_PARAM(file_info)) +{ + fuse_reply_err(request, ENOENT); +} diff --git a/src/wsfs/operation/ll_lookup.c b/src/wsfs/operation/ll_lookup.c new file mode 100644 index 0000000..7ddf49f --- /dev/null +++ b/src/wsfs/operation/ll_lookup.c @@ -0,0 +1,11 @@ +#include "wsfs/operations.h" +#include +#include "wsfs/util.h" + +void wsfs_operation_ll_lookup ( + fuse_req_t request, + fuse_ino_t WSFS_UNUSED_PARAM(parent), + char const * WSFS_UNUSED_PARAM(name)) +{ + fuse_reply_err(request, ENOENT); +} diff --git a/src/wsfs/operation/ll_open.c b/src/wsfs/operation/ll_open.c new file mode 100644 index 0000000..51e268e --- /dev/null +++ b/src/wsfs/operation/ll_open.c @@ -0,0 +1,11 @@ +#include "wsfs/operations.h" +#include +#include "wsfs/util.h" + +void wsfs_operation_ll_open( + fuse_req_t request, + fuse_ino_t WSFS_UNUSED_PARAM(inode), + struct fuse_file_info * WSFS_UNUSED_PARAM(file_info)) +{ + fuse_reply_err(request, ENOENT); +} diff --git a/src/wsfs/operation/ll_read.c b/src/wsfs/operation/ll_read.c new file mode 100644 index 0000000..0566ea2 --- /dev/null +++ b/src/wsfs/operation/ll_read.c @@ -0,0 +1,13 @@ +#include "wsfs/operations.h" +#include +#include "wsfs/util.h" + +void wsfs_operation_ll_read( + fuse_req_t request, + fuse_ino_t WSFS_UNUSED_PARAM(inode), + size_t WSFS_UNUSED_PARAM(size), + off_t WSFS_UNUSED_PARAM(offset), + struct fuse_file_info * WSFS_UNUSED_PARAM(file_info)) +{ + fuse_reply_err(request, ENOENT); +} diff --git a/src/wsfs/operation/ll_readdir.c b/src/wsfs/operation/ll_readdir.c new file mode 100644 index 0000000..004da83 --- /dev/null +++ b/src/wsfs/operation/ll_readdir.c @@ -0,0 +1,13 @@ +#include "wsfs/operations.h" +#include +#include "wsfs/util.h" + +void wsfs_operation_ll_readdir ( + fuse_req_t request, + fuse_ino_t WSFS_UNUSED_PARAM(inode), + size_t WSFS_UNUSED_PARAM(size), + off_t WSFS_UNUSED_PARAM(offset), + struct fuse_file_info * WSFS_UNUSED_PARAM(file_info)) +{ + fuse_reply_err(request, ENOENT); +} diff --git a/src/wsfs/operations.c b/src/wsfs/operations.c index 73ad029..c28380f 100644 --- a/src/wsfs/operations.c +++ b/src/wsfs/operations.c @@ -39,3 +39,20 @@ int wsfs_operations_loop( return result; } + +int wsfs_operations_loop_ll( + char * WSFS_UNUSED_PARAM(mount_point), + struct wsfs_jsonrpc * WSFS_UNUSED_PARAM(rpc)) +{ + struct fuse_lowlevel_ops operations; + memset(&operations, 0, sizeof(struct fuse_lowlevel_ops)); + operations.lookup = &wsfs_operation_ll_lookup; + operations.getattr = &wsfs_operation_ll_getattr; + operations.readdir = &wsfs_operation_ll_readdir; + operations.open = &wsfs_operation_ll_open; + operations.release = &wsfs_operation_ll_close; + operations.read = &wsfs_operation_ll_read; + + + return 0; +} \ No newline at end of file diff --git a/src/wsfs/operations.h b/src/wsfs/operations.h index 38a9c00..7f3b9b2 100644 --- a/src/wsfs/operations.h +++ b/src/wsfs/operations.h @@ -40,7 +40,45 @@ extern int wsfs_operation_read( size_t buffer_size, off_t offset, struct fuse_file_info * file_info); - + +// low level operations + +extern int wsfs_operations_loop_ll( + char * mount_point, + struct wsfs_jsonrpc * rpc); + +extern void wsfs_operation_ll_lookup ( + fuse_req_t req, + fuse_ino_t parent, + char const * name); + +extern void wsfs_operation_ll_getattr ( + fuse_req_t request, + fuse_ino_t inode, + struct fuse_file_info *file_info); + +extern void wsfs_operation_ll_readdir ( + fuse_req_t request, + fuse_ino_t inode, + size_t size, + off_t offset, + struct fuse_file_info *file_info); + +extern void wsfs_operation_ll_open( + fuse_req_t request, + fuse_ino_t inode, + struct fuse_file_info * file_info); + +extern void wsfs_operation_ll_close( + fuse_req_t request, + fuse_ino_t inode, + struct fuse_file_info * file_info); + +extern void wsfs_operation_ll_read( + fuse_req_t request, + fuse_ino_t ino, size_t size, off_t off, + struct fuse_file_info *fi); + #ifdef __cplusplus } #endif