From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Yue Hu <zbestahu@gmail.com>,
xiang@kernel.org, chao@kernel.org, jefflexu@linux.alibaba.com,
linux-erofs@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org, huyue2@coolpad.com, zhangwen@coolpad.com
Subject: Re: [PATCH] erofs: remove end parameter from z_erofs_pcluster_readmore()
Date: Wed, 24 May 2023 18:45:48 +0800 [thread overview]
Message-ID: <4056d17c-6cdf-0248-b36f-1fbb7a3685e8@linux.alibaba.com> (raw)
In-Reply-To: <20230524101305.22105-1-zbestahu@gmail.com>
On 2023/5/24 03:13, Yue Hu wrote:
> From: Yue Hu <huyue2@coolpad.com>
>
> The `end` argument is pointless if it's not backmost. And we already
> have `headoffset` in struct `*f`, so let's use this offset to get the
> `end` for backmost only instead in this function.
>
> Also, remove linux/prefetch.h since it's not used anymore after commit
> 386292919c25 ("erofs: introduce readmore decompression strategy").
>
> Signed-off-by: Yue Hu <huyue2@coolpad.com>
> ---> fs/erofs/zdata.c | 19 ++++++++-----------
> 1 file changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
> index 5cd971bcf95e..b7ebdc8f2135 100644
> --- a/fs/erofs/zdata.c
> +++ b/fs/erofs/zdata.c
> @@ -5,7 +5,6 @@
> * Copyright (C) 2022 Alibaba Cloud
> */
> #include "compress.h"
> -#include <linux/prefetch.h>
> #include <linux/psi.h>
> #include <linux/cpuhotplug.h>
> #include <trace/events/erofs.h>
> @@ -1825,16 +1824,16 @@ static void z_erofs_runqueue(struct z_erofs_decompress_frontend *f,
> */
> static void z_erofs_pcluster_readmore(struct z_erofs_decompress_frontend *f,
> struct readahead_control *rac,
> - erofs_off_t end,
> - struct page **pagepool,
> - bool backmost)
> + struct page **pagepool, bool backmost)
> {
> struct inode *inode = f->inode;
> struct erofs_map_blocks *map = &f->map;
> - erofs_off_t cur;
> + erofs_off_t cur, end;
> int err;
>
> if (backmost) {
> + end = f->headoffset +
> + rac ? readahead_length(rac) : PAGE_SIZE - 1;
could we avoid "?:" here for readability?
Thanks,
Gao Xiang
next prev parent reply other threads:[~2023-05-24 10:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-24 10:13 [PATCH] erofs: remove end parameter from z_erofs_pcluster_readmore() Yue Hu
2023-05-24 10:45 ` Gao Xiang [this message]
2023-05-24 11:15 ` Yue Hu
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=4056d17c-6cdf-0248-b36f-1fbb7a3685e8@linux.alibaba.com \
--to=hsiangkao@linux.alibaba.com \
--cc=chao@kernel.org \
--cc=huyue2@coolpad.com \
--cc=jefflexu@linux.alibaba.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xiang@kernel.org \
--cc=zbestahu@gmail.com \
--cc=zhangwen@coolpad.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).