2016-10-05 09:33:37 -04:00
|
|
|
/*
|
|
|
|
|
FUSE: Filesystem in Userspace
|
|
|
|
|
Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
|
|
|
|
|
|
|
|
|
|
This program can be distributed under the terms of the GNU LGPLv2.
|
|
|
|
|
See the file COPYING.LIB
|
|
|
|
|
*/
|
|
|
|
|
|
2020-08-08 19:10:36 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
2016-10-05 09:33:37 -04:00
|
|
|
#include "fuse.h"
|
|
|
|
|
#include "fuse_lowlevel.h"
|
2025-09-24 00:51:21 -04:00
|
|
|
#include "fuse_msgbuf_t.h"
|
2022-11-29 17:24:09 -06:00
|
|
|
|
|
|
|
|
#include "extern_c.h"
|
2016-10-05 09:33:37 -04:00
|
|
|
|
2026-03-20 11:03:54 -05:00
|
|
|
#include <atomic>
|
2026-03-10 19:00:58 -05:00
|
|
|
|
2026-02-16 20:55:18 -06:00
|
|
|
/* Simplified fuse_session - fields inlined from former fuse_chan
|
|
|
|
|
* Since mergerfs only supports one mount, we collapse the hierarchy:
|
|
|
|
|
* fuse_session -> fuse_chan -> fd
|
|
|
|
|
* into a single structure with direct fields.
|
|
|
|
|
*/
|
2020-07-31 23:50:47 -04:00
|
|
|
struct fuse_session
|
|
|
|
|
{
|
2022-11-06 00:25:25 -04:00
|
|
|
int (*receive_buf)(struct fuse_session *se,
|
2022-11-29 17:24:09 -06:00
|
|
|
fuse_msgbuf_t *msgbuf);
|
2016-10-05 09:33:37 -04:00
|
|
|
|
2022-11-29 17:24:09 -06:00
|
|
|
void (*process_buf)(struct fuse_session *se,
|
|
|
|
|
const fuse_msgbuf_t *msgbuf);
|
2016-10-05 09:33:37 -04:00
|
|
|
|
2022-11-06 00:25:25 -04:00
|
|
|
void (*destroy)(void *data);
|
2016-10-05 09:33:37 -04:00
|
|
|
|
2022-11-29 17:24:09 -06:00
|
|
|
struct fuse_ll *f;
|
2026-03-20 11:03:54 -05:00
|
|
|
std::atomic<int> exited;
|
2026-02-16 20:55:18 -06:00
|
|
|
|
|
|
|
|
/* Formerly in fuse_chan - inlined for single-mount simplicity */
|
|
|
|
|
int fd; /* /dev/fuse file descriptor */
|
|
|
|
|
size_t bufsize; /* Buffer size for I/O operations */
|
2016-10-05 09:33:37 -04:00
|
|
|
};
|
|
|
|
|
|
2020-07-31 23:50:47 -04:00
|
|
|
struct fuse_notify_req
|
|
|
|
|
{
|
|
|
|
|
uint64_t unique;
|
2021-09-30 23:28:54 -04:00
|
|
|
void (*reply)(struct fuse_notify_req *,
|
2025-10-13 00:21:36 -04:00
|
|
|
fuse_req_t*,
|
2021-09-30 23:28:54 -04:00
|
|
|
uint64_t,
|
2022-11-08 23:43:59 -05:00
|
|
|
const void *);
|
2020-07-31 23:50:47 -04:00
|
|
|
struct fuse_notify_req *next;
|
|
|
|
|
struct fuse_notify_req *prev;
|
2016-10-05 09:33:37 -04:00
|
|
|
};
|
|
|
|
|
|
2026-02-16 20:55:18 -06:00
|
|
|
|
2016-10-05 09:33:37 -04:00
|
|
|
|
2022-11-29 17:24:09 -06:00
|
|
|
EXTERN_C_BEGIN
|
|
|
|
|
|
2016-10-05 09:33:37 -04:00
|
|
|
struct fuse_session *fuse_lowlevel_new_common(struct fuse_args *args,
|
2020-07-31 23:50:47 -04:00
|
|
|
const struct fuse_lowlevel_ops *op,
|
|
|
|
|
size_t op_size, void *userdata);
|
2016-10-05 09:33:37 -04:00
|
|
|
|
2022-11-29 17:24:09 -06:00
|
|
|
EXTERN_C_END
|