[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YYH+wfNdgubpqtyP@casper.infradead.org>
Date: Wed, 3 Nov 2021 03:15:13 +0000
From: Matthew Wilcox <willy@...radead.org>
To: "Darrick J. Wong" <djwong@...nel.org>
Cc: linux-xfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
Jens Axboe <axboe@...nel.dk>,
Christoph Hellwig <hch@...radead.org>
Subject: Re: [PATCH 15/21] iomap: Convert iomap_write_begin and
iomap_write_end to folios
On Tue, Nov 02, 2021 at 04:22:15PM -0700, Darrick J. Wong wrote:
> > + page = folio_file_page(folio, pos >> PAGE_SHIFT);
>
> Isn't this only needed in the BUFFER_HEAD case?
Good catch. Want me to fold this in?
+++ b/fs/iomap/buffered-io.c
@@ -608,7 +608,6 @@ static int iomap_write_begin(const struct iomap_iter *iter,
loff_t pos,
const struct iomap_page_ops *page_ops = iter->iomap.page_ops;
const struct iomap *srcmap = iomap_iter_srcmap(iter);
struct folio *folio;
- struct page *page;
unsigned fgp = FGP_LOCK | FGP_WRITE | FGP_CREAT | FGP_STABLE | FGP_NOFS;
int status = 0;
@@ -632,12 +631,12 @@ static int iomap_write_begin(const struct iomap_iter *iter, loff_t pos,
goto out_no_page;
}
- page = folio_file_page(folio, pos >> PAGE_SHIFT);
if (srcmap->type == IOMAP_INLINE)
status = iomap_write_begin_inline(iter, folio);
- else if (srcmap->flags & IOMAP_F_BUFFER_HEAD)
+ else if (srcmap->flags & IOMAP_F_BUFFER_HEAD) {
+ struct page *page = folio_file_page(folio, pos >> PAGE_SHIFT);
status = __block_write_begin_int(page, pos, len, NULL, srcmap);
- else
+ } else
status = __iomap_write_begin(iter, pos, len, folio);
if (unlikely(status))
Powered by blists - more mailing lists