As of r268075, the responsibility of rounding up buffer to optimal size have

been transferred from zio_compress_data to its caller.  Therefore, passing
the 'minblocksize' down will be a no-op.

Eliminate the parameter to reduce diff against upstream.

MFC after:	2 weeks
This commit is contained in:
Xin LI 2014-07-25 06:53:20 +00:00
parent e40b4bf801
commit 883d80c104
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=269086
4 changed files with 4 additions and 7 deletions

View File

@ -5205,7 +5205,7 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hdr)
len = l2hdr->b_asize;
cdata = zio_data_buf_alloc(len);
csize = zio_compress_data(ZIO_COMPRESS_LZ4, l2hdr->b_tmp_cdata,
cdata, l2hdr->b_asize, (size_t)(1ULL << l2hdr->b_dev->l2ad_vdev->vdev_ashift));
cdata, l2hdr->b_asize);
rounded = P2ROUNDUP(csize, (size_t)SPA_MINBLOCKSIZE);
if (rounded > csize) {

View File

@ -81,7 +81,7 @@ extern int lz4_decompress(void *src, void *dst, size_t s_len, size_t d_len,
* Compress and decompress data if necessary.
*/
extern size_t zio_compress_data(enum zio_compress c, void *src, void *dst,
size_t s_len, size_t minblocksize);
size_t s_len);
extern int zio_decompress_data(enum zio_compress c, void *src, void *dst,
size_t s_len, size_t d_len);

View File

@ -1160,10 +1160,8 @@ zio_write_bp_init(zio_t **ziop)
}
if (compress != ZIO_COMPRESS_OFF) {
metaslab_class_t *mc = spa_normal_class(spa);
void *cbuf = zio_buf_alloc(lsize);
psize = zio_compress_data(compress, zio->io_data, cbuf, lsize,
(size_t)metaslab_class_get_minblocksize(mc));
psize = zio_compress_data(compress, zio->io_data, cbuf, lsize);
if (psize == 0 || psize == lsize) {
compress = ZIO_COMPRESS_OFF;
zio_buf_free(cbuf, lsize);

View File

@ -97,8 +97,7 @@ zio_compress_select(enum zio_compress child, enum zio_compress parent)
}
size_t
zio_compress_data(enum zio_compress c, void *src, void *dst, size_t s_len,
size_t minblocksize)
zio_compress_data(enum zio_compress c, void *src, void *dst, size_t s_len)
{
uint64_t *word, *word_end;
size_t c_len, d_len;