This reverts commit 421d95b3ea.
Ricardo correctly pointed out that there is more going on here than
typecasting. By removing the locals we are actually causing LEFT and
RIGHT to be evaluated twice which can potentially lead to some
strange side effects as:
1) VERIFY3*() causing a panic but in the panic message the values
look correct such that the assertion shouldn't fail, or:
2) if LEFT or RIGHT are expressions with side-effects (e.g. a call
to a function which changes some state), then when we panic and
examine the crash dump, it may lead to an unexpected state because
we are not expecting certain things to change during the panic,
after the expressions inside VERIFY3*(...) have been evaluated.
3) Also, it may lead to double-panics or deadlocks during panics,
like for example, if the expressions inside VERIFY3*(...) only expect
to be called once (e.g. because they acquire a mutex).
commit 421d95b3ea introduced a compiler
warning on 32-bit systems about casting a pointer to an integer of a
different size. This commit removes the warning by casting the arguments
to snprintf in the same manner as the original VERIFY3_IMPL macro.
This has a minor impact on stack usage of individual functions, but the
VERIFY macros are used so frequently that their overhead may add up.
This macro declared two new local variables to cast its argument types.
Doing the typecast inline eliminates the need for these variables.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
See commit f16dec7e67fe86f3c3556a67865ee715a2964d70 for full
details of this change. But in summary -fstack-check is being
restricted in usage only to locations which must already have
small stack frames.
The ZFS update to onnv_141 brought with it support for a
security label attribute called mlslabel. This feature
depends on zones to work correctly and while I originally
added minimal support for this in libspl that was a mistake.
Supporting this under Linux is not required and this is
just additional troublesome code to support. Long term
something like this could be supported under Linux but it
will need to be clearly thought through them an implemented.
The following files were being left out the tarball which
is used by the 'make rpm' target. This results in a build
failure when building packages which use the tarball.
lib/libspl/include/sys/tsol/*.h
lib/libspl/include/util/*.h
Added print_timestamp() compatibility function, this will be needed
long term but it's a simply enough addition.
Added Solaris style label functions. This was done simply to aid in
the initial update to onnv_141. I'm hopeful that after more careful
inspection all of this can be removed and we can integrate with a
more Linux friendly Solution without breaking any compatibility.
Added several missing headers which are required by the updated
version of ZFS. As usual I just add empty headers if needed because
it's easier than tracking the change against the core ZFS code.
Added SEC, MILLISEC, MICROSEC defines if unavailable.
Added missing xuio structure and typedefs. I'm hopeful these can
be removed as well once we crack the zero-copy nut under Linux.
A change to the nvpair implementation should not have been made in
the libspl-topic branch. This patch fixes that accident by reverting
the change and providing the missing libspl header to allow the
proper building of nvpair_alloc_system.c without the need to modify it.
These changes lay some of the ground work for supporting something
similar to FMA event under Solaris. In particular these changes
add or modify the following areas.
First off an implementation of the gethrestime() function is added
to libspl. Secondly, the missing type processorid_t has been added.
And finally the lib/libspl/include/sys/fm/{protocol.h|util.h} stub
headers have been removed in favor of updating the full versions
in module/zfs/include/sys/fm/{protocol.h|util.h} to work cleanly
in both user and kernel space.
Under linux we open block devices with O_DIRECT which means we must
provide aligned memory buffers. This patch adds the needed umem
interfaces or in the case of caches simply honors alignment provided
at cache creation time.