compressor: Better arch ifdefs for isal code

Signed-off-by: Dan Mick <dan.mick@redhat.com>
This commit is contained in:
Dan Mick 2016-07-25 20:03:18 -07:00 committed by Alyona Kiseleva
parent b759021f32
commit 265899bdcc

View File

@ -99,12 +99,9 @@ int ZlibCompressor::zlib_compress(const bufferlist &in, bufferlist &out)
return 0;
}
#if __x86_64__
int ZlibCompressor::isal_compress(const bufferlist &in, bufferlist &out)
{
#if (__arm__)
derr << "Unsupported architecture" << dendl;
return -1;
#else
int ret;
unsigned have;
isal_zstream strm;
@ -152,15 +149,19 @@ int ZlibCompressor::isal_compress(const bufferlist &in, bufferlist &out)
}
return 0;
#endif
}
#endif
int ZlibCompressor::compress(const bufferlist &in, bufferlist &out)
{
#if __x86_64__
if (isal_enabled)
return isal_compress(in, out);
else
return zlib_compress(in, out);
#else
return zlib_compress(in, out);
#endif
}
int ZlibCompressor::decompress(bufferlist::iterator &p, size_t compressed_size, bufferlist &out)