-
Notifications
You must be signed in to change notification settings - Fork 49
FUSE
Go to the "src" directory of NFS-GANESHA distribution. Then run:
# ./configure --with-fsal=FUSE # make # make install
- In your source code, replace #include <fuse.h></fuse.h> with #include <ganesha_fuse_wrap.h></ganesha_fuse_wrap.h>
- For linking your program, replace -lfuse with -lganeshaNFS
./my_daemon mount &#45;o vers&#61;3,udp localhost&#58;/ /mnt
Ganesha FUSE-like interface provides most FUSE's "high-level" structures and calls (struct fuse_file_info, struct fuse_operations, fuse_main(), fuse_get_context(), ...)
Basically, it supports FUSE-based filesystems using <fuse.h></fuse.h> (at least version 2.6).
For being able to export your filesystem with NFS-GANESHA, the following features are mandatory:
- getattr must be implemented
- Each entry in your filesystem must have a unic <st_ino,></st_ino,> peer
- You must set a correct value to the "st_mode" field of "struct stat" (type and access mode)
- The "st_nlink" field of "struct stat" must not be null
- Deprecated call "getdir" is not supported, replace it with "readdir"
fuse_main() parameters slightly differ from FUSE implementation.
The expected command line parameters are:
Usage&amp;amp&#59;&amp;&#35;35&#59;58&amp;&#35;59&#59; fusexmp &amp;amp&#59;&amp;&#35;35&#59;91&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;45&amp;&#35;59&#59;hds&amp;amp&#59;&amp;&#35;35&#59;93&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;91&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;45&amp;&#35;59&#59;L &amp;amp&#59;lt&amp;&#35;59&#59;logfile&amp;amp&#59;gt&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;93&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;91&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;45&amp;&#35;59&#59;N &amp;amp&#59;lt&amp;&#35;59&#59;dbg_lvl&amp;amp&#59;gt&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;93&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;91&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;45&amp;&#35;59&#59;f &amp;amp&#59;lt&amp;&#35;59&#59;config_file&amp;amp&#59;gt&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;93&amp;&#35;59&#59; &amp;amp&#59;&amp;&#35;35&#59;91&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;45&amp;&#35;59&#59;h&amp;amp&#59;&amp;&#35;35&#59;93&amp;&#35;59&#59; display this help &amp;amp&#59;&amp;&#35;35&#59;91&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;45&amp;&#35;59&#59;s&amp;amp&#59;&amp;&#35;35&#59;93&amp;&#35;59&#59; single&amp;amp&#59;&amp;&#35;35&#59;45&amp;&#35;59&#59;threaded (for MT&amp;amp&#59;&amp;&#35;35&#59;45&amp;&#35;59&#59;unsafe filesystems) &amp;amp&#59;&amp;&#35;35&#59;91&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;45&amp;&#35;59&#59;L &amp;amp&#59;lt&amp;&#35;59&#59;logfile&amp;amp&#59;gt&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;93&amp;&#35;59&#59; set the logfile for the daemon &amp;amp&#59;&amp;&#35;35&#59;91&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;45&amp;&#35;59&#59;N &amp;amp&#59;lt&amp;&#35;59&#59;dbg_lvl&amp;amp&#59;gt&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;93&amp;&#35;59&#59; set the verbosity level &amp;amp&#59;&amp;&#35;35&#59;91&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;45&amp;&#35;59&#59;f &amp;amp&#59;lt&amp;&#35;59&#59;config_file&amp;amp&#59;gt&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;93&amp;&#35;59&#59; set the config file to be used &amp;amp&#59;&amp;&#35;35&#59;91&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;45&amp;&#35;59&#59;d&amp;amp&#59;&amp;&#35;35&#59;93&amp;&#35;59&#59; the daemon starts in background, in a new process group &amp;amp&#59;&amp;&#35;35&#59;91&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;45&amp;&#35;59&#59;R&amp;amp&#59;&amp;&#35;35&#59;93&amp;&#35;59&#59; daemon will manage RPCSEC_GSS (default is no RPCSEC_GSS) &amp;amp&#59;&amp;&#35;35&#59;91&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;45&amp;&#35;59&#59;F&amp;amp&#59;&amp;&#35;35&#59;93&amp;&#35;59&#59; &amp;amp&#59;lt&amp;&#35;59&#59;nb_flushers&amp;amp&#59;gt&amp;&#35;59&#59; flushes the data cache with purge, but do not answer to requests &amp;amp&#59;&amp;&#35;35&#59;91&amp;&#35;59&#59;&amp;amp&#59;&amp;&#35;35&#59;45&amp;&#35;59&#59;S&amp;amp&#59;&amp;&#35;35&#59;93&amp;&#35;59&#59; &amp;amp&#59;lt&amp;&#35;59&#59;nb_flushers&amp;amp&#59;gt&amp;&#35;59&#59; flushes the data cache without purge, but do not answer to requests
FUSE-binding examples are provided in the GANESHA repository (directory src/example-fuse).
These are the same as provided with FUSE distributions, except that #include <fuse.h></fuse.h> have been changed to #include <ganesha_fuse_wrap.h></ganesha_fuse_wrap.h>.
After compiling GANESHA with FUSE FSAL, you can simply run it the following way:
./fusexmp