additional notes: linux inode <> illumos vnode_t - logic is different in many places.
linux attributes <> illumos: ATTR_UID <> AT_UID ATTR_GID <> AT_GID ATTR_XVATTR <> AT_XVATTR probably will be better : #ifdef __illumos__ #define ZFS_ATTR_UID AT_UID #endif #ifdef __linux__ #define ZFS_ATTR_UID ATTR_UID #endif and use ZFS_ATTR_UID in the same code it was just for example. -Igor > On Apr 23, 2019, at 11:02 PM, Jerry Jelinek <[email protected]> wrote: > > In the openzfs meeting today, the topic of ZoL portability issues was raised. > Since I've been porting a lot of the ZoL work back to illumos, I have some > notes on a few different things I've run into. > > - Code uses a Linux errno (EREMOTEIO) that is not available in illumos kernel. > > - SPL cv_timedwait_sig_hires is global, static in illumos kernel. > > - ZoL sys/zfs_context.h defines cv_timedwait_sig_hires as cv_timedwait_hires > which has a different semantic on illumos (this shouldn't have to be > defined at all if cv_timedwait_sig_hires was static in the SPL and code > used > one of the public functions). There are several other cv_*_sig functions > defined in zfs_context.h which use the non-signal cv_wait versions. It seems > like this will lead to different behavior across OSes and encourages > developers to think incorrectly about interruptible vs. non-interruptible > code. > > - The ZoL cv_*_sig definitions have a void return type so nothing attempts to > warn about the unchecked return value. This can lead to a tight loop in the > kernel on platforms where a Unix signal interrupts the cv. > > - SPL sys/sysmacros.h includes sys/debug.h, illumos sys/sysmacros.h does not. > The SPL copy also includes several other headers which are not in the > illumos > version, so this could lead to unintended incompatibility issues over time. > > - SPL extended assert.h with a macro not in illumos (ASSERTV). > -- this one seems like something we should look at adding to illumos > > Let me know if there are any questions on these notes. > > Thanks, > Jerry > > openzfs <https://openzfs.topicbox.com/latest> / openzfs-developer / see > discussions <https://openzfs.topicbox.com/groups/developer> + participants > <https://openzfs.topicbox.com/groups/developer/members> + delivery options > <https://openzfs.topicbox.com/groups/developer/subscription>Permalink > <https://openzfs.topicbox.com/groups/developer/T6a783ef79cc1cfe3-Mfb8be71697a8c4f15fd209d1> ------------------------------------------ openzfs: openzfs-developer Permalink: https://openzfs.topicbox.com/groups/developer/T6a783ef79cc1cfe3-M6acb2fe3e3a32d771cba4f7c Delivery options: https://openzfs.topicbox.com/groups/developer/subscription
