[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZipgXVyehTovrRmp@casper.infradead.org>
Date: Thu, 25 Apr 2024 14:53:33 +0100
From: Matthew Wilcox <willy@...radead.org>
To: "Ritesh Harjani (IBM)" <ritesh.list@...il.com>
Cc: linux-ext4@...r.kernel.org, linux-xfs@...r.kernel.org,
linux-fsdevel@...r.kernel.org,
"Darrick J . Wong" <djwong@...nel.org>,
Ojaswin Mujoo <ojaswin@...ux.ibm.com>, Jan Kara <jack@...e.cz>
Subject: Re: [RFCv3 6/7] iomap: Optimize iomap_read_folio
On Thu, Apr 25, 2024 at 06:58:50PM +0530, Ritesh Harjani (IBM) wrote:
> +static loff_t iomap_read_folio_iter(const struct iomap_iter *iter,
> + struct iomap_readpage_ctx *ctx)
> +{
> + struct folio *folio = ctx->cur_folio;
> + size_t pos = offset_in_folio(folio, iter->pos);
"pos" is position in file. You should call this 'offset'.
> + loff_t length = min_t(loff_t, folio_size(folio) - pos,
> + iomap_length(iter));
> + loff_t done, ret;
> +
> + for (done = 0; done < length; done += ret) {
> + ret = iomap_readpage_iter(iter, ctx, done);
> + if (ret <= 0)
> + return ret;
> + }
Powered by blists - more mailing lists