+LUFS (Linux User File System) module to be Linux kernel filesystem
authorshort <>
Fri, 15 Aug 2003 01:42:11 +0000 (01:42 +0000)
committershort <>
Fri, 15 Aug 2003 01:42:11 +0000 (01:42 +0000)
NEWS
configure.in
src/client/Makefile.am
src/client/lufs/Makefile.am [new file with mode: 0644]
src/client/lufs/captivefs-attr.c [new file with mode: 0644]
src/client/lufs/captivefs-attr.h [new file with mode: 0644]
src/client/lufs/captivefs-directory.c [new file with mode: 0644]
src/client/lufs/captivefs-file.c [new file with mode: 0644]
src/client/lufs/captivefs-misc.c [new file with mode: 0644]
src/client/lufs/captivefs-misc.h [new file with mode: 0644]
src/client/lufs/captivefs-vfs.c [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index 17aa844..5dca3c2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ NEWS for captive-0.9
 * Generates --bug-pathname resources file for sandbox crash bugreport
 * Implemented TraceFS W32 Cache Manager debug tracer
 * Rewritten Cache Manager to better match its W32 original behaviour
+* LUFS (Linux User File System) module to be Linux kernel filesystem
 
 
 NEWS for captive-0.8 (2003-05-02)
index ce0a347..5473273 100644 (file)
@@ -273,6 +273,7 @@ Makefile
 ./src/client/bug-replay/Makefile
 ./src/client/cmdline/Makefile
 ./src/client/libcaptive-gnomevfs/Makefile
+./src/client/lufs/Makefile
 ./src/client/sandbox-server/Makefile
 ./src/TraceFS/Makefile
 ./doc/Makefile
index c0757b6..ef25a5a 100644 (file)
@@ -18,4 +18,4 @@
 
 include $(top_srcdir)/Makefile-head.am
 
-SUBDIRS=cmdline sandbox-server libcaptive-gnomevfs bug-replay
+SUBDIRS=cmdline sandbox-server lufs libcaptive-gnomevfs bug-replay
diff --git a/src/client/lufs/Makefile.am b/src/client/lufs/Makefile.am
new file mode 100644 (file)
index 0000000..37ec1ec
--- /dev/null
@@ -0,0 +1,34 @@
+# $Id$
+# automake source for the liblufs-captive module for lufs Makefile 
+# Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; exactly version 2 of June 1991 is required
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+include $(top_srcdir)/Makefile-head.am
+include $(top_srcdir)/src/libcaptive/Makefile-libcaptive.am
+
+lib_LTLIBRARIES+=liblufs-captivefs.la
+
+liblufs_captivefs_la_CFLAGS=                   $(GNOME_VFS_MODULE_CFLAGS) $(LIBXML_CFLAGS)
+liblufs_captivefs_la_LIBADD=$(captive_library) $(GNOME_VFS_MODULE_LIBS)
+liblufs_captivefs_la_LDFLAGS=-release $(VERSION)
+liblufs_captivefs_la_SOURCES= \
+               captivefs-attr.c \
+               captivefs-attr.h \
+               captivefs-directory.c \
+               captivefs-file.c \
+               captivefs-misc.c \
+               captivefs-misc.h \
+               captivefs-vfs.c
diff --git a/src/client/lufs/captivefs-attr.c b/src/client/lufs/captivefs-attr.c
new file mode 100644 (file)
index 0000000..498d96e
--- /dev/null
@@ -0,0 +1,116 @@
+/* $Id$
+ * lufs interface module misc functions for libcaptive
+ * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; exactly version 2 of June 1991 is required
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+
+#include "config.h"
+
+#include "captivefs-attr.h"    /* self */
+#include <glib/gmessages.h>
+
+
+gboolean captivefs_GnomeVFSFileInfo_to_lufs_fattr(struct lufs_fattr *fattr,const GnomeVFSFileInfo *file_info)
+{
+       g_return_val_if_fail(fattr!=NULL,FALSE);
+       g_return_val_if_fail(file_info!=NULL,FALSE);
+
+       fattr->f_mode=0;
+
+       if (file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_TYPE)
+               switch (file_info->type) {
+                       case GNOME_VFS_FILE_TYPE_REGULAR:   fattr->f_mode|=S_IFREG; break;
+                       case GNOME_VFS_FILE_TYPE_DIRECTORY: fattr->f_mode|=S_IFDIR; break;
+                       default:
+                               g_warning("Unknown GnomeVFSFileInfo.type=%d of: %s",(int)file_info->type,file_info->name);
+                               return FALSE;
+                               }
+       if (file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS)
+               fattr->f_mode|=file_info->permissions & 0777;
+       else
+               fattr->f_mode|=0600;
+
+       if (!(file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_LINK_COUNT))
+               fattr->f_nlink=1;
+       else
+               fattr->f_nlink=file_info->link_count;
+
+       fattr->f_uid=1; /* we own the file */
+       fattr->f_gid=1; /* we own the file */
+
+       if (!(file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_SIZE))
+               fattr->f_size=0;
+       else
+               fattr->f_size=file_info->size;
+
+       if (!(file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_ATIME))
+               fattr->f_atime=time(NULL);
+       else
+               fattr->f_atime=file_info->atime;
+
+       if (!(file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_MTIME))
+               fattr->f_mtime=time(NULL);
+       else
+               fattr->f_mtime=file_info->mtime;
+
+       if (!(file_info->valid_fields&GNOME_VFS_FILE_INFO_FIELDS_CTIME))
+               fattr->f_ctime=time(NULL);
+       else
+               fattr->f_ctime=file_info->ctime;
+
+       return TRUE;
+}
+
+
+gboolean captivefs_lufs_fattr_to_GnomeVFSFileInfo(GnomeVFSFileInfo *file_info,const struct lufs_fattr *fattr)
+{
+       g_return_val_if_fail(file_info!=NULL,FALSE);
+       g_return_val_if_fail(fattr!=NULL,FALSE);
+
+       file_info->valid_fields=0;
+
+       switch (fattr->f_mode&S_IFMT) {
+               case S_IFREG: file_info->type=GNOME_VFS_FILE_TYPE_REGULAR;   break;
+               case S_IFDIR: file_info->type=GNOME_VFS_FILE_TYPE_DIRECTORY; break;
+               default:
+                       g_warning("lufs_fattr_to_GnomeVFSFileInfo: f_mode&S_IFMT=0x%lX",(long)(fattr->f_mode&S_IFMT));
+                       return FALSE;
+               }
+       file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_TYPE;
+
+       file_info->permissions=fattr->f_mode & 0777;
+       file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS;
+
+       file_info->link_count=fattr->f_nlink;
+       file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_LINK_COUNT;
+
+       /* ignore: fattr->f_uid; we own the file */
+       /* ignore: fattr->f_gid; we own the file */
+
+       file_info->size=fattr->f_size;
+       file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_SIZE;
+
+       if ((file_info->atime=fattr->f_atime))
+               file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_ATIME;
+
+       if ((file_info->mtime=fattr->f_mtime))
+               file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_MTIME;
+
+       if ((file_info->ctime=fattr->f_ctime))
+               file_info->valid_fields|=GNOME_VFS_FILE_INFO_FIELDS_CTIME;
+
+       return TRUE;
+}
diff --git a/src/client/lufs/captivefs-attr.h b/src/client/lufs/captivefs-attr.h
new file mode 100644 (file)
index 0000000..ad0a5c2
--- /dev/null
@@ -0,0 +1,38 @@
+/* $Id$
+ * Include file for lufs interface module attribute functions for libcaptive
+ * Copyright (C) 2002 Jan Kratochvil <project-captive@jankratochvil.net>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; exactly version 2 of June 1991 is required
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+
+#ifndef _CAPTIVE_LUFS_CAPTIVEFS_ATTR_H
+#define _CAPTIVE_LUFS_CAPTIVEFS_ATTR_H 1
+
+
+#include <glib/gtypes.h>
+#include <libgnomevfs/gnome-vfs-file-info.h>
+
+#include <lufs/proto.h>
+
+
+G_BEGIN_DECLS
+
+gboolean captivefs_GnomeVFSFileInfo_to_lufs_fattr(struct lufs_fattr *fattr,const GnomeVFSFileInfo *file_info);
+gboolean captivefs_lufs_fattr_to_GnomeVFSFileInfo(GnomeVFSFileInfo *file_info,const struct lufs_fattr *fattr);
+
+G_END_DECLS
+
+
+#endif /* _CAPTIVE_LUFS_CAPTIVEFS_ATTR_H */
diff --git a/src/client/lufs/captivefs-directory.c b/src/client/lufs/captivefs-directory.c
new file mode 100644 (file)
index 0000000..bc87732
--- /dev/null
@@ -0,0 +1,168 @@
+/* $Id$
+ * lufs interface module directory objects implementation for libcaptive
+ * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; exactly version 2 of June 1991 is required
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+
+#include "config.h"
+
+#include <glib/gmessages.h>
+#include "captivefs-misc.h"
+#include "captivefs-attr.h"
+
+#include <captive/client-vfs.h>
+#include <captive/client-directory.h>
+
+#include <lufs/fs.h>
+#include <lufs/proto.h>
+
+
+/* Read a directory's content
+ * For each directory entry, call 
+ *    lu_cache_add2dir(struct directory *dir, char *name, char *link, struct lufs_fattr *fattr)
+ * to add its information.
+ * The link is optional(NULL) and applicable only if the entry is a 
+ * (sym)link and we have the target info at hand.
+ *
+ * Notes:
+ *     dir_name is an absolute path.  However, it is generally a good idea
+ * to either change to that directory here or at least keep track of what
+ * directory was being called on, for function calls that might not get
+ * absolute paths.
+ *     If your filesystem doesn't natively support '.' or '..', don't forget
+ * to add them to the cache first-thing here.
+ */
+int captivefs_readdir(CaptiveVfsObject *captive_vfs_object,const char *dir_name,struct directory *ddir)
+{
+struct lufs_fattr fattr;
+GnomeVFSResult errvfsresult;
+CaptiveDirectoryObject *captive_directory_object;
+GnomeVFSFileInfo file_info;
+const char *dots[]={".","..",NULL},**csp;
+
+       g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),-1);
+       g_return_val_if_fail(dir_name!=NULL,-1);
+       g_return_val_if_fail(ddir!=NULL,-1);
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_readdir: dir_name=%s",dir_name);
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_directory_new_open(&captive_directory_object,captive_vfs_object,dir_name);
+       G_UNLOCK(libcaptive);
+       if (errvfsresult!=GNOME_VFS_OK)
+               goto fail;
+
+       file_info.valid_fields=GNOME_VFS_FILE_INFO_FIELDS_TYPE;
+       file_info.type=GNOME_VFS_FILE_TYPE_DIRECTORY;
+       if (!captivefs_GnomeVFSFileInfo_to_lufs_fattr(&fattr,&file_info))
+               goto fail_unref;
+       for (csp=dots;*csp;csp++)
+               if (0>lu_cache_add2dir(ddir,(/* de-const */ char *)*csp,NULL,&fattr)) {
+                       g_warning("Failed lu_cache_add2dir() for: %s",*csp);
+                       goto fail_unref;
+                       }
+
+       for (;;) {
+               G_LOCK(libcaptive);
+               errvfsresult=captive_directory_read(captive_directory_object,&file_info);
+               G_UNLOCK(libcaptive);
+               if (errvfsresult==GNOME_VFS_ERROR_EOF)
+                       break;
+               if (errvfsresult!=GNOME_VFS_OK)
+                       goto fail_unref;
+
+               if (!captivefs_GnomeVFSFileInfo_to_lufs_fattr(&fattr,&file_info))
+                       goto fail_unref;
+
+               if (0>lu_cache_add2dir(ddir,file_info.name,NULL,&fattr)) {
+                       g_warning("Failed lu_cache_add2dir() for: %s",file_info.name);
+                       goto fail_unref;
+                       }
+
+               g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_readdir: got: %s",file_info.name);
+               }
+
+       G_LOCK(libcaptive);
+       g_object_unref(captive_directory_object);
+       G_UNLOCK(libcaptive);
+
+       return 0;
+
+fail_unref:
+       G_LOCK(libcaptive);
+       g_object_unref(captive_directory_object);
+       G_UNLOCK(libcaptive);
+fail:
+       return -1;
+}
+
+
+/* Create a directory
+ */
+int captivefs_mkdir(CaptiveVfsObject *captive_vfs_object,const char *dir,int mode)
+{
+CaptiveDirectoryObject *captive_directory_object;
+GnomeVFSResult errvfsresult;
+
+       g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),-1);
+       g_return_val_if_fail(dir!=NULL,-1);
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_mkdir: dir=%s,mode=0x%X",dir,mode);
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_directory_new_make(&captive_directory_object,captive_vfs_object,dir,mode);
+       G_UNLOCK(libcaptive);
+       if (errvfsresult!=GNOME_VFS_OK)
+               return -1;
+
+       G_LOCK(libcaptive);
+       g_object_unref(captive_directory_object);
+       G_UNLOCK(libcaptive);
+
+       return 0;
+}
+
+
+/* Delete a directory
+ */
+int captivefs_rmdir(CaptiveVfsObject *captive_vfs_object,const char *dir)
+{
+CaptiveDirectoryObject *captive_directory_object;
+GnomeVFSResult errvfsresult;
+
+       g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),-1);
+       g_return_val_if_fail(dir!=NULL,-1);
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_rmdir: dir=%s",dir);
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_directory_new_open(&captive_directory_object,captive_vfs_object,dir);
+       G_UNLOCK(libcaptive);
+       if (errvfsresult!=GNOME_VFS_OK)
+               return -1;
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_directory_remove(captive_directory_object);
+       G_UNLOCK(libcaptive);
+
+       G_LOCK(libcaptive);
+       g_object_unref(captive_directory_object);
+       G_UNLOCK(libcaptive);
+
+       if (errvfsresult!=GNOME_VFS_OK)
+               return -1;
+       return 0;
+}
diff --git a/src/client/lufs/captivefs-file.c b/src/client/lufs/captivefs-file.c
new file mode 100644 (file)
index 0000000..494c71f
--- /dev/null
@@ -0,0 +1,431 @@
+/* $Id$
+ * lufs interface module file objects implementation for libcaptive
+ * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; exactly version 2 of June 1991 is required
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+
+#include "config.h"
+
+#include <glib/gmessages.h>
+#include "captivefs-misc.h"
+#include "captivefs-attr.h"
+#include <fcntl.h>
+
+#include <captive/client-vfs.h>
+#include <captive/client-file.h>
+
+#include <lufs/fs.h>
+
+
+/* Read a file/dir's attributes
+ * Fill all relevant data into the fattr structure.
+ * The uid/gid fields are just ownership hints hints:
+ *    != 0 => we own the file
+ *    == 0 => we don't own it
+ * The credentials structure (if applicable and saved from _init)
+ * can help determine ownership based on remote uids/gids.
+ *
+ * Notes:
+ *     If your filesysem doesn't natively support '.' or '..',
+ * don't forget to special-case them here.
+ *     It is best to assume that name is a relative path, not an
+ * absolute one.  Thus, you need to either be keeping track of the
+ * last accessed directory in readdir, or, as this code does, changing
+ * to the current directory there.
+ */
+int captivefs_stat(CaptiveVfsObject *captive_vfs_object,const char *name,struct lufs_fattr *fattr)
+{
+GnomeVFSResult errvfsresult;
+CaptiveFileObject *captive_file_object;
+GnomeVFSFileInfo file_info;
+
+       g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),-1);
+       g_return_val_if_fail(name!=NULL,-1);
+       g_return_val_if_fail(fattr!=NULL,-1);
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_stat: name=%s",name);
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_file_new_open(&captive_file_object,captive_vfs_object,name,GNOME_VFS_OPEN_READ);
+       G_UNLOCK(libcaptive);
+       if (errvfsresult!=GNOME_VFS_OK)
+               goto fail;
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_file_file_info_get(captive_file_object,&file_info);
+       G_UNLOCK(libcaptive);
+       if (errvfsresult!=GNOME_VFS_OK)
+               goto fail_unref;
+
+       G_LOCK(libcaptive);
+       g_object_unref(captive_file_object);
+       G_UNLOCK(libcaptive);
+
+       if (!captivefs_GnomeVFSFileInfo_to_lufs_fattr(fattr,&file_info))
+               return -1;
+
+       return 0;
+
+fail_unref:
+       G_LOCK(libcaptive);
+       g_object_unref(captive_file_object);
+       G_UNLOCK(libcaptive);
+fail:
+       return -1;
+}
+
+
+/* Create a file
+ */
+int captivefs_create(CaptiveVfsObject *captive_vfs_object,const char *file,int mode)
+{
+GnomeVFSResult errvfsresult;
+CaptiveFileObject *captive_file_object;
+
+       g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),-1);
+       g_return_val_if_fail(file!=NULL,-1);
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_create: file=%s,mode=0x%X",file,mode);
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_file_new_create(&captive_file_object,captive_vfs_object,file,GNOME_VFS_OPEN_WRITE,
+                       FALSE,  /* exclusive */
+                       mode);  /* perm */
+       G_UNLOCK(libcaptive);
+       if (errvfsresult!=GNOME_VFS_OK)
+               return -1;
+
+       G_LOCK(libcaptive);
+       g_object_unref(captive_file_object);
+       G_UNLOCK(libcaptive);
+
+       return 0;
+}
+
+
+/* Delete a file
+ */
+int captivefs_unlink(CaptiveVfsObject *captive_vfs_object,const char *file)
+{
+GnomeVFSResult errvfsresult;
+CaptiveFileObject *captive_file_object;
+
+       g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),-1);
+       g_return_val_if_fail(file!=NULL,-1);
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_unlink: file=%s",file);
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_file_new_open(&captive_file_object,captive_vfs_object,file,GNOME_VFS_OPEN_WRITE);
+       G_UNLOCK(libcaptive);
+       if (errvfsresult!=GNOME_VFS_OK)
+               goto fail;
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_file_remove(captive_file_object);
+       G_UNLOCK(libcaptive);
+       if (errvfsresult!=GNOME_VFS_OK)
+               goto fail_unref;
+
+       G_LOCK(libcaptive);
+       g_object_unref(captive_file_object);
+       G_UNLOCK(libcaptive);
+
+       return 0;
+
+fail_unref:
+       G_LOCK(libcaptive);
+       g_object_unref(captive_file_object);
+       G_UNLOCK(libcaptive);
+fail:
+       return -1;
+}
+
+
+/* Rename a file/dir
+ */
+int captivefs_rename(CaptiveVfsObject *captive_vfs_object,const char *old_name,const char *new_name)
+{
+GnomeVFSResult errvfsresult;
+CaptiveFileObject *captive_file_object;
+
+       g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),-1);
+       g_return_val_if_fail(old_name!=NULL,-1);
+       g_return_val_if_fail(new_name!=NULL,-1);
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_rename: old_name=%s,new_name=%s",old_name,new_name);
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_file_new_open(&captive_file_object,captive_vfs_object,old_name,GNOME_VFS_OPEN_WRITE);
+       G_UNLOCK(libcaptive);
+       if (errvfsresult!=GNOME_VFS_OK)
+               goto fail;
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_file_move(captive_file_object,new_name,
+                       FALSE); /* force_replace */
+       G_UNLOCK(libcaptive);
+       if (errvfsresult!=GNOME_VFS_OK)
+               goto fail_unref;
+
+       G_LOCK(libcaptive);
+       g_object_unref(captive_file_object);
+       G_UNLOCK(libcaptive);
+
+       return 0;
+
+fail_unref:
+       G_LOCK(libcaptive);
+       g_object_unref(captive_file_object);
+       G_UNLOCK(libcaptive);
+fail:
+       return -1;
+}
+
+
+/* map: (const gchar *) -> (CaptiveFileObject *) */
+static GHashTable *FileHandle_hash;
+
+static void FileHandle_hash_value_destroy_func(CaptiveFileObject *captive_file_object)
+{
+       g_return_if_fail(CAPTIVE_FILE_IS_OBJECT(captive_file_object));
+
+       g_object_unref(captive_file_object);
+}
+
+static void FileHandle_hash_init(void)
+{
+       if (FileHandle_hash)
+               return;
+       FileHandle_hash=g_hash_table_new_full(g_str_hash,g_str_equal,
+                       (GDestroyNotify)g_free, /* key_destroy_func */
+                       (GDestroyNotify)FileHandle_hash_value_destroy_func);    /* value_destroy_func */
+}
+
+static CaptiveFileObject *FileHandle_lookup(const char *name)
+{
+CaptiveFileObject *captive_file_object;
+
+       g_return_val_if_fail(name!=NULL,NULL);
+
+       FileHandle_hash_init();
+       if (!(captive_file_object=g_hash_table_lookup(FileHandle_hash,name))) {
+               g_warning("FileHandle_lookup: FileHandle not found of: %s",name);
+               return NULL;
+               }
+
+       g_assert(CAPTIVE_FILE_IS_OBJECT(captive_file_object));
+
+       return captive_file_object;
+}
+
+
+/* Open a file
+ *
+ * Notes:
+ *     By default, LUFS has no concept of file handles.  To implement file
+ * handles, take a look at the atbl class in sshfs - it is easy to cut&paste
+ * for use, and can be easily adapted for whatever purpose you need handles
+ * for.
+ *
+ *     Unlike the POSIX open command which has both a "mode" variable and
+ * a "flags" variable, this only has a "mode" variable.  To convert to the
+ * POSIX version, ->flags=mode^O_ACCMODE and ->mode=mode&O_ACCMODE.
+ */
+int captivefs_open(CaptiveVfsObject *captive_vfs_object,const char *file,unsigned mode)
+{
+CaptiveFileObject *captive_file_object;
+GnomeVFSOpenMode gnome_vfs_open_mode;
+GnomeVFSResult errvfsresult;
+
+       g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),-1);
+       g_return_val_if_fail(file!=NULL,-1);
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_open: file=%s,mode=0x%X",file,mode);
+
+       FileHandle_hash_init();
+       if ((captive_file_object=g_hash_table_lookup(FileHandle_hash,file))) {
+               g_assert(CAPTIVE_FILE_IS_OBJECT(captive_file_object));
+               g_warning("captivefs_open: FileHandle already exists of: %s",file);
+               return -1;
+               }
+
+       if (mode & (O_RDONLY|O_WRONLY|O_RDWR)) {
+               g_warning("captivefs_open: Unrecognized 'mode' 0x%X",mode);
+               return -1;
+               }
+       switch (mode & (O_RDONLY|O_WRONLY|O_RDWR)) {
+               case O_RDONLY: gnome_vfs_open_mode=GNOME_VFS_OPEN_READ;  break;
+               case O_WRONLY: gnome_vfs_open_mode=GNOME_VFS_OPEN_WRITE; break;
+               case O_RDWR:   gnome_vfs_open_mode=GNOME_VFS_OPEN_READ|GNOME_VFS_OPEN_WRITE; break;
+               default:
+                       g_warning("captivefs_open: Unrecognized 'mode' 0x%X",mode);
+                       return -1;
+               }
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_file_new_open(&captive_file_object,captive_vfs_object,file,
+                       gnome_vfs_open_mode|GNOME_VFS_OPEN_RANDOM);
+       G_UNLOCK(libcaptive);
+       if (errvfsresult!=GNOME_VFS_OK)
+               return -1;
+
+       g_hash_table_insert(FileHandle_hash,g_strdup(file),captive_file_object);
+
+       return 0;
+}
+
+
+int captivefs_release(CaptiveVfsObject *captive_vfs_object,const char *file)
+{
+       g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),-1);
+       g_return_val_if_fail(file!=NULL,-1);
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_release: file=%s",file);
+
+       FileHandle_hash_init();
+       if (!g_hash_table_remove(FileHandle_hash,file)) {
+               g_warning("captivefs_release: FileHandle not found of: %s",file);
+               return -1;
+               }
+
+       return 0;
+}
+
+
+/* Read from a file. Changed to use the (2) routines not for efficiency,
+ * but to make it work with 64-bit offsets :-(.
+ */
+int captivefs_read(CaptiveVfsObject *captive_vfs_object,const char *file,long long offset,unsigned long count,void *buf)
+{
+CaptiveFileObject *captive_file_object;
+GnomeVFSFileSize bytes_read;
+GnomeVFSResult errvfsresult;
+
+       g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),-1);
+       g_return_val_if_fail(file!=NULL,-1);
+       g_return_val_if_fail(buf!=NULL || count==0,-1);
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_read: file=%s,offset=%" G_GINT64_FORMAT ",count=0x%lX",
+                       file,(gint64)offset,count);
+
+       if (!(captive_file_object=FileHandle_lookup(file)))
+               return -1;
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_file_seek(captive_file_object,GNOME_VFS_SEEK_START,offset);
+       G_UNLOCK(libcaptive);
+       if (errvfsresult!=GNOME_VFS_OK)
+               return -1;
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_file_read(captive_file_object,buf,count,&bytes_read);
+       G_UNLOCK(libcaptive);
+       if (errvfsresult!=GNOME_VFS_OK)
+               return -1;
+
+       if (bytes_read>INT_MAX) {
+               g_warning("captivefs_read: Read %" G_GUINT64_FORMAT " bytes > INT_MAX=%d; dropped data",
+                               (guint64)bytes_read,INT_MAX);
+               bytes_read=INT_MAX;
+               }
+
+       return bytes_read;
+}
+
+
+/* Write to a file
+ */
+int captivefs_write(CaptiveVfsObject *captive_vfs_object,const char *file,long long offset,unsigned long count,const void *buf)
+{
+CaptiveFileObject *captive_file_object;
+GnomeVFSFileSize bytes_written;
+GnomeVFSResult errvfsresult;
+
+       g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),-1);
+       g_return_val_if_fail(file!=NULL,-1);
+       g_return_val_if_fail(buf!=NULL || count==0,-1);
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_write: file=%s,offset=%" G_GINT64_FORMAT ",count=0x%lX",
+                       file,(gint64)offset,count);
+
+       if (!(captive_file_object=FileHandle_lookup(file)))
+               return -1;
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_file_seek(captive_file_object,GNOME_VFS_SEEK_START,offset);
+       G_UNLOCK(libcaptive);
+       if (errvfsresult!=GNOME_VFS_OK)
+               return -1;
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_file_write(captive_file_object,buf,count,&bytes_written);
+       G_UNLOCK(libcaptive);
+       if (errvfsresult!=GNOME_VFS_OK)
+               return -1;
+
+       if (bytes_written>INT_MAX) {
+               g_warning("captivefs_written: Written %" G_GUINT64_FORMAT " bytes > INT_MAX=%d; dropped data",
+                               (guint64)bytes_written,INT_MAX);
+               bytes_written=INT_MAX;
+               }
+
+       return bytes_written;
+}
+
+
+/* Change a file/dir's attributes
+ */
+int captivefs_setattr(CaptiveVfsObject *captive_vfs_object,const char *file,const struct lufs_fattr *fattr)
+{
+GnomeVFSFileInfo file_info;
+GnomeVFSResult errvfsresult;
+CaptiveFileObject *captive_file_object;
+
+       g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),-1);
+       g_return_val_if_fail(file!=NULL,-1);
+       g_return_val_if_fail(fattr!=NULL,-1);
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_setattr: file=%s",file);
+
+       if (!captivefs_lufs_fattr_to_GnomeVFSFileInfo(&file_info,fattr))
+               return -1;
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_file_new_open(&captive_file_object,captive_vfs_object,file,GNOME_VFS_OPEN_WRITE);
+       G_UNLOCK(libcaptive);
+       if (errvfsresult!=GNOME_VFS_OK)
+               goto fail;
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_file_file_info_set(captive_file_object,&file_info,file_info.valid_fields);
+       G_UNLOCK(libcaptive);
+       if (errvfsresult!=GNOME_VFS_OK)
+               goto fail_unref;
+
+       G_LOCK(libcaptive);
+       g_object_unref(captive_file_object);
+       G_UNLOCK(libcaptive);
+
+       return 0;
+
+fail_unref:
+       G_LOCK(libcaptive);
+       g_object_unref(captive_file_object);
+       G_UNLOCK(libcaptive);
+fail:
+       return -1;
+}
diff --git a/src/client/lufs/captivefs-misc.c b/src/client/lufs/captivefs-misc.c
new file mode 100644 (file)
index 0000000..738ee57
--- /dev/null
@@ -0,0 +1,73 @@
+/* $Id$
+ * lufs interface module misc functions for libcaptive
+ * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; exactly version 2 of June 1991 is required
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+
+#include "config.h"
+
+#include "captivefs-misc.h"    /* self */
+#include <glib/gmessages.h>
+
+#include <captive/client-vfs.h>
+
+
+/* module-scope lock for _any_ libcaptive access */
+G_LOCK_DEFINE(libcaptive);
+
+
+/* Resolve a link (if the info was not added to the dir cache when 
+ * reading the parent dir)
+ */
+int captivefs_readlink(CaptiveVfsObject *captive_vfs_object,const char *link,char *buf,int buflen)
+{
+       g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),-1);
+       g_return_val_if_fail(link!=NULL,-1);
+       g_return_val_if_fail(buf!=NULL,-1);
+       g_return_val_if_fail(buflen>0,-1);
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_readlink: link=%s,buflen=%d",link,buflen);
+
+       return -1;      /* unsupported by W32 */
+}
+
+
+/* Create a link
+ */
+int captivefs_link(CaptiveVfsObject *captive_vfs_object,const char *target,const char *lnk)
+{
+       g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),-1);
+       g_return_val_if_fail(target!=NULL,-1);
+       g_return_val_if_fail(lnk!=NULL,-1);
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_link: target=%s,lnk=%s",target,lnk);
+
+       return -1;      /* unsupported by W32 */
+}
+
+
+/* Create a symlink
+ */
+int captivefs_symlink(CaptiveVfsObject *captive_vfs_object,const char *target,const char *link)
+{
+       g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),-1);
+       g_return_val_if_fail(target!=NULL,-1);
+       g_return_val_if_fail(link!=NULL,-1);
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_symlink: target=%s,link=%s",target,link);
+
+       return -1;      /* unsupported by W32 */
+}
diff --git a/src/client/lufs/captivefs-misc.h b/src/client/lufs/captivefs-misc.h
new file mode 100644 (file)
index 0000000..6665720
--- /dev/null
@@ -0,0 +1,34 @@
+/* $Id$
+ * Include file for lufs interface module misc functions for libcaptive
+ * Copyright (C) 2002 Jan Kratochvil <project-captive@jankratochvil.net>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; exactly version 2 of June 1991 is required
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+
+#ifndef _CAPTIVE_LUFS_CAPTIVEFS_MISC_H
+#define _CAPTIVE_LUFS_CAPTIVEFS_MISC_H 1
+
+
+#include <glib/gthread.h>
+
+
+G_BEGIN_DECLS
+
+G_LOCK_EXTERN(libcaptive);
+
+G_END_DECLS
+
+
+#endif /* _CAPTIVE_LUFS_CAPTIVEFS_MISC_H */
diff --git a/src/client/lufs/captivefs-vfs.c b/src/client/lufs/captivefs-vfs.c
new file mode 100644 (file)
index 0000000..0696d77
--- /dev/null
@@ -0,0 +1,207 @@
+/* $Id$
+ * lufs interface module vfs objects implementation for libcaptive
+ * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
+ * 
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; exactly version 2 of June 1991 is required
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+
+#include "config.h"
+
+#include <glib/gmessages.h>
+#include "captivefs-misc.h"
+
+#include <captive/client-vfs.h>
+#include <captive/options.h>
+#include <captive/macros.h>
+
+#include <lufs/fs.h>
+
+
+/* Initialization
+ * Here we allocate a structure to hold all the file system local info 
+ * (localfs_local). This structure will then be passed as a parameter to 
+ * the other functions.
+ * global_ctx holds info about another structure that can be shared between all
+ * instances of the filesystem. If the pointer is NULL, then this is the
+ * first instance and the structure should be allocated.
+ * ! You must implement  locking/usage-count/deallocation logic when using
+ *   a global context. (locking is omited here)
+ * ! Most filesystems don't need a global context so you can safely ignore the
+ *   global_ctx parameter.  
+ */
+CaptiveVfsObject *captivefs_init
+               (struct list_head *cfg,struct dir_cache *cache,const struct credentials *cred,void **global_ctx)
+{
+CaptiveVfsObject *captive_vfs_object;
+struct captive_options options;
+GnomeVFSResult errvfsresult;
+const struct poptOption *cpopt;
+GPtrArray *arg_array;
+const gchar *cgs;
+poptContext context;
+int errint;
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_init");
+
+       arg_array=g_ptr_array_new();
+       if (!(cgs=lu_opt_getchar(cfg,"MOUNT","fs")))
+               cgs="captivefs";
+       g_ptr_array_add(arg_array,(/* de-const */ char *)cgs);
+       for (cpopt=captive_popt;cpopt->argInfo || cpopt->longName;cpopt++) {
+const gchar *dashdashname,*value;
+
+               if (!cpopt->longName)
+                       continue;
+               dashdashname=captive_printf_alloca("--%s",cpopt->longName);
+               if (1
+                               && !(value=lu_opt_getchar(cfg,"MOUNT",(/* de-const */ char *)dashdashname))
+                               && !(value=lu_opt_getchar(cfg,"MOUNT",(/* de-const */ char *)cpopt->longName)))
+                       continue;
+               g_ptr_array_add(arg_array,(/* de-const */ char *)captive_printf_alloca("%s=%s",dashdashname,value));
+               }
+       g_ptr_array_add(arg_array,NULL);
+       g_assert(arg_array->len>=2);
+       g_assert(arg_array->pdata[arg_array->len-2]!=NULL);
+       g_assert(arg_array->pdata[arg_array->len-1]==NULL);
+
+       /* Initialize GObject subsystem of GLib. */
+       g_type_init();
+
+       captive_options_init(&options);
+       captive_options=&options;       /* for parsing by 'CAPTIVE_POPT_INCLUDE' */
+
+       context=poptGetContext(
+                       PACKAGE,        /* name */
+                       arg_array->len-1,       /* argc */
+                       (const char **)arg_array->pdata,        /* argv */
+                       captive_popt,   /* options */
+                       POPT_CONTEXT_POSIXMEHARDER);    /* flags; && !POPT_CONTEXT_KEEP_FIRST */
+       if (context==NULL) {
+               g_warning("%s: argument recognization args_error","captivefs_init");
+               goto fail_free_options;
+               }
+       errint=poptReadDefaultConfig(context,
+                       TRUE);  /* useEnv */
+       if (errint!=0) {
+               g_warning("%s: argument recognization args_error","captivefs_init");
+               goto fail_free_options;
+               }
+       errint=poptGetNextOpt(context);
+       if (errint!=-1) {
+               g_warning("%s: some non-callbacked argument reached","captivefs_init");
+               goto fail_free_options;
+               }
+       cgs=poptPeekArg(context);
+       if (cgs) {
+               g_warning("%s: some non-option argument reached","captivefs_init");
+               goto fail_free_options;
+               }
+
+       captive_options=NULL;   /* already parsed by 'CAPTIVE_POPT_INCLUDE' */
+
+       /* image_iochannel */
+       if ((cgs=lu_opt_getchar(cfg,"MOUNT","image"))) {
+               g_assert(options.image_iochannel==NULL);
+               if (!(options.image_iochannel=g_io_channel_new_file(
+                               cgs,    /* filename */
+                               (options.rwmode==CAPTIVE_OPTION_RWMODE_RW ? "r+" : "r"),        /* mode */
+                               NULL))) {       /* error */
+                       g_warning(_("%s: image_iochannel open failed"),"captivefs_init");
+                       goto fail_free_options;
+                       }
+               }
+
+       G_LOCK(libcaptive);
+       errvfsresult=captive_vfs_new(&captive_vfs_object,&options);
+       G_UNLOCK(libcaptive);
+
+       if (errvfsresult!=GNOME_VFS_OK)
+               goto fail_unref_image_iochannel;
+
+       g_object_set_data(G_OBJECT(captive_vfs_object),"captivefs-vfs-image_iochannel",options.image_iochannel);
+       captive_options_free(&options);
+       g_ptr_array_free(arg_array,
+                       FALSE); /* free_seg */
+
+       return captive_vfs_object;
+
+fail_unref_image_iochannel:
+       g_io_channel_unref(options.image_iochannel);
+fail_free_options:
+       captive_options_free(&options);
+/* fail_free_arg_array: */
+       g_ptr_array_free(arg_array,
+                       FALSE); /* free_seg */
+/* fail: */
+       return NULL;
+}
+
+
+/* Cleanup
+ * Check the global context count and free it if necessary.
+ * Deallocate memory and free all resources.
+ */
+void captivefs_free(CaptiveVfsObject *captive_vfs_object)
+{
+GIOChannel *image_iochannel;
+
+       g_return_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object));
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_free");
+
+       image_iochannel=g_object_get_data(G_OBJECT(captive_vfs_object),"captivefs-vfs-image_iochannel");
+       g_assert(image_iochannel!=NULL);
+       g_object_set_data(G_OBJECT(captive_vfs_object),"captivefs-vfs-image_iochannel",NULL);   /* just a sanity */
+       /* Keep 'image_iochannel' reffed until 'g_object_unref(captive_vfs_object)'. */
+
+       G_LOCK(libcaptive);
+       g_object_unref(captive_vfs_object);
+       G_UNLOCK(libcaptive);
+
+       g_io_channel_unref(image_iochannel);
+}
+
+
+/* Mount the file system.
+ * Called when a mount operation is performed.
+ * Initialize specific connections, login, etc.
+ *
+ * Notes:
+ *     By default, LUFS may attempt multiple connections at once.  If your
+ * filesystem doesn't support this, you need to specificy -c 1 on the
+ * lufsmount command line or connections=1 in the mount options.
+ *     See ftpfs for an example of how to read configuration options
+ * from a configuration file if you want to, for example, be able to set
+ * default values.
+ */
+int captivefs_mount(CaptiveVfsObject *captive_vfs_object)
+{
+       g_return_val_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object),0);
+    
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_mount");
+
+       return 1;       /* NEVER return 0 */
+}
+
+
+/* Unmount the  file system
+ * Called when the file system is unmounted.
+ */
+void captivefs_umount(CaptiveVfsObject *captive_vfs_object)
+{
+       g_return_if_fail(CAPTIVE_VFS_IS_OBJECT(captive_vfs_object));
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"captivefs_umount");
+}