[OpenAFS-port-darwin] openafs Mac OS 10.1 port
Brian Biswas
bbiswas@email.unc.edu
Fri, 02 Nov 2001 10:51:18 -0500
I needed to make a couple of code changes to get openafs to compile
for Mac OS 10.1:
In directory sys/afs/DARWIN, I changed source files "osi_vm.c" and
"osi_vnodeops.c":
Changed a structure member named "ui_holdcnt" to "ui_refcount"
There is no structure member named "ui_holdcnt". This is in the ubc_info
structure which is defined in /usr/include/sys/ubc.h.
In source file "osi_vm.c", I changed two function calls of the type:
ubc_getobject(vp);
to
ubc_getobject(vp, UBC_FLAGS_NONE);
Compiler complained otherwise.
At this point openafs would build.
When loading src/libafs/MODLOAD/libafs.nonfs.o (which gets installed as:
/usr/vice/etc/afs.kext/Contents/MacOS/afs), the following undefined symbol
errors occur:
%kextload /usr/vice/etc/afs.kext
kmodload: kld(): kmodload: Undefined symbols:kmodload:
kmodload: __ubc_getobject
kmodload: _ubc_info_free
kmodload: kld_load() failed.Error loading module: kmod load error.
These symbols are both defined in /mach, ubc_getobject is
defined globally, but ubc_info_free is local:
%nm mach | grep ubc_getobject
00199408 A _ubc_getobject
%nm mach | grep ubc_info_free
00198df0 a _ubc_info_free
The function prototype for ubc_getobject is in /usr/include/sys/ubc.h:
memory_object_control_t ubc_getobject __P((struct vnode *, int));
There isn't one for ubc_info_free. However there is one for
the similiarly sounding ubc_info_deallocate:
void ubc_info_deallocate __P((struct ubc_info *));
Should ubc_info_free in src/afs/DARWIN/osi_vm.c be ubc_info_deallocate?
If I change it to that, rebuild and try to load the module into the kernel,
I still get the error message about ubc_getobject:
%kextload /usr/vice/etc/afs.kext
kmodload: kld(): kmodload: Undefined symbols:kmodload:
kmodload: __ubc_getobject
kmodload: kld_load() failed.Error loading module: kmod load error.
I don't see why one gets this error message since it is defined in the
kernel.
Ideas???