|author||Sergiu Ivanov <email@example.com>||2009-08-26 20:43:24 +0300|
|committer||Sergiu Ivanov <firstname.lastname@example.org>||2009-08-26 20:43:24 +0300|
Add some information about file handles.
Diffstat (limited to 'hurd/interface/fs')
1 files changed, 19 insertions, 0 deletions
diff --git a/hurd/interface/fs/17.mdwn b/hurd/interface/fs/17.mdwn
index 0fa18cf7..8895434a 100644
@@ -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`
+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.