aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2004-03-30 07:24:29 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2004-03-30 07:24:29 +0000
commit98667e21f5657c7f4031523dc675c352825855d1 (patch)
tree051dbd52f8dd76a2680ae3fee7428a339380aeae
parent77f39949dc5174bc42be9ecf2dda6119e1dd506b (diff)
downloadlibfuse-98667e21f5657c7f4031523dc675c352825855d1.tar.gz
fusermount fix
-rw-r--r--ChangeLog4
-rw-r--r--Filesystems13
-rw-r--r--lib/mount.c2
-rw-r--r--util/fusermount.c18
4 files changed, 30 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 32a32ae..6d0b2b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2004-03-30 Miklos Szeredi <mszeredi@inf.bme.hu>
+
+ * new fusermount flag '-z': lazy unmount, default is not lazy
+
2004-03-25 Miklos Szeredi <mszeredi@inf.bme.hu>
* If filesystem doesn't define a statfs operation, then an
diff --git a/Filesystems b/Filesystems
index 763c6a5..eecf82e 100644
--- a/Filesystems
+++ b/Filesystems
@@ -158,3 +158,16 @@ Description:
improved in the future.
==============================================================================
+Name: Fusedav
+
+Author: Lennart Poettering <mzshfrqni (at) 0pointer (dot) de>
+
+Homepage: http://0pointer.de/lennart/projects/fusedav/
+
+Description:
+
+ fusedav is a Linux userspace file system driver for mounting WebDAV
+ shares. It makes use of FUSE as userspace file system API and neon
+ as WebDAV API.
+
+==============================================================================
diff --git a/lib/mount.c b/lib/mount.c
index 7b67203..53162a5 100644
--- a/lib/mount.c
+++ b/lib/mount.c
@@ -71,7 +71,7 @@ void fuse_unmount(const char *mountpoint)
const char *mountprog = FUSERMOUNT_PROG;
char umount_cmd[1024];
- snprintf(umount_cmd, sizeof(umount_cmd) - 1, "%s -u -q %s", mountprog,
+ snprintf(umount_cmd, sizeof(umount_cmd) - 1, "%s -u -q -z %s", mountprog,
mountpoint);
umount_cmd[sizeof(umount_cmd) - 1] = '\0';
diff --git a/util/fusermount.c b/util/fusermount.c
index 6d27372..9af24d1 100644
--- a/util/fusermount.c
+++ b/util/fusermount.c
@@ -126,7 +126,7 @@ static int add_mount(const char *fsname, const char *mnt, const char *type)
return 0;
}
-static int remove_mount(const char *mnt, int quiet)
+static int remove_mount(const char *mnt, int quiet, int lazy)
{
int res;
const char *mtab = _PATH_MOUNTED;
@@ -186,7 +186,7 @@ static int remove_mount(const char *mnt, int quiet)
endmntent(newfp);
if(found) {
- res = umount2(mnt, 2); /* Lazy umount */
+ res = umount2(mnt, lazy ? 2 : 0);
if(res == -1) {
fprintf(stderr, "%s: failed to unmount %s: %s\n", progname, mnt,
strerror(errno));
@@ -398,7 +398,7 @@ static int mount_fuse(const char *mnt, int flags, const char *fsname)
res = add_mount(fsname, mnt, type);
unlock_mtab(mtablock);
if(res == -1) {
- umount(mnt);
+ umount2(mnt, 2); /* lazy umount */
return -1;
}
}
@@ -481,7 +481,8 @@ static void usage()
" -x allow other users to access the files (only for root)\n"
" -n name add 'name' as the filesystem name to mtab\n"
" -l issue large reads\n"
- " -q quiet: don't complain if unmount fails\n",
+ " -q quiet: don't complain if unmount fails\n"
+ " -z lazy unmount\n",
progname);
exit(1);
}
@@ -494,6 +495,7 @@ int main(int argc, char *argv[])
char *origmnt;
char *mnt;
int unmount = 0;
+ int lazy = 0;
char *commfd;
const char *fsname = NULL;
int flags = 0;
@@ -518,6 +520,10 @@ int main(int argc, char *argv[])
case 'u':
unmount = 1;
break;
+
+ case 'z':
+ lazy = 1;
+ break;
case 'p':
flags |= FUSE_DEFAULT_PERMISSIONS;
@@ -576,10 +582,10 @@ int main(int argc, char *argv[])
if(unmount) {
if(geteuid() == 0) {
int mtablock = lock_mtab();
- res = remove_mount(mnt, quiet);
+ res = remove_mount(mnt, quiet, lazy);
unlock_mtab(mtablock);
} else {
- res = umount2(mnt, 2);
+ res = umount2(mnt, lazy ? 2 : 0);
if(res == -1) {
fprintf(stderr, "%s: failed to unmount %s: %s\n", progname, mnt,
strerror(errno));