All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Yue Hu <zbestahu@gmail.com>
Cc: yuchao0@huawei.com, zbestahu@163.com, huyue2@yulong.com,
	xiang@kernel.org, linux-erofs@lists.ozlabs.org,
	zhangwen@yulong.com
Subject: Re: [PATCH v2] erofs-utils: no compression case for tail-end block in vle_write_indexes()
Date: Sat, 24 Jul 2021 21:57:42 +0800	[thread overview]
Message-ID: <YPwcVurTB8oFt1p0@B-P7TQMD6M-0146.local> (raw)
In-Reply-To: <20210723062739.1415-1-zbestahu@gmail.com>

On Fri, Jul 23, 2021 at 02:27:39PM +0800, Yue Hu wrote:
> From: Yue Hu <huyue2@yulong.com>
> 
> Note that count value will be always greater than EROFS_BLKSIZ when
> calling erofs_compress_destsize() in vle_compress_one(). So, the d1
> always >= 1 for compressed block in vle_write_indexes(). That is to
> say tail-end block can't be compressed.
> 
> Signed-off-by: Yue Hu <huyue2@yulong.com>

Thanks, looks good to me:
Reviewed-by: Gao Xiang <xiang@kernel.org>

Thanks,
Gao Xiang

> ---
> v2: add DBG_BUGON(!raw), a TODO comment.
> 
>  lib/compress.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/compress.c b/lib/compress.c
> index af0c720..40723a1 100644
> --- a/lib/compress.c
> +++ b/lib/compress.c
> @@ -73,10 +73,11 @@ static void vle_write_indexes(struct z_erofs_vle_compress_ctx *ctx,
>  
>  	di.di_clusterofs = cpu_to_le16(ctx->clusterofs);
>  
> -	/* whether the tail-end (un)compressed block or not */
> +	/* whether the tail-end uncompressed block or not */
>  	if (!d1) {
> -		type = raw ? Z_EROFS_VLE_CLUSTER_TYPE_PLAIN :
> -			Z_EROFS_VLE_CLUSTER_TYPE_HEAD;
> +		/* TODO: tail-packing inline compressed data */
> +		DBG_BUGON(!raw);
> +		type = Z_EROFS_VLE_CLUSTER_TYPE_PLAIN;
>  		advise = cpu_to_le16(type << Z_EROFS_VLE_DI_CLUSTER_TYPE_BIT);
>  
>  		di.di_advise = advise;
> -- 
> 1.9.1

      reply	other threads:[~2021-07-24 13:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23  6:27 [PATCH v2] erofs-utils: no compression case for tail-end block in vle_write_indexes() Yue Hu
2021-07-24 13:57 ` Gao Xiang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YPwcVurTB8oFt1p0@B-P7TQMD6M-0146.local \
    --to=hsiangkao@linux.alibaba.com \
    --cc=huyue2@yulong.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=xiang@kernel.org \
    --cc=yuchao0@huawei.com \
    --cc=zbestahu@163.com \
    --cc=zbestahu@gmail.com \
    --cc=zhangwen@yulong.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.