zfsonlinux/zfs — pull request #442 by Prakash-Surya (2011-11-08 18:09:54+00:00)
Title: Illumos taskq port

Hey Brian,

This patch set isn't ready for inclusion just yet, but I'm looking for some feedback.

The bottom most commit is the actual port of the illumos patch (https://github.com/illumos/illumos-gate/commit/5aeb94743e3be0c51e86f73096334611ae3a058e). It was more or less straight forward to port, although I wasn't sure how to port the changes to files: usr/src/uts/common/fs/zfs/sys/zfs_context.c, usr/src/uts/common/os/taskq.c, and usr/src/uts/common/sys/taskq_impl.h. Are those changes needed? I looked in the spl code and could easily tell if they should be made somewhere in that code base either.

The middle patch was needed to get past a compile error. I _think_ it is the correct thing to do in this situation, although you should look it over and verify that.

And I think the top most patch is definitely wrong, but was a quick hack to get the code to compile. Without this patch it fails with the following snippet of output:

make -C /usr/src/kernels/2.6.32-131.12.1.1chaos.ch5.x86_64 SUBDIRS=`pwd` modules
make[3]: Entering directory `/usr/src/kernels/2.6.32-131.12.1.1chaos.ch5.x86_64'
CC [M] /home/surya1/dev/zfs/module/zcommon/../../module/zcommon/zfs_deleg.o
In file included from /home/surya1/dev/zfs/include/sys/dsl_pool.h:32,
from /home/surya1/dev/zfs/include/sys/dsl_deleg.h:29,
from /home/surya1/dev/zfs/module/zcommon/../../module/zcommon/zfs_deleg.c:38:
/home/surya1/dev/zfs/include/sys/zio.h:431: error: expected specifier-qualifier-list before ‘taskq_ent_t’
make[5]: *** [/home/surya1/dev/zfs/module/zcommon/../../module/zcommon/zfs_deleg.o] Error 1
make[4]: *** [/home/surya1/dev/zfs/module/zcommon] Error 2
make[3]: *** [_module_/home/surya1/dev/zfs/module] Error 2
make[3]: Leaving directory `/usr/src/kernels/2.6.32-131.12.1.1chaos.ch5.x86_64

The taskq_ent_t definition in zfs_context.h is not getting seen when it is included due to the way __KERNEL__ is used. I'm not sure what the "right" solution is.. Should that definition be in a different file?