mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-25 09:26:25 -05:00
Auto-commit fuse.cpp
This commit is contained in:
parent
d5a2187713
commit
02da8efbff
37 changed files with 374 additions and 267 deletions
|
|
@ -86,6 +86,11 @@ struct AsyncWorker
|
|||
fuse_msgbuf_t *msgbuf;
|
||||
|
||||
msgbuf = msgbuf_alloc();
|
||||
if(not msgbuf)
|
||||
{
|
||||
fmt::println(stderr,"mergerfs: failure to allocate msgbuf, exiting");
|
||||
return;
|
||||
}
|
||||
|
||||
while(true)
|
||||
{
|
||||
|
|
@ -141,6 +146,11 @@ struct SyncWorker
|
|||
fuse_msgbuf_t *msgbuf;
|
||||
|
||||
msgbuf = msgbuf_alloc();
|
||||
if(not msgbuf)
|
||||
{
|
||||
fmt::println(stderr,"mergerfs: failure to allocate msgbuf, exiting");
|
||||
return;
|
||||
}
|
||||
|
||||
while(true)
|
||||
{
|
||||
|
|
@ -166,31 +176,6 @@ struct SyncWorker
|
|||
}
|
||||
};
|
||||
|
||||
int
|
||||
fuse_start_thread(pthread_t *thread_id,
|
||||
void *(*func)(void *),
|
||||
void *arg)
|
||||
{
|
||||
int res;
|
||||
sigset_t oldset;
|
||||
sigset_t newset;
|
||||
|
||||
sigfillset(&newset);
|
||||
pthread_sigmask(SIG_BLOCK,&newset,&oldset);
|
||||
res = pthread_create(thread_id,NULL,func,arg);
|
||||
pthread_sigmask(SIG_SETMASK,&oldset,NULL);
|
||||
|
||||
if(res != 0)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"fuse: error creating thread: %s\n",
|
||||
strerror(res));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
int
|
||||
_calculate_thread_count(const int raw_thread_count_)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue