From 4d4eadbdb37a664b1fbf42fe1cdcb3a75dbb4342 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Wed, 26 Aug 2009 20:43:24 +0300 Subject: Add some information about file handles. --- hurd/interface/fs/17.mdwn | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/hurd/interface/fs/17.mdwn b/hurd/interface/fs/17.mdwn index 0fa18cf7..8895434a 100644 --- a/hurd/interface/fs/17.mdwn +++ b/hurd/interface/fs/17.mdwn @@ -20,3 +20,22 @@ Return a file handle for this file. This can be used by NFS and such. It is not guaranteed that this call will work; if it doesn't, then this filesystem cannot be NFS mounted. +Currently file handles are only used by `nfsd` with the purpose of +having some stable representation of nodes (TODO: Add references). +The only translator library that implements `file_getfh` and the +complementary [[`fsys_getfile`|fsys_getfile]] is `libdiskfs`, so if +you are linking against a different library you should expect that the +filesystem exported by your translator will not be supported by `nfsd` +by default. + +If you would like your non-`libdiskfs` translator to be supported by +`nfsd`, you should implement these two RPCs on your own. The idea is +that to each node exported by your translator you should put in +correspondence a unique file handle. A file handle is a 28-byte +value. The first 4 bytes are not used. Then comes a 4-byte number +which should identify your node somehow (`libdiskfs` uses the index +into the internally maintained node cache). After it there comes a +4-byte number which should bear a similar function to the `st_gen` +field of a `stat` structure. Following this specification, you should +be able to implement `file_getfh` and `fsys_getfile` in a proper way +to get `nfsd` support. -- cgit v1.2.3