From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: linux-fsdevel@vger.kernel.org
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
Damien Le Moal <damien.lemoal@opensource.wdc.com>,
Christoph Hellwig <hch@lst.de>,
"Darrick J . Wong" <djwong@kernel.org>
Subject: [RFC PATCH 01/10] iomap: Pass struct iomap to iomap_alloc_ioend()
Date: Tue, 3 May 2022 07:39:59 +0100 [thread overview]
Message-ID: <20220503064008.3682332-2-willy@infradead.org> (raw)
In-Reply-To: <20220503064008.3682332-1-willy@infradead.org>
iomap_alloc_ioend() does not need the rest of iomap_writepage_ctx;
only the iomap contained in it.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
fs/iomap/buffered-io.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 6c51a75d0be6..03c7c97bc871 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -1222,15 +1222,15 @@ iomap_submit_ioend(struct iomap_writepage_ctx *wpc, struct iomap_ioend *ioend,
return 0;
}
-static struct iomap_ioend *
-iomap_alloc_ioend(struct inode *inode, struct iomap_writepage_ctx *wpc,
- loff_t offset, sector_t sector, struct writeback_control *wbc)
+static struct iomap_ioend *iomap_alloc_ioend(struct inode *inode,
+ struct iomap *iomap, loff_t offset, sector_t sector,
+ struct writeback_control *wbc)
{
struct iomap_ioend *ioend;
struct bio *bio;
bio = bio_alloc_bioset(GFP_NOFS, BIO_MAX_VECS, &iomap_ioend_bioset);
- bio_set_dev(bio, wpc->iomap.bdev);
+ bio_set_dev(bio, iomap->bdev);
bio->bi_iter.bi_sector = sector;
bio->bi_opf = REQ_OP_WRITE | wbc_to_write_flags(wbc);
bio->bi_write_hint = inode->i_write_hint;
@@ -1238,8 +1238,8 @@ iomap_alloc_ioend(struct inode *inode, struct iomap_writepage_ctx *wpc,
ioend = container_of(bio, struct iomap_ioend, io_inline_bio);
INIT_LIST_HEAD(&ioend->io_list);
- ioend->io_type = wpc->iomap.type;
- ioend->io_flags = wpc->iomap.flags;
+ ioend->io_type = iomap->type;
+ ioend->io_flags = iomap->flags;
ioend->io_inode = inode;
ioend->io_size = 0;
ioend->io_folios = 0;
@@ -1305,14 +1305,15 @@ iomap_add_to_ioend(struct inode *inode, loff_t pos, struct folio *folio,
struct iomap_page *iop, struct iomap_writepage_ctx *wpc,
struct writeback_control *wbc, struct list_head *iolist)
{
- sector_t sector = iomap_sector(&wpc->iomap, pos);
+ struct iomap *iomap = &wpc->iomap;
+ sector_t sector = iomap_sector(iomap, pos);
unsigned len = i_blocksize(inode);
size_t poff = offset_in_folio(folio, pos);
if (!wpc->ioend || !iomap_can_add_to_ioend(wpc, pos, sector)) {
if (wpc->ioend)
list_add(&wpc->ioend->io_list, iolist);
- wpc->ioend = iomap_alloc_ioend(inode, wpc, pos, sector, wbc);
+ wpc->ioend = iomap_alloc_ioend(inode, iomap, pos, sector, wbc);
}
if (!bio_add_folio(wpc->ioend->io_bio, folio, len, poff)) {
--
2.34.1
next prev parent reply other threads:[~2022-05-03 6:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-03 6:39 [RFC PATCH 00/10] Make O_SYNC writethrough Matthew Wilcox (Oracle)
2022-05-03 6:39 ` Matthew Wilcox (Oracle) [this message]
2022-05-03 6:40 ` [RFC PATCH 02/10] iomap: Remove iomap_writepage_ctx from iomap_can_add_to_ioend() Matthew Wilcox (Oracle)
2022-05-03 6:40 ` [RFC PATCH 03/10] iomap: Do not pass iomap_writepage_ctx to iomap_add_to_ioend() Matthew Wilcox (Oracle)
2022-05-03 6:40 ` [RFC PATCH 04/10] iomap: Accept a NULL iomap_writepage_ctx in iomap_submit_ioend() Matthew Wilcox (Oracle)
2022-05-03 6:40 ` [RFC PATCH 05/10] iomap: Allow a NULL writeback_control argument to iomap_alloc_ioend() Matthew Wilcox (Oracle)
2022-05-03 6:40 ` [RFC PATCH 06/10] iomap: Pass a length to iomap_add_to_ioend() Matthew Wilcox (Oracle)
2022-05-03 6:40 ` [RFC PATCH 07/10] iomap: Reorder functions Matthew Wilcox (Oracle)
2022-05-03 6:40 ` [RFC PATCH 08/10] " Matthew Wilcox (Oracle)
2022-05-03 6:40 ` [RFC PATCH 09/10] iomap: Add writethrough for O_SYNC Matthew Wilcox (Oracle)
2022-05-03 6:40 ` [RFC PATCH 10/10] remove write_through bool Matthew Wilcox (Oracle)
2022-05-03 12:57 ` [RFC PATCH 00/10] Make O_SYNC writethrough Damien Le Moal
2022-05-05 4:58 ` Dave Chinner
2022-05-05 5:07 ` Matthew Wilcox
2022-05-05 7:05 ` Dave Chinner
2022-05-06 12:03 ` Damien Le Moal
2022-05-10 1:26 ` Dave Chinner
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=20220503064008.3682332-2-willy@infradead.org \
--to=willy@infradead.org \
--cc=damien.lemoal@opensource.wdc.com \
--cc=djwong@kernel.org \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
/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).