gnunet-fuse

GNUnet file-sharing directory mounting via FUSE
Log | Files | Refs | Submodules | README | LICENSE

commit 861baeea4bc0f57f81eddac2724e96d59c03eff9
parent 877c0604ce75a2bf575db74042a375a7dbc5d3c3
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun,  3 Jun 2012 17:47:51 +0000

-indentation

Diffstat:
Msrc/fuse/getattr.c | 13++++++-------
Msrc/fuse/gnunet-fuse.c | 119+++++++++++++++++++++++++++++++++++++------------------------------------------
Msrc/fuse/gnunet-service-fuse.c | 27++++++++++-----------------
Msrc/fuse/mkdir.c | 5+++--
Msrc/fuse/mknod.c | 5+++--
Msrc/fuse/open.c | 19+++++++++----------
Msrc/fuse/read.c | 7+++----
Msrc/fuse/readdir.c | 338+++++++++++++++++++++++++++++++++++++++++--------------------------------------
Msrc/fuse/release.c | 5+++--
Msrc/fuse/rename.c | 7++++---
Msrc/fuse/rmdir.c | 5+++--
Msrc/fuse/test_fuse_api.c | 15+++++----------
Msrc/fuse/truncate.c | 7++++---
Msrc/fuse/unlink.c | 5+++--
Msrc/fuse/utimens.c | 7++++---
Msrc/fuse/write.c | 7++++---
16 files changed, 295 insertions(+), 296 deletions(-)

diff --git a/src/fuse/getattr.c b/src/fuse/getattr.c @@ -18,19 +18,18 @@ #include <fuse.h> #include <gnunet-fuse.h> -int gn_getattr(const char *path, struct stat *stbuf) +int +gn_getattr (const char *path, struct stat *stbuf) { - memset(stbuf, 0, sizeof(*stbuf)); + memset (stbuf, 0, sizeof (*stbuf)); - stbuf->st_mode = S_IFDIR | 0555; - stbuf->st_nlink = 1; + stbuf->st_mode = S_IFDIR | 0555; + stbuf->st_nlink = 1; - return 0; + return 0; } - - diff --git a/src/fuse/gnunet-fuse.c b/src/fuse/gnunet-fuse.c @@ -56,12 +56,12 @@ struct GNUNET_CONTAINER_MultiHashMap *map; struct GNUNET_FUSE_PathInfo * create_path_info (const char *path, const struct GNUNET_FS_Uri *uri) { - struct GNUNET_FUSE_PathInfo * pi; + struct GNUNET_FUSE_PathInfo *pi; pi = GNUNET_malloc (sizeof (struct GNUNET_FUSE_PathInfo)); pi->path = GNUNET_strdup (path); - pi->uri = GNUNET_FS_uri_dup(uri); - return pi; + pi->uri = GNUNET_FS_uri_dup (uri); + return pi; } @@ -83,10 +83,8 @@ delete_path_info (struct GNUNET_FUSE_PathInfo *pi) * @param value value in the hash map, a 'struct GNUNET_FUSE_PathInfo' * @return GNUNET_YES (we should continue to iterate) */ -static int -cleanup_path_info (void *cls, - const GNUNET_HashCode * key, - void *value) +static int +cleanup_path_info (void *cls, const GNUNET_HashCode * key, void *value) { struct GNUNET_FUSE_PathInfo *pi = value; @@ -106,19 +104,18 @@ cleanup_path_info (void *cls, static void run (void *cls, char *const *args, - const char *cfgfile, - const struct GNUNET_CONFIGURATION_Handle *cfg) + const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { static struct fuse_operations fops = { - // .mkdir = gn_mkdir, - // .mknod = gn_mknod, - // .release = gn_release, - // .rename = gn_rename, - // .rmdir = gn_rmdir, - // .truncate = gn_truncate, - // .unlink = gn_unlink, - // .utimens = gn_utimens, - // .write = gn_write, + // .mkdir = gn_mkdir, + // .mknod = gn_mknod, + // .release = gn_release, + // .rename = gn_rename, + // .rmdir = gn_rmdir, + // .truncate = gn_truncate, + // .unlink = gn_unlink, + // .utimens = gn_utimens, + // .write = gn_write, .getattr = gn_getattr, .readdir = gn_readdir, .open = gn_open, @@ -131,41 +128,37 @@ run (void *cls, char *emsg; GNUNET_HashCode path_hash; const char *path = "/"; - + ret = 0; if (NULL == source) - { - fprintf(stderr, - _("`%s' option for URI missing\n"), - "-s"); - ret = 1; - return; - } + { + fprintf (stderr, _("`%s' option for URI missing\n"), "-s"); + ret = 1; + return; + } if (NULL == directory) - { - fprintf(stderr, - _("`%s' option for mountpoint missing\n"), - "-d"); - ret = 2; - return; - } + { + fprintf (stderr, _("`%s' option for mountpoint missing\n"), "-d"); + ret = 2; + return; + } /* parse source string to uri */ - if (NULL == (uri = GNUNET_FS_uri_parse(source, &emsg))) - { - fprintf(stderr, - "%s\n", emsg); - GNUNET_free (emsg); - ret = 3; - return; - } + if (NULL == (uri = GNUNET_FS_uri_parse (source, &emsg))) + { + fprintf (stderr, "%s\n", emsg); + GNUNET_free (emsg); + ret = 3; + return; + } map = GNUNET_CONTAINER_multihashmap_create (10); GNUNET_CRYPTO_hash (path, strlen (path), &path_hash); pi = create_path_info (path, uri); - GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multihashmap_put(map, - &path_hash, pi, - GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); + GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multihashmap_put (map, + &path_hash, + pi, + GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); if (GNUNET_YES == single_threaded) @@ -173,20 +166,20 @@ run (void *cls, else argc = 2; { - char *a[argc+1]; - a[0]="gnunet-fuse"; - a[1]= directory; + char *a[argc + 1]; + a[0] = "gnunet-fuse"; + a[1] = directory; if (GNUNET_YES == single_threaded) - { - a[2] = "-s"; - a[3] = "-f"; - a[4] = "-d"; - } + { + a[2] = "-s"; + a[3] = "-f"; + a[4] = "-d"; + } a[argc] = NULL; - fuse_main(argc, a, &fops, NULL); + fuse_main (argc, a, &fops, NULL); } - GNUNET_CONTAINER_multihashmap_iterate(map, &cleanup_path_info, NULL); - GNUNET_CONTAINER_multihashmap_destroy(map); + GNUNET_CONTAINER_multihashmap_iterate (map, &cleanup_path_info, NULL); + GNUNET_CONTAINER_multihashmap_destroy (map); GNUNET_FS_uri_destroy (uri); } @@ -200,7 +193,7 @@ run (void *cls, */ int main (int argc, char *const *argv) -{ +{ static const struct GNUNET_GETOPT_CommandLineOption options[] = { {'s', "source", "URI", gettext_noop ("Source you get the URI from"), 1, @@ -211,15 +204,15 @@ main (int argc, char *const *argv) {'t', "single-threaded", NULL, gettext_noop ("run in single-threaded mode"), 0, &GNUNET_GETOPT_set_one, &single_threaded}, - GNUNET_GETOPT_OPTION_END + GNUNET_GETOPT_OPTION_END }; return (GNUNET_OK == - GNUNET_PROGRAM_run2(argc, - argv, - "gnunet-fuse -s URI [-- FUSE-OPTIONS] DIRECTORYNAME", - gettext_noop - ("fuse"), - options, &run, NULL, GNUNET_YES)) ? ret : 1; + GNUNET_PROGRAM_run2 (argc, + argv, + "gnunet-fuse -s URI [-- FUSE-OPTIONS] DIRECTORYNAME", + gettext_noop + ("fuse"), + options, &run, NULL, GNUNET_YES)) ? ret : 1; } /* end of gnunet-fuse.c */ diff --git a/src/fuse/gnunet-service-fuse.c b/src/fuse/gnunet-service-fuse.c @@ -43,11 +43,10 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg; */ static void handle_ext (void *cls, - struct GNUNET_SERVER_Client *client, - const struct GNUNET_MessageHeader *message) + struct GNUNET_SERVER_Client *client, + const struct GNUNET_MessageHeader *message) { - GNUNET_SERVER_receive_done (client, - GNUNET_OK); + GNUNET_SERVER_receive_done (client, GNUNET_OK); } @@ -58,8 +57,7 @@ handle_ext (void *cls, * @param tc unused */ static void -shutdown_task (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc) +shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { } @@ -71,9 +69,7 @@ shutdown_task (void *cls, * @param client identification of the client */ static void -handle_client_disconnect (void *cls, - struct GNUNET_SERVER_Client - * client) +handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client) { } @@ -96,12 +92,9 @@ run (void *cls, }; cfg = c; GNUNET_SERVER_add_handlers (server, handlers); - GNUNET_SERVER_disconnect_notify (server, - &handle_client_disconnect, - NULL); + GNUNET_SERVER_disconnect_notify (server, &handle_client_disconnect, NULL); GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, - &shutdown_task, - NULL); + &shutdown_task, NULL); } @@ -116,9 +109,9 @@ int main (int argc, char *const *argv) { return (GNUNET_OK == - GNUNET_SERVICE_run (argc, - argv, - "fuse", + GNUNET_SERVICE_run (argc, + argv, + "fuse", GNUNET_SERVICE_OPTION_NONE, &run, NULL)) ? 0 : 1; } diff --git a/src/fuse/mkdir.c b/src/fuse/mkdir.c @@ -19,7 +19,8 @@ #include <fuse.h> -int gn_mkdir(const char *path, mode_t mode) +int +gn_mkdir (const char *path, mode_t mode) { - return 0; + return 0; } diff --git a/src/fuse/mknod.c b/src/fuse/mknod.c @@ -17,7 +17,8 @@ #include <sys/stat.h> #include <fuse.h> -int gn_mknod(const char *path, mode_t mode, dev_t rdev) +int +gn_mknod (const char *path, mode_t mode, dev_t rdev) { - return 0; + return 0; } diff --git a/src/fuse/open.c b/src/fuse/open.c @@ -31,24 +31,23 @@ -int gn_open(const char *path, struct fuse_file_info *fi) +int +gn_open (const char *path, struct fuse_file_info *fi) { - //if (strcmp(path, "/home/mg/gnunet-fuse2/gnunet-fuse/src/ext/monti") == 0) - // return 0; + //if (strcmp(path, "/home/mg/gnunet-fuse2/gnunet-fuse/src/ext/monti") == 0) + // return 0; // -// else if ((fi->flags & 3) != O_RDONLY) -// return -EACCES; +// else if ((fi->flags & 3) != O_RDONLY) +// return -EACCES; -// else return 0; +// else return 0; /* * when user is allowed to open, return 0 */ - return 0; - } - - + return 0; +} diff --git a/src/fuse/read.c b/src/fuse/read.c @@ -22,8 +22,9 @@ -int gn_read(const char *path, char *buf, size_t size, off_t offset, - struct fuse_file_info *fi) +int +gn_read (const char *path, char *buf, size_t size, off_t offset, + struct fuse_file_info *fi) { /* (void) fi; size_t len; @@ -69,5 +70,3 @@ else return -ENOENT; */ return -ENOENT; } - - diff --git a/src/fuse/readdir.c b/src/fuse/readdir.c @@ -77,209 +77,221 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) struct GNUNET_FS_DownloadContext *d; if (dc != NULL) - { - d = dc; - dc = NULL; - GNUNET_FS_download_stop (d, delete_incomplete); - } + { + d = dc; + dc = NULL; + GNUNET_FS_download_stop (d, delete_incomplete); + } } /* callback function */ -void *progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo * info) +static void * +progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) { - char *s; - char*s2; - char *t; - - switch (info->status) - { - case GNUNET_FS_STATUS_DOWNLOAD_START: - if (verbose > 1) - FPRINTF (stderr, _("Starting download `%s'.\n"), - info->value.download.filename); - break; - case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: - if (verbose) + char *s; + char *s2; + char *t; + + switch (info->status) + { + case GNUNET_FS_STATUS_DOWNLOAD_START: + if (verbose > 1) + FPRINTF (stderr, _("Starting download `%s'.\n"), + info->value.download.filename); + break; + case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: + if (verbose) { - s = GNUNET_STRINGS_relative_time_to_string (info->value.download.eta); - if (info->value.download.specifics.progress.block_download_duration.rel_value - == GNUNET_TIME_UNIT_FOREVER_REL.rel_value) - s2 = GNUNET_strdup (_("<unknown time>")); + s = + GNUNET_STRINGS_relative_time_to_string (info->value.download.eta); + if (info->value.download.specifics.progress. + block_download_duration.rel_value == + GNUNET_TIME_UNIT_FOREVER_REL.rel_value) + s2 = GNUNET_strdup (_("<unknown time>")); else - s2 = GNUNET_STRINGS_relative_time_to_string ( - info->value.download.specifics.progress.block_download_duration); - t = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * - 1000LL / - (info->value.download. - duration.rel_value + 1)); + s2 = + GNUNET_STRINGS_relative_time_to_string (info->value. + download.specifics. + progress.block_download_duration); + t = + GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * + 1000LL / + (info->value.download. + duration.rel_value + 1)); FPRINTF (stdout, - _("Downloading `%s' at %llu/%llu (%s remaining, %s/s). Block took %s to download\n"), - info->value.download.filename, - (unsigned long long) info->value.download.completed, - (unsigned long long) info->value.download.size, s, t, s2); - GNUNET_free (s); - GNUNET_free (s2); - GNUNET_free (t); + _ + ("Downloading `%s' at %llu/%llu (%s remaining, %s/s). Block took %s to download\n"), + info->value.download.filename, + (unsigned long long) info->value.download.completed, + (unsigned long long) info->value.download.size, s, t, s2); + GNUNET_free (s); + GNUNET_free (s2); + GNUNET_free (t); } - break; - case GNUNET_FS_STATUS_DOWNLOAD_ERROR: - FPRINTF (stderr, _("Error downloading: %s.\n"), - info->value.download.specifics.error.message); + break; + case GNUNET_FS_STATUS_DOWNLOAD_ERROR: + FPRINTF (stderr, _("Error downloading: %s.\n"), + info->value.download.specifics.error.message); + GNUNET_SCHEDULER_shutdown (); + break; + case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: + s = + GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * + 1000 / + (info->value.download. + duration.rel_value + 1)); + FPRINTF (stdout, _("Downloading `%s' done (%s/s).\n"), + info->value.download.filename, s); + GNUNET_free (s); + if (info->value.download.dc == dc) GNUNET_SCHEDULER_shutdown (); - break; - case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: - s = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * 1000 / - (info->value.download. - duration.rel_value + 1)); - FPRINTF (stdout, _("Downloading `%s' done (%s/s).\n"), - info->value.download.filename, s); - GNUNET_free (s); - if (info->value.download.dc == dc) - GNUNET_SCHEDULER_shutdown (); - break; - case GNUNET_FS_STATUS_DOWNLOAD_STOPPED: - if (info->value.download.dc == dc) - GNUNET_SCHEDULER_add_continuation (&cleanup_task, NULL, - GNUNET_SCHEDULER_REASON_PREREQ_DONE); - break; - case GNUNET_FS_STATUS_DOWNLOAD_ACTIVE: - case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE: - break; - default: - FPRINTF (stderr, _("Unexpected status: %d\n"), info->status); - break; - } - -return NULL; + break; + case GNUNET_FS_STATUS_DOWNLOAD_STOPPED: + if (info->value.download.dc == dc) + GNUNET_SCHEDULER_add_continuation (&cleanup_task, NULL, + GNUNET_SCHEDULER_REASON_PREREQ_DONE); + break; + case GNUNET_FS_STATUS_DOWNLOAD_ACTIVE: + case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE: + break; + default: + FPRINTF (stderr, _("Unexpected status: %d\n"), info->status); + break; + } + + return NULL; } -void readdir_task (void *cls, - const struct GNUNET_SCHEDULER_TaskContext* tc) +void +readdir_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - enum GNUNET_FS_DownloadOptions options; - - if (NULL == uri) - { - FPRINTF (stderr, _("Failed to parse URI: %s\n"), emsg); - GNUNET_free (emsg); - GNUNET_FS_stop (ctx); // ?? hmmm....stop before start ?? - } - - - fs = GNUNET_FS_start (cfg, "gnunet-fuse", &progress_cb, NULL, - GNUNET_FS_FLAGS_NONE, - GNUNET_FS_OPTIONS_DOWNLOAD_PARALLELISM, parallelism, - GNUNET_FS_OPTIONS_REQUEST_PARALLELISM, request_parallelism, - GNUNET_FS_OPTIONS_END); - - if (NULL == fs) - { - FPRINTF (stderr, _("Could not initialize `%s' subsystem.\n"), "FS"); - GNUNET_FS_uri_destroy (uri); - ret = 1; - return; - } - - options = GNUNET_FS_DOWNLOAD_OPTION_NONE; - if (do_recursive) - options |= GNUNET_FS_DOWNLOAD_OPTION_RECURSIVE; - if (local_only) - options |= GNUNET_FS_DOWNLOAD_OPTION_LOOPBACK_ONLY; - - struct GNUNET_FS_DownloadContext* dc; - dc = GNUNET_FS_download_start (fs, uri, NULL, r->tmpfile, NULL, 0, - GNUNET_FS_uri_chk_get_file_size(uri), - anonymity, options, NULL, NULL); - - GNUNET_FS_uri_destroy (uri); - if (dc == NULL) - { - GNUNET_FS_stop (ctx); - ctx = NULL; - return; - } - - GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, NULL); + enum GNUNET_FS_DownloadOptions options; + + if (NULL == uri) + { + FPRINTF (stderr, _("Failed to parse URI: %s\n"), emsg); + GNUNET_free (emsg); + GNUNET_FS_stop (ctx); // ?? hmmm....stop before start ?? + } + + + fs = GNUNET_FS_start (cfg, "gnunet-fuse", &progress_cb, NULL, + GNUNET_FS_FLAGS_NONE, + GNUNET_FS_OPTIONS_DOWNLOAD_PARALLELISM, parallelism, + GNUNET_FS_OPTIONS_REQUEST_PARALLELISM, + request_parallelism, GNUNET_FS_OPTIONS_END); + + if (NULL == fs) + { + FPRINTF (stderr, _("Could not initialize `%s' subsystem.\n"), "FS"); + GNUNET_FS_uri_destroy (uri); + ret = 1; + return; + } + + options = GNUNET_FS_DOWNLOAD_OPTION_NONE; + if (do_recursive) + options |= GNUNET_FS_DOWNLOAD_OPTION_RECURSIVE; + if (local_only) + options |= GNUNET_FS_DOWNLOAD_OPTION_LOOPBACK_ONLY; + + struct GNUNET_FS_DownloadContext *dc; + dc = GNUNET_FS_download_start (fs, uri, NULL, r->tmpfile, NULL, 0, + GNUNET_FS_uri_chk_get_file_size (uri), + anonymity, options, NULL, NULL); + + GNUNET_FS_uri_destroy (uri); + if (dc == NULL) + { + GNUNET_FS_stop (ctx); + ctx = NULL; + return; + } + + GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, + NULL); } -int gn_readdir(const char *path, void *buf, fuse_fill_dir_t filler, - off_t offset, struct fuse_file_info *fi) +int +gn_readdir (const char *path, void *buf, fuse_fill_dir_t filler, + off_t offset, struct fuse_file_info *fi) { - struct GNUNET_FUSE_path_info * path_info = NULL; - printf("FUSE PATH gives me: `%s'\n", path); - (void) fi; - (void) offset; - - GNUNET_HashCode path_hash; - GNUNET_CRYPTO_hash (path, strlen (path), &path_hash); - /* NOTE: Path can be like /.Trash/1000/files for the trash directory */ - if (GNUNET_NO == GNUNET_CONTAINER_multihashmap_contains(map, &path_hash)) - { - /* new path */ - //path_info = create_path_info (path, NULL); - //GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multihashmap_put(map, &path_hash, path_info, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); - } - else - { - /* existing path */ - path_info = GNUNET_CONTAINER_multihashmap_get (map, &path_hash); - } - - //GNUNET_assert (path_info != NULL); + struct GNUNET_FUSE_path_info *path_info = NULL; + printf ("FUSE PATH gives me: `%s'\n", path); + (void) fi; + (void) offset; + + GNUNET_HashCode path_hash; + GNUNET_CRYPTO_hash (path, strlen (path), &path_hash); + /* NOTE: Path can be like /.Trash/1000/files for the trash directory */ + if (GNUNET_NO == GNUNET_CONTAINER_multihashmap_contains (map, &path_hash)) + { + /* new path */ + //path_info = create_path_info (path, NULL); + //GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_multihashmap_put(map, &path_hash, path_info, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); + } + else + { + /* existing path */ + path_info = GNUNET_CONTAINER_multihashmap_get (map, &path_hash); + } + + //GNUNET_assert (path_info != NULL); #if 0 - r = GNUNET_malloc (sizeof (struct GNUNET_FUSE_path_info)); + r = GNUNET_malloc (sizeof (struct GNUNET_FUSE_path_info)); - int len = strlen(path); - int exist = 0; - r->path = path; + int len = strlen (path); + int exist = 0; + r->path = path; - /* compute key */ + /* compute key */ - GNUNET_CRYPTO_hash (r->path, len, r->hash); + GNUNET_CRYPTO_hash (r->path, len, r->hash); - exist = GNUNET_CONTAINER_multihashmap_contains (map, r->hash); - if ( exist == GNUNET_NO) - { + exist = GNUNET_CONTAINER_multihashmap_contains (map, r->hash); + if (exist == GNUNET_NO) + { /* Store a key-value pair in the map */ - GNUNET_CONTAINER_multihashmap_put (map, r->hash, r->path, GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); + GNUNET_CONTAINER_multihashmap_put (map, r->hash, r->path, + GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); /* store to temporary file */ - r->tmpfile = GNUNET_DISK_mktemp("gnunet-fuse-tempfile"); + r->tmpfile = GNUNET_DISK_mktemp ("gnunet-fuse-tempfile"); /* find value with given key */ - r->source = GNUNET_CONTAINER_multihashmap_get (map, r->hash); + r->source = GNUNET_CONTAINER_multihashmap_get (map, r->hash); /* parse uri from given source */ - uri = GNUNET_FS_uri_parse(r->source, &emsg); - GNUNET_SCHEDULER_run(&readdir_task, NULL); + uri = GNUNET_FS_uri_parse (r->source, &emsg); + GNUNET_SCHEDULER_run (&readdir_task, NULL); - filler(buf, ".", NULL, 0); - filler(buf, "..", NULL, 0); + filler (buf, ".", NULL, 0); + filler (buf, "..", NULL, 0); - return 0; - } + return 0; + } - else - { - uri = GNUNET_FS_uri_parse(r->source, &emsg); - GNUNET_SCHEDULER_run(&readdir_task, NULL); + else + { + uri = GNUNET_FS_uri_parse (r->source, &emsg); + GNUNET_SCHEDULER_run (&readdir_task, NULL); - filler(buf, ".", NULL, 0); - filler(buf, "..", NULL, 0); - return 0; - } + filler (buf, ".", NULL, 0); + filler (buf, "..", NULL, 0); + return 0; + } #endif - filler(buf, ".", NULL, 0); - filler(buf, "..", NULL, 0); - return 0; + filler (buf, ".", NULL, 0); + filler (buf, "..", NULL, 0); + return 0; } diff --git a/src/fuse/release.c b/src/fuse/release.c @@ -23,7 +23,8 @@ #include <fuse.h> //#include <gnunet-fuse.h> -int gn_release(const char *path, struct fuse_file_info *fi) +int +gn_release (const char *path, struct fuse_file_info *fi) { - return 0; + return 0; } diff --git a/src/fuse/rename.c b/src/fuse/rename.c @@ -15,8 +15,9 @@ #include <fuse.h> -int gn_rename(const char *from, const char *to) +int +gn_rename (const char *from, const char *to) { - int ret=0; - return ret; + int ret = 0; + return ret; } diff --git a/src/fuse/rmdir.c b/src/fuse/rmdir.c @@ -15,7 +15,8 @@ #include <fuse.h> -int gn_rmdir(const char *path) +int +gn_rmdir (const char *path) { - return 0; + return 0; } diff --git a/src/fuse/test_fuse_api.c b/src/fuse/test_fuse_api.c @@ -29,8 +29,7 @@ static void run (void *cls, char *const *args, - const char *cfgfile, - const struct GNUNET_CONFIGURATION_Handle *cfg) + const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) { } @@ -45,13 +44,11 @@ check () }; struct GNUNET_OS_Process *proc; - proc = GNUNET_OS_start_process (NULL, NULL, + proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-fuse", - "gnunet-service-fuse", - NULL); + "gnunet-service-fuse", NULL); GNUNET_assert (NULL != proc); - GNUNET_PROGRAM_run (1, argv, "test-fuse-api", "nohelp", - options, &run, &ok); + GNUNET_PROGRAM_run (1, argv, "test-fuse-api", "nohelp", options, &run, &ok); if (0 != GNUNET_OS_process_kill (proc, SIGTERM)) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); @@ -66,9 +63,7 @@ check () int main (int argc, char *argv[]) { - GNUNET_log_setup ("test_statistics_api", - "WARNING", - NULL); + GNUNET_log_setup ("test_statistics_api", "WARNING", NULL); return check (); } diff --git a/src/fuse/truncate.c b/src/fuse/truncate.c @@ -13,8 +13,9 @@ #include <fuse.h> -int gn_truncate(const char *path, off_t size) +int +gn_truncate (const char *path, off_t size) { - int ret = 0; - return ret; + int ret = 0; + return ret; } diff --git a/src/fuse/unlink.c b/src/fuse/unlink.c @@ -15,7 +15,8 @@ #include <fuse.h> -int gn_unlink(const char *path) +int +gn_unlink (const char *path) { - return 0; + return 0; } diff --git a/src/fuse/utimens.c b/src/fuse/utimens.c @@ -18,8 +18,9 @@ -int gn_utimens(const char *path, const struct timespec ts[2]) +int +gn_utimens (const char *path, const struct timespec ts[2]) { - int ret = 0; - return ret; + int ret = 0; + return ret; } diff --git a/src/fuse/write.c b/src/fuse/write.c @@ -19,8 +19,9 @@ #include <fuse.h> -int gn_write(const char *path, const char *buf, size_t size, off_t offset, - struct fuse_file_info *fi) +int +gn_write (const char *path, const char *buf, size_t size, off_t offset, + struct fuse_file_info *fi) { - return -ENOENT; + return -ENOENT; }