From dfbb2f739f5f3612e5cd04c7ed5a22004140b78a Mon Sep 17 00:00:00 2001 From: cjiph Date: Mon, 18 Feb 2008 22:46:56 +0000 Subject: [PATCH] Tidying up for release 0.2. git-svn-id: https://afuse.svn.sourceforge.net/svnroot/afuse@8 55a4958a-cc0d-0410-919a-9f8291766008 --- AUTHORS | 11 +++++++++++ ChangeLog | 11 +++++++++++ HACKING | 24 +++++++----------------- README | 10 +++++----- configure.ac | 2 +- src/afuse.c | 39 +++++++++++++++++++++++++++------------ 6 files changed, 62 insertions(+), 35 deletions(-) diff --git a/AUTHORS b/AUTHORS index e69de29..47f4813 100644 --- a/AUTHORS +++ b/AUTHORS @@ -0,0 +1,11 @@ +================== +Afuse authors list +================== + +Original authors: + + Jacob Bower - jacob@ic.ac.uk + +Contributors: + + Jeremy Maitin-Shepard - jbms@cmu.edu diff --git a/ChangeLog b/ChangeLog index 635b64b..8c260f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Version 0.2 +------------- +* New features: + + Timeout-based unmounting. + + Forced immediate unmounting by removing root directory of + auto mounts. +* Fixes/optimisations: + + Minor performance tweaks. + + Better handling of filesystems which are unexpectedly + unmounted. + Version 0.1.1 ------------- * Backward compatibility with FUSE 2.3 (to 2.5). diff --git a/HACKING b/HACKING index fa82754..7c5fb2e 100644 --- a/HACKING +++ b/HACKING @@ -1,23 +1,15 @@ -CVS Build +SVN Build --------- -If you get afuse from CVS, run add-cruft.sh to generate the autotool crap. -If your version of the autotools generates files not picked up in the -various .cvsignore files or the remove-cruft.sh script, and you have -CVS write access please add them. Not that add-cruft.sh is likely -to work on your system anyway as the autotools seem to do completely -different things distro to distro. - -I really hate the way the autotools require all these stupid random -files be created for operation and included in releases. Why can't it -just be an actual program used to build source distributions based on -the canonicalised config information? +If you get afuse from SVN, run add-cruft.sh to generate various autotool +scripts and config. If your version of the autotools generates files not +listed in the 'svn:ignore' property or the remove-cruft.sh script, and +you have SVN write access please add them. TODO ---- -While it is basically usable, there are a huge number of things which need -doing to afuse to make it a "good" project. Here are a list of some of -these: +While afuse is basically usable, there are a huge number of things which need +doing to afuse to make it "good". Here are a list of some of these: * Support multi-threading - Internatal Data structures need to guarded before we allow this. @@ -28,8 +20,6 @@ these: multi-threading or rebinding/moving mount points (needs changes to fusermount). -* Timeout-based auto-unmounting after all files are closed. - * Rather than umounting an FS to ensure directory changes are flushed, it should be possible to flush a handle to the parent dir instead. diff --git a/README b/README index c056cb3..e93d21d 100644 --- a/README +++ b/README @@ -1,10 +1,10 @@ -Afuse 0.1 -By Jacob Bower +Afuse 0.2 +Jacob Bower http://afuse.sourceforge.net/ -0. Conents ----------- +0. Contents +----------- 1. Abstract 2. Example Usage 3. Notes on Afuse's Operation @@ -77,4 +77,4 @@ It can also mean that if afuse is not shutdown cleanly (via an unmount of the afuse filesystem) a stale directory can be left in /tmp of the form afuse-XXXXXX (where the X's are random characters). -Hopefuly these limitations will be removed in later revisions of afuse. +Hopefully these limitations will be removed in later revisions of afuse. diff --git a/configure.ac b/configure.ac index db214a9..ad59379 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([afuse], [0.1.1], [jacob.bower@ic.ac.uk]) +AC_INIT([afuse], [0.2], [jacob.bower@ic.ac.uk]) AM_INIT_AUTOMAKE AC_PROG_RANLIB diff --git a/src/afuse.c b/src/afuse.c index 29ca2ed..889bdec 100644 --- a/src/afuse.c +++ b/src/afuse.c @@ -1,12 +1,23 @@ /* afuse - An automounter using FUSE - Copyright (C) 2006 Jacob Bower + Copyright (C) 2008 Jacob Bower Portions of this program derive from examples provided with FUSE-2.5.2. This program can be distributed under the terms of the GNU GPL. See the file COPYING. + + Contributions: + + Feb '08, Jeremy Maitin-Shepard + * Added timeout-based unmounting. + * Forced immediate unmounting by removing root directory of + auto mounts. + * Minor performance tweaks. + * Better handling of filesystems which are unexpectedly + unmounted. + */ #include @@ -336,7 +347,7 @@ mount_list_t *do_mount(const char *root_name) if( !(mount_point = make_mount_point(root_name)) ) { fprintf(stderr, "Failed to create mount point directory: %s/%s\n", - mount_point_directory, root_name); + mount_point_directory, root_name); return NULL; } @@ -348,9 +359,9 @@ mount_list_t *do_mount(const char *root_name) if(sysret) { fprintf(stderr, "Failed to invoke mount command: '%s' (%s)\n", - mount_command, sysret != -1 ? - "Error executing mount" : - strerror(errno)); + mount_command, sysret != -1 ? + "Error executing mount" : + strerror(errno)); // remove the now unused directory if( rmdir(mount_point) == -1 ) @@ -396,7 +407,7 @@ int do_umount(mount_list_t *mount) void unmount_all(void) { - fprintf(stderr, "Attemping to unmount all filesystems:\n"); + fprintf(stderr, "Attempting to unmount all filesystems:\n"); while(mount_list) { fprintf(stderr, "\tUnmounting: %s\n", mount_list->root_name); @@ -441,7 +452,8 @@ int extract_root_name(const char *path, char *root_name) typedef enum {PROC_PATH_FAILED, PROC_PATH_ROOT_DIR, PROC_PATH_PROXY_DIR} proc_result_t; -proc_result_t process_path(const char *path_in, char *path_out, char *root_name, int attempt_mount, mount_list_t **out_mount) +proc_result_t process_path(const char *path_in, char *path_out, char *root_name, + int attempt_mount, mount_list_t **out_mount) { int i; char *path_out_base; @@ -455,7 +467,7 @@ proc_result_t process_path(const char *path_in, char *path_out, char *root_name, is_child = extract_root_name(path_in, root_name); fprintf(stderr, "root_name is: %s\n", root_name); - // Mount filesystem if neccessary + // Mount filesystem if necessary // the combination of is_child and attempt_mount prevent inappropriate // mounting of a filesystem for example if the user tries to mknod // in the afuse root this should cause an error not a mount. @@ -1086,7 +1098,7 @@ static int afuse_read(const char *path, char *buf, size_t size, off_t offset, } static int afuse_write(const char *path, const char *buf, size_t size, - off_t offset, struct fuse_file_info *fi) + off_t offset, struct fuse_file_info *fi) { int res; @@ -1268,7 +1280,7 @@ void afuse_destroy(void *p) #ifdef HAVE_SETXATTR /* xattr operations are optional and can safely be left unimplemented */ static int afuse_setxattr(const char *path, const char *name, const char *value, - size_t size, int flags) + size_t size, int flags) { char *root_name = alloca( strlen(path) ); char *real_path = alloca( max_path_out_len(path) ); @@ -1445,7 +1457,7 @@ static void usage(const char *progname) "afuse options:\n" " -o mount_template=CMD template for CMD to execute to mount (*)\n" " -o unmount_template=CMD template for CMD to execute to unmount (*) (**)\n" -" -o timeout=TIMEOUT automatically unmount after TIMEOUT microseconds\n" +" -o timeout=TIMEOUT automatically unmount after TIMEOUT seconds\n" " -o flushwrites flushes data to disk for all file writes\n" "\n\n" " (*) - When executed, %%r and %%m are expanded in templates to the root\n" @@ -1488,9 +1500,12 @@ int main(int argc, char *argv[]) if(fuse_opt_parse(&args, &user_options, afuse_opts, afuse_opt_proc) == -1) return 1; - // !!FIXME!! force single-threading for now as datastructures are not locked + // !!FIXME!! force single-threading for now as data structures are not locked fuse_opt_add_arg(&args, "-s"); + // Adjust user specified timeout from seconds to microseconds as required + user_options.auto_unmount_delay *= 1000000; + auto_unmount_ph_init(&auto_unmount_ph); /** -- 2.42.0