backported from 3.6.20 http://bugs.gentoo.org/153494 --- include/reiserfs_fs.h +++ include/reiserfs_fs.h @@ -38,14 +38,22 @@ # define extern_inline #endif -#include - #ifndef get_unaligned -#if defined(__ppc__) || defined(ppc) || defined(__ppc) || \ - defined(__PPC) || defined(powerpc) || defined(__powerpc__) -# define get_unaligned(ptr) (*(ptr)) -# define put_unaligned(val,ptr) ((void)(*(ptr) = (val))) +#define get_unaligned(ptr) \ +({ \ + __typeof__(*(ptr)) __tmp; \ + memcpy(&__tmp, (ptr), sizeof(*(ptr))); \ + __tmp; \ +}) #endif + +#ifndef put_unaligned +#define put_unaligned(val, ptr) \ +({ \ + __typeof__(*(ptr)) __tmp = (val); \ + memcpy((ptr), &__tmp, sizeof(*(ptr))); \ + (void)0; \ +}) #endif #define get_leXX(xx,p,field) (le##xx##_to_cpu ((p)->field))