From a7731138040434ec1fccf01e6c09c70311e550e3 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 2 Apr 2009 17:46:09 +0000 Subject: [PATCH] * Initialize fuse_config before parsing the arguments. * Implemented fuse_is_lib_option() more correctly. * Actually use the value of the "use_ino" option. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29871 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../userlandfs/server/fuse/FUSEFileSystem.cpp | 2 ++ .../userlandfs/server/fuse/FUSEFileSystem.h | 7 ++++--- .../userlandfs/server/fuse/FUSEVolume.cpp | 3 +++ .../userlandfs/server/fuse/fuse_config.c | 10 +++++++++- .../userlandfs/server/fuse/fuse_main.cpp | 19 ++++++++----------- 5 files changed, 26 insertions(+), 15 deletions(-) diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.cpp b/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.cpp index ec9f4570c5..5da158c901 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.cpp @@ -243,6 +243,8 @@ FUSEFileSystem::FinishInitClientFS(fuse_config* config, PRINT(("FUSEFileSystem::FinishInitClientFS()\n")); fExitStatus = B_ERROR; + fFUSEConfig = *config; + // do the initialization status_t error = _InitClientFS(ops, opSize, userData); diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.h b/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.h index 536ecaa9a6..6fb30136f0 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.h +++ b/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEFileSystem.h @@ -8,9 +8,7 @@ #include "../FileSystem.h" #include "fuse_api.h" - - -struct fuse_config; +#include "fuse_config.h" namespace UserlandFS { @@ -35,6 +33,8 @@ public: fuse_fs* GetFS() const { return fFS; } + const fuse_config& GetFUSEConfig() const { return fFUSEConfig; } + virtual status_t CreateVolume(Volume** _volume, dev_t id); virtual status_t DeleteVolume(Volume* volume); @@ -68,6 +68,7 @@ private: const char* fInitParameters; fuse_fs* fFS; fuse_conn_info fConnectionInfo; + fuse_config fFUSEConfig; FSVolumeCapabilities fVolumeCapabilities; FSVNodeCapabilities fNodeCapabilities; diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEVolume.cpp b/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEVolume.cpp index f2ad29116f..070b14bcb9 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEVolume.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/server/fuse/FUSEVolume.cpp @@ -670,6 +670,9 @@ printf("FUSEVolume::Mount()\n"); fFS = _FileSystem()->GetFS(); _FileSystem()->GetVolumeCapabilities(fCapabilities); + const fuse_config& config = _FileSystem()->GetFUSEConfig(); + fUseNodeIDs = config.use_ino; + // get the root node struct stat st; int fuseError = fuse_fs_getattr(fFS, "/", &st); diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_config.c b/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_config.c index 271cc07f2e..d14c391118 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_config.c +++ b/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_config.c @@ -9,7 +9,7 @@ #include "fuse_config.h" -enum { +enum { KEY_HELP, }; @@ -65,3 +65,11 @@ fuse_parse_config_args(struct fuse_args* args, struct fuse_config* config) { return fuse_opt_parse(args, config, fuse_lib_opts, fuse_lib_opt_proc) == 0; } + + +int +fuse_is_lib_option(const char* opt) +{ + return /*fuse_lowlevel_is_lib_option(opt) ||*/ + fuse_opt_match(fuse_lib_opts, opt); +} diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_main.cpp b/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_main.cpp index 6de6e24ea9..98f12d9455 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_main.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/server/fuse/fuse_main.cpp @@ -3,8 +3,7 @@ * Distributed under the terms of the MIT License. */ -#define FUSE_USE_VERSION FUSE_VERSION - +#include #include #include "fuse_api.h" @@ -21,7 +20,14 @@ userData); // parse args struct fuse_args args = FUSE_ARGS_INIT(argc, argv); + fuse_config config; + memset(&config, 0, sizeof(config)); + config.entry_timeout = 1.0; + config.attr_timeout = 1.0; + config.negative_timeout = 0.0; + config.intr_signal = SIGUSR1; + bool success = fuse_parse_config_args(&args, &config); fuse_opt_free_args(&args); @@ -37,15 +43,6 @@ userData); } -int -fuse_is_lib_option(const char* opt) -{ -printf("fuse_is_lib_option(\"%s\")\n", opt); - // TODO: Implement! - return 0; -} - - int fuse_version(void) {