From: Alexandros S. <al...@gm...> - 2008-07-13 18:30:43
|
Hi all, This is a status update for the Tcl-Fuse project (https://sourceforge.net/projects/tcl-fuse). For those that don't know what tcl-fuse is: It's a Tcl interface to the linux kernel's FUSE subsystem. It provides a Tcl extension that exports the full functionality of the underlying FUSE kernel feature to the Tcl programming language. FUSE, which stands for File-System in User-Space, is a kernel subsystem and accompanying library that allows regular programs to implement a filesystem completely in userspace. The filesystem operations are received by the kernel via the standard Linux VFS interface, and are dispatched to a resident user process for handling (daemon). This extension will enable for: * Easy creation of FUSE filesystem written solely in Tcl * Export of the Tcl VFS via FUSE for all system processes to take advantage. THE DESIGN: The entry point is a new Tcl command named "fuse". This command establishes a binding between FUSE operations and Tcl procedures. It creates a new command for every FUSE filesystem, that can be used to mount it on a specific filesystem directory. There is a proxy C function for every FUSE operation. The proxy function is invoked by FUSE and its job is to translate the C API to a Tcl API, and vice versa for the return value of the Tcl procedure. Currently the level of integration with FUSE is low. This will be improved in due course. For instance, mount parameters are parsed by FUSE, whereas the FUSE events are not handled by Tcl's event loop (which remains stalled). CURRENT STATUS: * Created a TEA build tree and adapted it for the needs of this Project. * Completed a first version of the extension with support for the "getattr", "readdir", "read", "open" and "rename" FUSE operations. * Ported the example hello FUSE filesystem (examples/hello.c in FUSE's source tree) to Tcl (examples/hello.tcl in tcl-fuse's source). * Created a preliminary TclVFS to FUSE Tcl interface (examples/fusevfs.tcl in tcl-fuse's source), that is limited to the aforementioned FUSE operations. WHAT'S COMING NEXT: * Implement the proxy functions for the remaining FUSE operations. * Implement a few subcommands for the "fuse" command, namely: version, unmount, info, context * Create Tcl cleanup procedures to automatically erase state. * Integration of FUSE events to Tcl's event loop and threading model. * Complete the FuseVFS extension. * Documentation (man page). TO FETCH svn checkout https://tcl-fuse.svn.sourceforge.net/svnroot/tcl-fuse TO COMPILE On 32bit: autoconf ./configure --prefix=/usr/local make sudo make install On 64bit systems: autoconf PKG_CFLAGS="-D_FILE_OFFSET_BITS=64" \ ./configure --with-tcl=/usr/lib64 make sudo make install Detailed instructions in README.tclfuse. REQUIREMENTS: * Kernel with FUSE enabled (CONFIG_FUSE_FS) * Tcl 8.5 TO TRY IT OUT: To mount the "hello" filesystem: cd <root of source code tree> tclsh examples/hello.tcl To mount the FuseVFS filesystem that maps the root of Tcl's VFS: cd <root of source code tree> tclsh examples/test_fusevfs.tcl In both cases the examples/mnt directory is where the filesystems will get mounted. I'm looking forward to feedback. Alexandros |
From: Alexandros S. <al...@gm...> - 2008-07-17 16:42:10
|
Hi all, This is a progress update for the Tcl-Fuse project (https://sourceforge.net/projects/tcl-fuse). SINCE LAST UPDATE: * Implemented all the proxy functions that establish an interface between: FUSE API <=> Tcl procedures * Completed the FuseVFS extension that fully exports Tcl's VFS to userspace, via FUSE. * Preliminary API documentation in examples/fusetcl.tcl FUSEVFS: Code at: examples/fusevfs.tcl The FuseVFS extension is implemented in Tcl using the tcl-fuse C extension. It exports the Tcl's VFS on userspace, via FUSE. Based on what it is provided by Tcl, the following FUSE operations have been implemented and tested: getattr readdir readlink open read write rename mknod mkdir unlink rmdir chmod chown symlink link truncate access utimens truncate access flush fsync Whereas the following were not implemented: statfs setxattr getxattr listxattr removexattr opendir releasedir fsyncdir create ftruncate fgetattr destroy lock bmap release either because they weren't necessary (ftruncate, fgetattr, fsyncdir), applicable (bmap), or the necessary information are not provided by Tcl at all (statfs, setxattr, getxattr, listxattr, removexattr). For example, Tcl's VFS does not support "exteded attributes", hence we cannot provided them to FUSE. An other limitation of Tcl's VFS is that it does not support create of fifos, sockets, & device files, and hence it is not supported in FuseVFS either. The release, opendir, and releasedir operations are not necessary due to the state-less nature of this implementation. A state-full version is planned for implementation, which will have greater performance and more thoroughly test tcl-fuse. * Implement a few subcommands of the "fuse" command, namely: delete, version, info & unmount. * Create Tcl cleanup procedures to automatically erase state. * Integration of FUSE events to Tcl's event loop and threading model. * Documentation (man page). TO FETCH svn checkout https://tcl-fuse.svn.sourceforge.net/svnroot/tcl-fuse TO COMPILE On 32bit: autoconf ./configure make sudo make install On 64bit systems: autoconf PKG_CFLAGS="-D_FILE_OFFSET_BITS=64" \ ./configure --with-tcl=/usr/lib64 make sudo make install Detailed instructions in README.tclfuse. REQUIREMENTS: * Kernel with FUSE enabled (CONFIG_FUSE_FS) * Tcl 8.5 * The user mounting a fuse filesystem must be in the "fuse" group (name depends on the distro). TO TRY IT OUT: To mount the "hello" filesystem: cd <root of source code tree> tclsh examples/hello.tcl To mount the FuseVFS filesystem that maps the root of Tcl's VFS: cd <root of source code tree> tclsh examples/test_fusevfs.tcl In both cases the examples/mnt directory is where the filesystems will get mounted. Next status update will come after one or two weeks. Regards, Alexandros |
From: Alexandros S. <al...@gm...> - 2008-08-19 18:13:38
|
Hi all, This is a progress update for the Tcl-Fuse project (https://sourceforge.net/projects/tcl-fuse). SINCE LAST UPDATE: * FUSE events are now served by Tcl's event loop. * Implemented the "version" subcommand of the "fuse" command, which returns the version of the underlying FUSE subsystem. * Created a Tcl cleanup procedure to automatically erase state and unmount any mounted FUSE file systems when the command is deleted. * Created a comprehensive man page, which includes API documentation for FUSE operation handlers. * Released version 1.0 of this software. * Created a home page for the project at sourceforge (which is the html-generated man page). * Fixed some bugs and various spelling errors. At this state of the project, I consider it completed. I will continue maintaining it though. Therefore, if there are any comments, bugs or remarks please speak out, and I will take a look at it. THE TOTAL DELIVERABLES OF THIS SOC PROJECT (IN BRIEF): 1. A Tcl C extension packed in the standard TEA format, that exposes the full functionality (read & write) of the underlying FUSE subsystem to Tcl. (2413 lines of code) 2. Full user documentation, in the form of a man page. (1169 lines) 3. Thorough testing of the extension, by implementing two use cases: * A "hello" filesystem, identical to the one in FUSE's sources, used for demonstration purposes. (74 lines of code) * The FuseVfs filesystem which exports Tcl's internal filesystem view via FUSE, for other processes to take advantage of. (1085 lines of code - most of them comments) TO FETCH Download the latest version from sourceforge. or svn checkout https://tcl-fuse.svn.sourceforge.net/svnroot/tcl-fuse TO COMPILE On 32bit: autoconf ./configure make sudo make install On 64bit systems: autoconf PKG_CFLAGS="-D_FILE_OFFSET_BITS=64" \ ./configure --with-tcl=/usr/lib64 make sudo make install Detailed instructions in README.tclfuse. REQUIREMENTS: * Kernel with FUSE enabled (CONFIG_FUSE_FS) * Tcl 8.4 or greater * The user mounting a fuse filesystem must be in the "fuse" group (name depends on the distro). TO TRY IT OUT: To mount the "hello" filesystem: cd <root of source code tree> tclsh examples/hello.tcl To mount the FuseVFS filesystem that maps the root of Tcl's VFS: cd <root of source code tree> tclsh examples/test_fusevfs.tcl In both cases the examples/mnt directory is where the filesystems will get mounted. Regards, Alexandros |