Skip to content

Commit

Permalink
Reverting the loop config settings
Browse files Browse the repository at this point in the history
  • Loading branch information
silverdaz committed Dec 8, 2024
1 parent a2f5ae3 commit 0fa8eab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
1 change: 0 additions & 1 deletion src/includes.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ struct fs_config {
/* multithreaded */
int singlethread;
int clone_fd;
int max_threads;
int max_idle_threads;
};

Expand Down
21 changes: 8 additions & 13 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static struct fuse_opt fs_opts[] = {
/* if multithreaded */
CRYPT4GH_SQLITE_OPT("-s" , singlethread , 1),
CRYPT4GH_SQLITE_OPT("clone_fd" , clone_fd , 1),
CRYPT4GH_SQLITE_OPT("max_threads=%u", max_threads, 0),
CRYPT4GH_SQLITE_OPT("max_idle_threads=%u", max_idle_threads, 0),

CRYPT4GH_SQLITE_OPT("entry_timeout=%lf", entry_timeout, 0),
CRYPT4GH_SQLITE_OPT("attr_timeout=%lf", attr_timeout, 0),
Expand Down Expand Up @@ -286,8 +286,7 @@ int main(int argc, char *argv[])
config.singlethread = 0;
config.foreground = 0;
config.mounted_at = time(NULL);
config.max_idle_threads = UINT_MAX;
config.max_threads = DEFAULT_MAX_THREADS;
config.max_idle_threads = DEFAULT_MAX_THREADS;
config.entry_timeout = DEFAULT_ENTRY_TIMEOUT;
config.attr_timeout = DEFAULT_ATTR_TIMEOUT;

Expand Down Expand Up @@ -423,16 +422,12 @@ int main(int argc, char *argv[])
D2("Mode: single-threaded");
res = fuse_session_loop(se);
} else {
res = 0;
struct fuse_loop_config *cf = fuse_loop_cfg_create();
if(cf){
fuse_loop_cfg_set_idle_threads(cf, config.max_idle_threads);
fuse_loop_cfg_set_max_threads(cf, config.max_threads);
fuse_loop_cfg_set_clone_fd(cf, config.clone_fd);
D2("Mode: multi-threaded (max idle threads: %d)", config.max_threads);
res = fuse_session_loop_mt(se, cf);
fuse_loop_cfg_destroy(cf);
}
struct fuse_loop_config cf = {
.clone_fd = config.clone_fd,
.max_idle_threads = config.max_idle_threads,
};
D2("Mode: multi-threaded (max idle threads: %d)", cf.max_idle_threads);
res = fuse_session_loop_mt(se, &cf);
}

bailout_unmount:
Expand Down

0 comments on commit 0fa8eab

Please sign in to comment.