1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-10-27 20:44:10 +00:00

added fuse low level operation stubs

This commit is contained in:
Falk Werner 2019-02-02 11:45:38 +01:00
parent ee97af3519
commit 32e325e72f
9 changed files with 132 additions and 1 deletions

View File

@ -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

View File

@ -0,0 +1,11 @@
#include "wsfs/operations.h"
#include <errno.h>
#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);
}

View File

@ -0,0 +1,11 @@
#include "wsfs/operations.h"
#include <errno.h>
#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);
}

View File

@ -0,0 +1,11 @@
#include "wsfs/operations.h"
#include <errno.h>
#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);
}

View File

@ -0,0 +1,11 @@
#include "wsfs/operations.h"
#include <errno.h>
#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);
}

View File

@ -0,0 +1,13 @@
#include "wsfs/operations.h"
#include <errno.h>
#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);
}

View File

@ -0,0 +1,13 @@
#include "wsfs/operations.h"
#include <errno.h>
#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);
}

View File

@ -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;
}

View File

@ -41,6 +41,44 @@ extern int wsfs_operation_read(
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