Browse Source

Allow setting of passthrough max_stack_depth

passthrough-depth
Antonio SJ Musumeci 1 month ago
parent
commit
4b580522c1
  1. 16
      libfuse/lib/debug.cpp
  2. 1
      libfuse/lib/fuse_i.h
  3. 5
      libfuse/lib/fuse_lowlevel.cpp
  4. 1
      src/config.hpp

16
libfuse/lib/debug.cpp

@ -861,11 +861,25 @@ fuse_syslog_fuse_init_out(const struct fuse_init_out *arg_)
output = fmt::format("fuse_init_out:"
" major={};"
" minor={};"
" max_readahead={};"
" max_background={};"
" congestion_threshold={};"
" max_write={};"
" time_gran={};"
" max_pages={};"
" map_alignment={};"
" max_stack_depth={};"
" flags=(",
arg_->major,
arg_->minor,
arg_->max_pages);
arg_->max_readahead,
arg_->max_background,
arg_->congestion_threshold,
arg_->max_write,
arg_->time_gran,
arg_->max_pages,
arg_->map_alignment,
arg_->max_stack_depth);
for(uint64_t i = 0; i < (sizeof(flags)*8); i++)
{

1
libfuse/lib/fuse_i.h

@ -69,6 +69,7 @@ struct fuse_ll
int broken_splice_nonblock;
uint64_t notify_ctr;
struct fuse_notify_req notify_list;
int passthrough_max_stack_depth;
};
struct fuse_cmd

5
libfuse/lib/fuse_lowlevel.cpp

@ -1117,7 +1117,7 @@ do_init(fuse_req_t req,
struct fuse_in_header *hdr_)
{
struct fuse_init_out outarg = {0};
struct fuse_init_in *arg = (struct fuse_init_in *) &hdr_[1];
struct fuse_init_in *arg = (struct fuse_init_in*)&hdr_[1];
struct fuse_ll *f = req->f;
size_t bufsize = fuse_chan_bufsize(req->ch);
uint64_t inargflags;
@ -1288,7 +1288,7 @@ do_init(fuse_req_t req,
if(f->conn.want & FUSE_CAP_PASSTHROUGH)
{
outargflags |= FUSE_PASSTHROUGH;
outarg.max_stack_depth = 2;
outarg.max_stack_depth = (f->passthrough_max_stack_depth + 1);
}
if(inargflags & FUSE_INIT_EXT)
@ -1800,6 +1800,7 @@ enum {
static const struct fuse_opt fuse_ll_opts[] =
{
{ "passthrough-max-stack-depth=%u", offsetof(struct fuse_ll, passthrough_max_stack_depth), 0 },
{ "debug", offsetof(struct fuse_ll, debug), 1 },
{ "-d", offsetof(struct fuse_ll, debug), 1 },
{ "max_readahead=%u", offsetof(struct fuse_ll, conn.max_readahead), 0 },

1
src/config.hpp

@ -124,6 +124,7 @@ public:
NFSOpenHack nfsopenhack;
ConfigBOOL nullrw;
Passthrough passthrough = Passthrough::ENUM::OFF;
ConfigINT passthrough_depth = 1;
ConfigBOOL parallel_direct_writes;
ConfigGetPid pid;
ConfigBOOL posix_acl;

Loading…
Cancel
Save