2019-01-27 02:45:03 +00:00
|
|
|
#include "wsfs/operations.h"
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "wsfs/util.h"
|
2019-01-29 22:11:46 +00:00
|
|
|
#include "wsfs/jsonrpc.h"
|
2019-01-27 02:45:03 +00:00
|
|
|
|
|
|
|
static void* wsfs_operation_init(
|
|
|
|
struct fuse_conn_info * WSFS_UNUSED_PARAM(connection),
|
|
|
|
struct fuse_config * config)
|
|
|
|
{
|
|
|
|
struct fuse_context * const context = fuse_get_context();
|
|
|
|
config->kernel_cache = 1;
|
|
|
|
|
2019-01-29 22:11:46 +00:00
|
|
|
return context->private_data;
|
2019-01-27 11:01:01 +00:00
|
|
|
}
|
|
|
|
|
2019-01-27 02:45:03 +00:00
|
|
|
void wsfs_operations_init(
|
|
|
|
struct fuse_operations * operations)
|
|
|
|
{
|
|
|
|
memset(operations, 0, sizeof(struct fuse_operations));
|
|
|
|
operations->init = &wsfs_operation_init;
|
|
|
|
operations->getattr = &wsfs_operation_getattr;
|
|
|
|
operations->readdir = &wsfs_operation_readdir;
|
2019-01-27 11:01:01 +00:00
|
|
|
operations->open = &wsfs_operation_open;
|
|
|
|
operations->read = &wsfs_operation_read;
|
2019-01-27 02:45:03 +00:00
|
|
|
}
|
|
|
|
|