mirror of
https://github.com/falk-werner/webfuse-provider
synced 2024-10-27 20:44:10 +00:00
make fuse low level timeout configurable
This commit is contained in:
parent
8960f1ff64
commit
d4b0912ef1
@ -20,7 +20,8 @@ extern void wsfs_operation_ll_getattr (
|
||||
printf("getattr: inode=%lu\n", inode);
|
||||
|
||||
struct fuse_ctx const * context = fuse_req_ctx(request);
|
||||
struct wsfs_jsonrpc * rpc = fuse_req_userdata(request);
|
||||
struct wsfs_operations_context * user_data = fuse_req_userdata(request);
|
||||
struct wsfs_jsonrpc * rpc = user_data->rpc;
|
||||
|
||||
struct stat buffer;
|
||||
json_t * data = NULL;
|
||||
@ -64,7 +65,7 @@ extern void wsfs_operation_ll_getattr (
|
||||
|
||||
if (WSFS_GOOD == status)
|
||||
{
|
||||
fuse_reply_attr(request, &buffer, 1.0);
|
||||
fuse_reply_attr(request, &buffer, user_data->timeout);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -57,7 +57,11 @@ int wsfs_operations_loop_ll(
|
||||
const int argc = 1;
|
||||
char * argv[] = {"", NULL};
|
||||
struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
|
||||
struct fuse_session * session = fuse_session_new(&args, &operations, sizeof(operations), rpc);
|
||||
struct wsfs_operations_context context = {
|
||||
.rpc = rpc,
|
||||
.timeout = 1.0
|
||||
};
|
||||
struct fuse_session * session = fuse_session_new(&args, &operations, sizeof(operations), &context);
|
||||
if (NULL != session)
|
||||
{
|
||||
fuse_set_signal_handlers(session);
|
||||
|
@ -5,6 +5,12 @@
|
||||
|
||||
struct wsfs_jsonrpc;
|
||||
|
||||
struct wsfs_operations_context
|
||||
{
|
||||
struct wsfs_jsonrpc * rpc;
|
||||
double timeout;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user