Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

nfs vs nfsserver

I was trying to build a port-amd64 kernel which is an NFS server. (It is also an NFS client, but I intend to load the kernel nfs module for that.)

The kernel build failed with

nfs_syscalls.o: In function `sys_nfssvc': /build/netbsd-local/src/sys/nfs/nfs_syscalls.c:230: undefined reference to `nuidhash_max'

It seems that the global variable nuidhash_max is provided in file nfs/nfs_iod.c but according to nfs/files.nfs, nfs/nfs_iod.c is included in the build only if 'file-system nfs' is configured.

I'm not sure what the correct solution is. One could include nfs_iod.c in NFS servers as well as in clients, but in the modular case that would result it two separate copies of the variable, and I suspect it wouldn't work very well.

A quick grep through all the source files in src/sys shows that this variable is never modified, only initialized once:

quicky:sys {108} find . -name '*.[csh]' | xargs grep nuidhash_max
./nfs/nfs_syscalls.c:extern int nuidhash_max;
./nfs/nfs_syscalls.c:                       if (slp->ns_numuids < nuidhash_max) 
./nfs/nfs_iod.c:int nuidhash_max = NFS_MAXUIDHASH;
./nfs/nfs_iod.c:                        if (nmp->nm_numuids < nuidhash_max) {
quicky:sys {109}

So perhaps both references to the variable should simply be replaced by the NFS_MAXUIDHASH macro, and eliminate the variable completely?

Comments?  Other alternatives?

|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 |   |
| Network Engineer | 0786 F758 55DE 53BA 7731 | |
|                  |                          |  |

Home | Main Index | Thread Index | Old Index