[haiku-development] Re: NFS fs driver preliminary (not yet working) patch

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 19 Apr 2008 13:19:42 +0200 CEST

Hi Alex,

"Alex Roman" <alex.roman@xxxxxxxxx> wrote:
> As some of you may know, I've been working on a port of the NFS fs to
> the new vfs. I've gotten it to compile, although it will not work yet
> because there are still some issues that I've highlighted below.
> Hopefully we can sort these out...

Nice!

> 1. Patch is not cleaned up. Will clean up before final patch to be 
> submitted.
> 
> 2. Patch breaks non-Haiku sections of the code. Is that code still
> required or can we remove it? Do we plan on backporting any future
> bugfixes to BeOS?

I think it is not necessary to maintain the old BeOS version of that 
file system anymore. We could still resurrect it from an older 
revision, and maintain it somewhere else, if that is desired (similar 
to what I have done with BFS - the BeOS version lives in src/tests/add-
ons/kernel/file_systems/bfs/r5).
IMO, having support for both APIs in one file is way too messy - if I 
would be the one to adapt the file system, I would remove all the 
compatibility stuff, at least.

> 3. publish_vnode() for the root node does not set the right "type"
> (second last parameter of publish_vnode). I am not sure what that 
> type
> is and so I don't know where to get it from.

"type" is the type information you get when you stat() a file. IOW it's 
the stat::st_mode field less the permission bits (although it probably 
doesn't hurt to pass them in there, too). For example, a file would 
have S_IFREG here (see sys/stat.h).

> 4. Mounting fails before getting to publish_vnode(), in fs_mount().
> The function create_socket() fails with error -2147459069. KDL tells
> me that this is:
> kdebug> error -2147459069
> error 0x80006003: No such file or directory
> From the looks of create_socket() it is failing in the kbind() call.
> 
> I am trying to mount the volume with:
> mount_nfs 192.168.2.1:/test_share /test_share 100 100
> 
> My share exists (I can mount from linux) and /test_share exists. I 
> can
> also connect to the server machine (say, through ftp).
> 
> Any ideas on this?

Nope, but I didn't get NFS to work here either, before (might have been 
a version conflict). Have you tried to see what address it passed on to 
bind()?

> 5. This may not be necessary, but fs_walk() used to have a int *type
> parameter, which does not exist anymore in the fs_walk prototype.
> Again I don't know what this type really is (see #3). Since that was
> removed, is there any other struct field that I need to set in place
> of this *type? You can find a 2 TODOs in my patch, in the fs_walk
> function, to see what I am talking about more clearly.

See above :-)

> PS: this is my first patch to Haiku, so I'm sorry if I am not
> following all the guidelines... Patch is not final and will be fixed
> up...

NFS doesn't follow the guidelines at all, anyway. Just one pointer: if 
you have global variables that are not declared static (as your 
sNFSVnodeOps), you have to use the 'g' prefix.

Bye,
   Axel.


Other related posts: