Skip to content

machinaut/go-fuse

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GO-FUSE: native bindings for the FUSE kernel module.


HIGHLIGHTS

* High speed: less than 50% slower than libfuse, using the gc
compiler.  For most real world applications, the difference will be
negligible.

* Supports in-process mounting of different FileSystems onto
subdirectories of the FUSE mount.

* Includes two fleshed out examples, zipfs and unionfs.


EXAMPLES

* examples/hello/hello.go contains a 60-line "hello world" filesystem

* zipfs/zipfs.go contains a small and simple read-only filesystem for
  zip and tar files. The corresponding command is in example/zipfs/
  For example,

    mkdir /tmp/mountpoint
    example/zipfs/zipfs /tmp/mountpoint file.zip &
    ls /tmp/mountpoint
    fusermount -u /tmp/mountpoint

* zipfs/multizipfs.go shows how to use in-process mounts to
  combine multiple Go-FUSE filesystems into a larger filesystem.
    
* fuse/loopback.go mounts another piece of the filesystem.
  Functionally, it is similar to a symlink.  A binary to run is in
  example/loopback/ . For example

    mkdir /tmp/mountpoint
    example/loopback/loopback -debug /tmp/mountpoint /some/other/directory &
    ls /tmp/mountpoint
    fusermount -u /tmp/mountpoint

* unionfs/unionfs.go: implements a union mount using 1 R/W branch, and
  multiple R/O branches.

    mkdir -p  /tmp/mountpoint /tmp/writable
    example/unionfs/unionfs /tmp/mountpoint /tmp/writable /usr &
    ls /tmp/mountpoint
    ls -l /tmp/mountpoint/bin/vi
    rm /tmp/mountpoint/bin/vi
    ls -l /tmp/mountpoint/bin/vi
    cat /tmp/writable/*DELETION*/* 

* union/autounionfs.go: creates UnionFs mounts automatically based on
  existence of READONLY symlinks.


Tested on:

- x86 32bits (Fedora 14).
- x86 64bits (Ubuntu Lucid).


BENCHMARKS

We use threaded stats over a read-only filesystem for benchmarking. A
script to do this is in example/benchmark.sh.  A libfuse baseline is
given by running the same test against archivemount
(http://www.cybernoia.de/software/archivemount/), with the locks in
its GetAttr implementation removed.

Data points (time per stat, Go-FUSE version May 1), using java 1.6
src.zip (7000 files).

platform               libfuse      Go-FUSE     difference (%)

Lenovo T60   (2cpu)    83us         99us        19%
Lenovo T400  (2cpu)    38us         58us        52%
DellT3500/Lucid (2cpu) 34us(*)      35us         3%
DellT3500/Lucid (6cpu) 59us         76us        28%

(*) libfuse does not limit the number worker threads.  In the
T3500/2cpu case, the daemon may still run on 6 CPUs (with associated
scaling overhead.)


CREDITS

* Inspired by Taru Karttunen's package, https://bitbucket.org/taruti/go-extra.

* Originally based on Ivan Krasin's https://github.com/krasin/go-fuse-zip


BUGS

Yes, probably.  Report them through golang-nuts@googlegroups.com.


KNOWN PROBLEMS

Grep source code for TODO.  Major topics:

* Missing support for file locking: FUSE_GETLK, FUSE_SETLK, FUSE_SETLKW

* Missing support for FUSE_INTERRUPT, FUSE_NOTIFY, CUSE, BMAP, POLL,
  IOCTL, STATFS

* Partial support for mounting as root (The high level FS api does not
  yet pass caller Uid/Gid/Pid)

* In the high-level API, renames are racy; See also:
  http://sourceforge.net/mailarchive/message.php?msg_id=27550667


LICENSE

Like Go, this library is distributed under the new BSD license.  See
accompanying LICENSE file.

About

FUSE bindings for Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 98.9%
  • Shell 1.1%