From: ronnie s. <ron...@gm...> - 2013-11-05 04:43:48
|
Hi, I do not have edit rights on the wiki so maybe someone would be kind to do it for me ? I would like to add a new entry to the page "File systems using FUSE" : https://sourceforge.net/apps/mediawiki/fuse/index.php?title=FileSystems The filesystem is called 'fuse_nfs' and is a NFSv3 client built on FUSE. (There are systems that have a port of FUSE but do not have a native kernel nfs client) The FUSE module is shipped with : https://github.com/sahlberg/libnfs The README contains basic instructions on building the FUSE module and link it with libnfs. === fuse_nfs Author: Ronnie Sahlberg <ron...@gm...> Homepage: https://github.com/sahlberg/libnfs Description: fuse_nfs is an NFSv3 client based on libnfs. === regards ronnie sahlberg |
From: Goswin v. B. <gos...@we...> - 2013-11-05 08:28:26
|
On Mon, Nov 04, 2013 at 08:43:41PM -0800, ronnie sahlberg wrote: > Hi, > > I do not have edit rights on the wiki so maybe someone would be kind > to do it for me ? > > I would like to add a new entry to the page "File systems using FUSE" : > https://sourceforge.net/apps/mediawiki/fuse/index.php?title=FileSystems > > > The filesystem is called 'fuse_nfs' and is a NFSv3 client built on FUSE. > (There are systems that have a port of FUSE but do not have a native > kernel nfs client) > > The FUSE module is shipped with : https://github.com/sahlberg/libnfs > The README contains basic instructions on building the FUSE module and > link it with libnfs. > > === > fuse_nfs > Author: Ronnie Sahlberg <ron...@gm...> > Homepage: https://github.com/sahlberg/libnfs > Description: fuse_nfs is an NFSv3 client based on libnfs. > === > > > > regards > ronnie sahlberg Does it do locking? MfG Goswin |
From: Stef B. <st...@gm...> - 2013-11-05 11:40:22
|
Hi, I'm working on a async fuse version to connect to SMB servers. There I have to use the event library/toolset tevent. How does the async event handling work with libnfs? Stef |
From: ronnie s. <ron...@gm...> - 2013-11-05 15:57:58
|
Hi, Fuse_nfs module is a trivial wrapper for the synchronous high-level api in libnfs. This api provides very posix like functions but it is synchronous and blocking. The reason for this is that for trivial applications it is much more convenient to use blocking posix like functions than having to implement a full blown even system. For non-trivial applications, it is much better to use the non-blocking asynchronous high level api. Using this api you still have high level posix-like functions but they are all non-blocking and they all take a callback function. Using this api needs that you either write your own trivial event loop, or you hook libnfs in with your existing eventsystem. The functions nfs_get_fd(), nfs_which_events() and nfs_service() are used for this. See nfsclient-async.c for an example using the async api and how to hook it up with a trivial event loop. Then there is also a third api for raw access to the underlying RPC/XDR layer. This api is also non-blocking and you hook it up with an eventsystem in a similar way as with the high level non-blocking api. This api is not posix like but allows very great controil of the exact rpc's that are sent. This is mainly useful if you really need exact control of the packets sent, like the nfs backend in dbench, but is probably not that useful for general purpose nfs client code. Does that answer your question ? regards ronnie sahlberg On Tue, Nov 5, 2013 at 3:40 AM, Stef Bon <st...@gm...> wrote: > Hi, > > I'm working on a async fuse version to connect to SMB servers. > There I have to use the event library/toolset tevent. How does the async > event handling work with libnfs? > > Stef > > > |
From: Stef B. <st...@gm...> - 2013-11-05 20:35:47
|
2013/11/5 ronnie sahlberg <ron...@gm...> > Hi, > > > For non-trivial applications, it is much better to use the > non-blocking asynchronous high level api. > Yes I agree. > Using this api you still have high level posix-like functions but they > are all non-blocking and they all take a callback function. > Using this api needs that you either write your own trivial event > loop, or you hook libnfs in with your existing eventsystem. > The functions nfs_get_fd(), nfs_which_events() and nfs_service() are > used for this. > See nfsclient-async.c for an example using the async api and how to > hook it up with a trivial event loop. > > I do not understand it fully yet. When I'm ready to try to implement it in my fuse fs I will get back to you. > > Then there is also a third api for raw access to the underlying > RPC/XDR layer. This api is also non-blocking and you hook it up with > an eventsystem in a similar way as with the high level non-blocking > api. This api is not posix like but allows very great controil of the > exact rpc's that are sent. This is mainly useful if you really need > exact control of the packets sent, like the nfs backend in dbench, > but is probably not that useful for general purpose nfs client code. > Is there a call to send a change notify command? Stef |
From: ronnie s. <ron...@gm...> - 2013-11-05 21:01:36
|
On Tue, Nov 5, 2013 at 12:35 PM, Stef Bon <st...@gm...> wrote: >> >> Then there is also a third api for raw access to the underlying >> RPC/XDR layer. This api is also non-blocking and you hook it up with >> an eventsystem in a similar way as with the high level non-blocking >> api. This api is not posix like but allows very great controil of the >> exact rpc's that are sent. This is mainly useful if you really need >> exact control of the packets sent, like the nfs backend in dbench, >> but is probably not that useful for general purpose nfs client code. > > > Is there a call to send a change notify command? > You mean the command that is sent by a NFS server/client to a peer after it has been rebooted in order to trigger lock recovery? I.e. NSM NetworkStatusMonitor (nfs.statd) when it sends a SM_NOTIFY command to a peer ? Like the smnotify.c command in the ctdb sources does? No, libnfs does not yet have the NSM protocol implemented. It supports these protocols : nfs(v3), nlm, mount, portmapper, rquota. The NSM protocol is fairly small though so I can easily add it to libnfs if you want/need it. |
From: ronnie s. <ron...@gm...> - 2013-11-05 21:09:05
|
On Tue, Nov 5, 2013 at 12:35 PM, Stef Bon <st...@gm...> wrote: >> Using this api you still have high level posix-like functions but they >> are all non-blocking and they all take a callback function. >> Using this api needs that you either write your own trivial event >> loop, or you hook libnfs in with your existing eventsystem. >> The functions nfs_get_fd(), nfs_which_events() and nfs_service() are >> used for this. >> See nfsclient-async.c for an example using the async api and how to >> hook it up with a trivial event loop. >> > I do not understand it fully yet. When I'm ready to try to implement it in > my fuse fs I will get back to you. > Hmm, maybe that was not a good example. nfsclient-async.c has an event loop that is a little more complicated since it needs to be able to handle events from two different file descriptors. One socket for the mount protocol and a second socket for the nfs protocol. nfsclient-bcast.c might be a better example. It only has to deal with a single socket. My bad. |
From: Stef B. <st...@gm...> - 2013-11-06 08:09:20
|
No I do not know what you mean by that. I mean the command send from client to server, to instruct the server to watch an object (file or directory) to watch for changes, and when something happens send it back to client in some format. It's just inotify/fsnotify (on linux) but then over the network. SMB (Samba and Windows servers) do have such a command, and as I understand the NFS protocol has also such a command. Stef |
From: ronnie s. <ron...@gm...> - 2013-11-06 14:01:37
|
Ah, There is no such command in NFSv3. NFSv4 has a limited varient of the file change notify command from SMB1/2/3 but NFSv3 does not have any such mechanism. Libnfs only implements the NFSv3 protocol family. On Wed, Nov 6, 2013 at 12:09 AM, Stef Bon <st...@gm...> wrote: > No I do not know what you mean by that. > > I mean the command send from client to server, to instruct the server to > watch an object (file or directory) to watch for changes, and when something > happens send it back to client in some format. > > It's just inotify/fsnotify (on linux) but then over the network. SMB (Samba > and Windows servers) do have such a command, and as I understand the NFS > protocol has also such a command. > > Stef > > |
From: Stef B. <st...@gm...> - 2013-11-10 21:50:52
|
Is it in your planning to implement version 4 of nfs? I will try to use libnfs to access nfs servers. Is it possible to access more than one server at the same time? It looks like the nfs_context is per server/export: look at the struct struct nfs_context { struct rpc_context *rpc; char *server; char *export; ...... } Do I have to program for every export per server a different nfs_context? |
From: ronnie s. <ron...@gm...> - 2013-11-10 23:14:47
|
On Sun, Nov 10, 2013 at 1:50 PM, Stef Bon <st...@gm...> wrote: > > Is it in your planning to implement version 4 of nfs? I do not plan to add NFSv4 at this stage. > > I will try to use libnfs to access nfs servers. > > Is it possible to access more than one server at the same time? > It looks like the nfs_context is per server/export: > > look at the struct > > struct nfs_context { > struct rpc_context *rpc; > char *server; > char *export; > ...... > } > > Do I have to program for every export per server a different nfs_context? Yes, you need one context for each server/export. |