2020-04-04 21:16:25 +00:00
|
|
|
#include "webfuse/adapter/impl/operation/close.h"
|
|
|
|
#include "webfuse/adapter/impl/operation/context.h"
|
2019-03-26 22:04:53 +00:00
|
|
|
|
|
|
|
#include <limits.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <jansson.h>
|
|
|
|
|
2020-03-29 15:40:33 +00:00
|
|
|
#include "webfuse/core/jsonrpc/proxy.h"
|
2019-03-26 22:04:53 +00:00
|
|
|
#include "webfuse/core/util.h"
|
|
|
|
|
|
|
|
void wf_impl_operation_close(
|
|
|
|
fuse_req_t request,
|
|
|
|
fuse_ino_t inode,
|
|
|
|
struct fuse_file_info * file_info)
|
|
|
|
{
|
2020-04-04 21:27:34 +00:00
|
|
|
struct wf_impl_operation_context * user_data = fuse_req_userdata(request);
|
|
|
|
struct wf_jsonrpc_proxy * rpc = wf_impl_operation_context_get_proxy(user_data);
|
2019-03-26 22:04:53 +00:00
|
|
|
|
2019-04-01 20:15:12 +00:00
|
|
|
if (NULL != rpc)
|
|
|
|
{
|
|
|
|
int handle = (int) (file_info->fh & INT_MAX);
|
2020-03-01 15:55:58 +00:00
|
|
|
wf_jsonrpc_proxy_notify(rpc, "close", "siii", user_data->name, inode, handle, file_info->flags);
|
2019-04-01 20:15:12 +00:00
|
|
|
}
|
|
|
|
|
2019-03-26 22:04:53 +00:00
|
|
|
fuse_reply_err(request, 0);
|
|
|
|
}
|