From: Stefan Roesch <[email protected]>
To: <[email protected]>, <[email protected]>,
<[email protected]>, <[email protected]>
Cc: <[email protected]>
Subject: [PATCH v2 01/13] fs: Add flags parameter to __block_write_begin_int
Date: Fri, 18 Feb 2022 11:57:27 -0800 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
This adds a flags parameter to the __begin_write_begin_int() function.
This allows to pass flags down the stack.
Signed-off-by: Stefan Roesch <[email protected]>
---
fs/buffer.c | 7 ++++---
fs/internal.h | 3 ++-
fs/iomap/buffered-io.c | 4 ++--
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/fs/buffer.c b/fs/buffer.c
index 8e112b6bd371..6e6a69a12eed 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1970,7 +1970,8 @@ iomap_to_bh(struct inode *inode, sector_t block, struct buffer_head *bh,
}
int __block_write_begin_int(struct folio *folio, loff_t pos, unsigned len,
- get_block_t *get_block, const struct iomap *iomap)
+ get_block_t *get_block, const struct iomap *iomap,
+ unsigned int flags)
{
unsigned from = pos & (PAGE_SIZE - 1);
unsigned to = from + len;
@@ -2058,7 +2059,7 @@ int __block_write_begin(struct page *page, loff_t pos, unsigned len,
get_block_t *get_block)
{
return __block_write_begin_int(page_folio(page), pos, len, get_block,
- NULL);
+ NULL, 0);
}
EXPORT_SYMBOL(__block_write_begin);
@@ -2118,7 +2119,7 @@ int block_write_begin(struct address_space *mapping, loff_t pos, unsigned len,
if (!page)
return -ENOMEM;
- status = __block_write_begin(page, pos, len, get_block);
+ status = __block_write_begin_int(page_folio(page), pos, len, get_block, NULL, flags);
if (unlikely(status)) {
unlock_page(page);
put_page(page);
diff --git a/fs/internal.h b/fs/internal.h
index 8590c973c2f4..7432df23f3ce 100644
--- a/fs/internal.h
+++ b/fs/internal.h
@@ -38,7 +38,8 @@ static inline int emergency_thaw_bdev(struct super_block *sb)
* buffer.c
*/
int __block_write_begin_int(struct folio *folio, loff_t pos, unsigned len,
- get_block_t *get_block, const struct iomap *iomap);
+ get_block_t *get_block, const struct iomap *iomap,
+ unsigned int flags);
/*
* char_dev.c
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 6c51a75d0be6..47c519952725 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -646,7 +646,7 @@ static int iomap_write_begin(const struct iomap_iter *iter, loff_t pos,
if (srcmap->type == IOMAP_INLINE)
status = iomap_write_begin_inline(iter, folio);
else if (srcmap->flags & IOMAP_F_BUFFER_HEAD)
- status = __block_write_begin_int(folio, pos, len, NULL, srcmap);
+ status = __block_write_begin_int(folio, pos, len, NULL, srcmap, 0);
else
status = __iomap_write_begin(iter, pos, len, folio);
@@ -979,7 +979,7 @@ static loff_t iomap_folio_mkwrite_iter(struct iomap_iter *iter,
if (iter->iomap.flags & IOMAP_F_BUFFER_HEAD) {
ret = __block_write_begin_int(folio, iter->pos, length, NULL,
- &iter->iomap);
+ &iter->iomap, 0);
if (ret)
return ret;
block_commit_write(&folio->page, 0, length);
--
2.30.2
next prev parent reply other threads:[~2022-02-18 19:58 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-18 19:57 [PATCH v2 00/13] Support sync buffered writes for io-uring Stefan Roesch
2022-02-18 19:57 ` Stefan Roesch [this message]
2022-02-18 19:59 ` [PATCH v2 01/13] fs: Add flags parameter to __block_write_begin_int Matthew Wilcox
2022-02-18 20:08 ` Stefan Roesch
2022-02-18 20:13 ` Matthew Wilcox
2022-02-18 20:14 ` Stefan Roesch
2022-02-18 20:22 ` Matthew Wilcox
2022-02-18 20:25 ` Stefan Roesch
2022-02-18 20:35 ` Matthew Wilcox
2022-02-18 20:39 ` Stefan Roesch
2022-02-18 19:57 ` [PATCH v2 02/13] mm: Introduce do_generic_perform_write Stefan Roesch
2022-02-18 19:57 ` [PATCH v2 03/13] mm: Add support for async buffered writes Stefan Roesch
2022-02-18 19:57 ` [PATCH v2 04/13] fs: split off __alloc_page_buffers function Stefan Roesch
2022-02-18 20:42 ` Matthew Wilcox
2022-02-18 20:50 ` Stefan Roesch
2022-02-19 7:35 ` Christoph Hellwig
2022-02-20 4:23 ` Matthew Wilcox
2022-02-20 4:38 ` Jens Axboe
2022-02-20 4:51 ` Jens Axboe
2022-02-22 8:18 ` Christoph Hellwig
2022-02-22 23:19 ` Jens Axboe
2022-02-18 19:57 ` [PATCH v2 05/13] fs: split off __create_empty_buffers function Stefan Roesch
2022-02-18 19:57 ` [PATCH v2 06/13] fs: Add gfp_t parameter to create_page_buffers() Stefan Roesch
2022-02-21 0:18 ` kernel test robot
2022-02-18 19:57 ` [PATCH v2 07/13] fs: add support for async buffered writes Stefan Roesch
2022-02-18 19:57 ` [PATCH v2 08/13] io_uring: " Stefan Roesch
2022-02-18 19:57 ` [PATCH v2 09/13] io_uring: Add tracepoint for short writes Stefan Roesch
2022-02-18 19:57 ` [PATCH v2 10/13] sched: add new fields to task_struct Stefan Roesch
2022-02-18 19:57 ` [PATCH v2 11/13] mm: support write throttling for async buffered writes Stefan Roesch
2022-02-18 19:57 ` [PATCH v2 12/13] io_uring: " Stefan Roesch
2022-02-18 19:57 ` [PATCH v2 13/13] block: enable async buffered writes for block devices Stefan Roesch
2022-02-20 22:38 ` [PATCH v2 00/13] Support sync buffered writes for io-uring 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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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