Updated example code to work with new API (#547)

This commit is contained in:
AKowshik 2020-09-10 00:47:06 +05:30 committed by GitHub
parent dfb4054bb7
commit 86f40b8584
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 42 additions and 18 deletions

View File

@ -18,7 +18,7 @@
* \include hello_ll.c
*/
#define FUSE_USE_VERSION 31
#define FUSE_USE_VERSION 34
#include <fuse_lowlevel.h>
#include <stdio.h>
@ -166,6 +166,7 @@ int main(int argc, char *argv[])
struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
struct fuse_session *se;
struct fuse_cmdline_opts opts;
struct fuse_loop_config config;
int ret = -1;
if (fuse_parse_cmdline(&args, &opts) != 0)
@ -206,8 +207,11 @@ int main(int argc, char *argv[])
/* Block until ctrl+c or fusermount -u */
if (opts.singlethread)
ret = fuse_session_loop(se);
else
ret = fuse_session_loop_mt(se, opts.clone_fd);
else {
config.clone_fd = opts.clone_fd;
config.max_idle_threads = opts.max_idle_threads;
ret = fuse_session_loop_mt(se, &config);
}
fuse_session_unmount(se);
err_out3:

View File

@ -25,7 +25,7 @@
* \include @file
*/
#define FUSE_USE_VERSION 31
#define FUSE_USE_VERSION 34
#include <fuse.h>
#include <fuse_lowlevel.h> /* for fuse_cmdline_opts */
@ -212,6 +212,7 @@ int main(int argc, char *argv[]) {
struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
struct fuse *fuse;
struct fuse_cmdline_opts opts;
struct fuse_loop_config config;
int res;
/* Initialize the files */
@ -271,8 +272,11 @@ int main(int argc, char *argv[]) {
if (opts.singlethread)
res = fuse_loop(fuse);
else
res = fuse_loop_mt(fuse, opts.clone_fd);
else {
config.clone_fd = opts.clone_fd;
config.max_idle_threads = opts.max_idle_threads;
res = fuse_loop_mt(fuse, &config);
}
if (res)
res = 1;

View File

@ -73,7 +73,7 @@
*/
#define FUSE_USE_VERSION 31
#define FUSE_USE_VERSION 34
#include <fuse_lowlevel.h>
#include <stdio.h>
@ -273,6 +273,7 @@ int main(int argc, char *argv[]) {
struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
struct fuse_session *se;
struct fuse_cmdline_opts opts;
struct fuse_loop_config config;
pthread_t updater;
int ret = -1;
@ -321,8 +322,11 @@ int main(int argc, char *argv[]) {
/* Block until ctrl+c or fusermount -u */
if (opts.singlethread)
ret = fuse_session_loop(se);
else
ret = fuse_session_loop_mt(se, opts.clone_fd);
else {
config.clone_fd = opts.clone_fd;
config.max_idle_threads = opts.max_idle_threads;
ret = fuse_session_loop_mt(se, &config);
}
fuse_session_unmount(se);
err_out3:

View File

@ -59,7 +59,7 @@
*/
#define FUSE_USE_VERSION 31
#define FUSE_USE_VERSION 34
#include <fuse_lowlevel.h>
#include <stdio.h>
@ -289,6 +289,7 @@ int main(int argc, char *argv[]) {
struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
struct fuse_session *se;
struct fuse_cmdline_opts opts;
struct fuse_loop_config config;
pthread_t updater;
int ret = -1;
@ -340,8 +341,11 @@ int main(int argc, char *argv[]) {
/* Block until ctrl+c or fusermount -u */
if (opts.singlethread)
ret = fuse_session_loop(se);
else
ret = fuse_session_loop_mt(se, opts.clone_fd);
else {
config.clone_fd = opts.clone_fd;
config.max_idle_threads = opts.max_idle_threads;
ret = fuse_session_loop_mt(se, &config);
}
fuse_session_unmount(se);
err_out3:

View File

@ -58,7 +58,7 @@
*/
#define FUSE_USE_VERSION 31
#define FUSE_USE_VERSION 34
#include <fuse_lowlevel.h>
#include <stdio.h>
@ -350,6 +350,7 @@ int main(int argc, char *argv[]) {
struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
struct fuse_session *se;
struct fuse_cmdline_opts opts;
struct fuse_loop_config config;
pthread_t updater;
int ret = -1;
@ -398,8 +399,11 @@ int main(int argc, char *argv[]) {
/* Block until ctrl+c or fusermount -u */
if (opts.singlethread)
ret = fuse_session_loop(se);
else
ret = fuse_session_loop_mt(se, opts.clone_fd);
else {
config.clone_fd = opts.clone_fd;
config.max_idle_threads = opts.max_idle_threads;
ret = fuse_session_loop_mt(se, &config);
}
assert(retrieve_status != 1);
fuse_session_unmount(se);

View File

@ -35,7 +35,7 @@
*/
#define _GNU_SOURCE
#define FUSE_USE_VERSION 31
#define FUSE_USE_VERSION 34
#include "config.h"
@ -1156,6 +1156,7 @@ int main(int argc, char *argv[])
struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
struct fuse_session *se;
struct fuse_cmdline_opts opts;
struct fuse_loop_config config;
struct lo_data lo = { .debug = 0,
.writeback = 0 };
int ret = -1;
@ -1255,8 +1256,11 @@ int main(int argc, char *argv[])
/* Block until ctrl+c or fusermount -u */
if (opts.singlethread)
ret = fuse_session_loop(se);
else
ret = fuse_session_loop_mt(se, opts.clone_fd);
else {
config.clone_fd = opts.clone_fd;
config.max_idle_threads = opts.max_idle_threads;
ret = fuse_session_loop_mt(se, &config);
}
fuse_session_unmount(se);
err_out3: