-
Notifications
You must be signed in to change notification settings - Fork 28
Home
Quick notes
== uio ==
OSX uio is now opaque, so we can't fiddle with the insides of uid-> anymore. Instead there are a number of API calls to use. uio_offset() etc.
In addition to that, Apple kernel defines "uio_t" as typedef struct uio *uio_t; and use it as "uio_t uio;" and ZFS defines it as typedef struct uio uio_t; and use it as "uio_t *uio;".
MacZFS uses #define uio_t struct uio
to work around that, so that is still around, however, I have generally replaced it with
uio_t *uio; -> struct uio *uio;
At the moment, including <sys/uio.h> will pull in spl/include/sys/uio.h;
#undef uio_t
#include_next <sys/uio.h>
#define uio_t struct uio
which creates a #define over the typedef. The same for sys/vnode.h
== vnode / inode ==
Linux's 'inode' are called 'vnode' on BSD systems, and on OSX it is opaque. So again, we can not see inside vnode struct.
Again we have the same "vnode_t" problem as with uio_t.
vnode_t *vp; -> struct vnode *vp;
== strdup ==
In kernel, use spa_strdup().
== API changes ==
Before
error = dmu_objset_open(osname, DMU_OST_ZFS, mode, &zfsvfs->z_os);
dmu_objset_close(zfsvfs->z_os);
after
error = dmu_objset_own(osname, DMU_OST_ZFS,
readonly ? B_TRUE : B_FALSE, &zfsvfs, &zfsvfs->z_os);
dmu_objset_disown(zfsvfs->z_os, &zfsvfs);
Where "&zfsvfs" is the tag "argument" (passed along as void *)