mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Fix kernel unaligned access on sparc64
Update the SA_COPY_DATA macro to check if architecture supports efficient unaligned memory accesses at compile time. Otherwise fallback to using the sa_copy_data() function. The kernel provided CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is used to determine availability in kernel space. In user space the x86_64, x86, powerpc, and sometimes arm architectures will define the HAVE_EFFICIENT_UNALIGNED_ACCESS macro. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #7642 Closes #7684
This commit is contained in:
@@ -210,6 +210,14 @@
|
||||
|
||||
#include <sys/byteorder.h>
|
||||
|
||||
/*
|
||||
* CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS will be defined by the Linux
|
||||
* kernel for architectures which support efficient unaligned access.
|
||||
*/
|
||||
#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
|
||||
#define HAVE_EFFICIENT_UNALIGNED_ACCESS
|
||||
#endif
|
||||
|
||||
#if defined(__LITTLE_ENDIAN) && !defined(_LITTLE_ENDIAN)
|
||||
#define _LITTLE_ENDIAN __LITTLE_ENDIAN
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user