Add a helper dealing with handling the syncing of a buffered write fallback
for direct I/O.
Signed-off-by: Christoph Hellwig
---
fs/libfs.c | 36
include/linux/fs.h | 2 ++
mm/filemap.c | 59 ++
3 files chang
Fold emergency_thaw_bdev into it's only caller, to prepare for buffer.c
to be built only when buffer_head support is enabled.
Signed-off-by: Christoph Hellwig
---
fs/buffer.c | 6 --
fs/internal.h | 6 --
fs/super.c| 4 +++-
3 files changed, 3 insertions(+), 13 deletions(-)
diff -
Use iomap in buffer_head compat mode to write to block devices.
Signed-off-by: Christoph Hellwig
---
block/Kconfig | 1 +
block/fops.c | 33 +
2 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/block/Kconfig b/block/Kconfig
index 941b2dca70db73..672
Factor out a helper that calls filemap_write_and_wait_range and
invalidate_inode_pages2_rangefor a the range covered by a write kiocb or
returns -EAGAIN if the kiocb is marked as nowait and there would be pages
to write or invalidate.
Signed-off-by: Christoph Hellwig
---
include/linux/pagemap.h
Hi all,
after all the talk about removing buffer_heads, here is a series that
shows how to build a kernel without buffer_heads. And how unrealistic
it is to remove the entirely.
Most of the series refactors some common code to make implementing direct
I/O easier without use of the ->direct_IO me
All callers of generic_perform_write need to updated ki_pos, move it into
common code.
Signed-off-by: Christoph Hellwig
---
fs/ceph/file.c | 2 --
fs/ext4/file.c | 9 +++--
fs/f2fs/file.c | 1 -
fs/nfs/file.c | 1 -
mm/filemap.c | 8
5 files changed, 7 insertions(+), 14 deletions
Open code __generic_file_write_iter to remove the indirect call into
->direct_IO and to prepare using the iomap based write code.
Signed-off-by: Christoph Hellwig
---
block/fops.c | 46 --
1 file changed, 44 insertions(+), 2 deletions(-)
diff --git a/
Add a helper to invalidate page cache after a dio write.
Signed-off-by: Christoph Hellwig
---
fs/direct-io.c | 10 ++
fs/iomap/direct-io.c| 12 ++--
include/linux/fs.h | 5 -
include/linux/pagemap.h | 1 +
mm/filemap.c| 37 -
block_page_mkwrite_return is neither block nor mkwrite specific, and
should not be under CONFIG_BLOCK. Move it to mm.h and rename it to
errno_to_vmfault.
Signed-off-by: Christoph Hellwig
---
fs/ext4/inode.c | 2 +-
fs/f2fs/file.c | 2 +-
fs/gfs2/file.c |
Remove the no needed plug in blkdev_write_iter. For direct I/O that
issues more than a single I/O, the plug is already done in
__blkdev_direct_IO, and for synchronous buffered writes, the plug
is done in writeback_inodes_wb / wb_writeback, while for the other
cases a plug doesn't make sense.
Sign
Use the common helpers for direct I/O page invalidation instead of
open coding the logic. This leads to a slight reordering of checks
in __iomap_dio_rw to keep the logic straight.
Signed-off-by: Christoph Hellwig
---
fs/iomap/direct-io.c | 55
1 file
def_blk_fops always returns -ENODEV, which dosn't match the return value
of a non-existing block device with CONFIG_BLOCK, which is -ENXIO.
Just remove the extra implementation and fall back to the default
no_open_fops that always returns -ENXIO.
Signed-off-by: Christoph Hellwig
---
fs/Makefile
Direct I/O on block devices now nevers goes through aops->direct_IO.
Stop setting it and set the FMODE_CAN_ODIRECT in ->open instead.
Signed-off-by: Christoph Hellwig
---
block/fops.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/block/fops.c b/block/fops.c
index fd510b61
Move the assignment to current->backing_dev_info from the callers into
iomap_file_buffered_write. Note that zonefs was missing this assignment
before.
Signed-off-by: Christoph Hellwig
---
fs/gfs2/file.c | 3 ---
fs/iomap/buffered-io.c | 4
fs/xfs/xfs_file.c | 5 -
3 files
buffer_check_dirty_writeback is only used by the block device aops,
remove the export.
Signed-off-by: Christoph Hellwig
---
fs/buffer.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/buffer.c b/fs/buffer.c
index 9e1e2add541e07..eb14fbaa7d35f7 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@
On Sun, Apr 23, 2023 at 11:18:25PM -0700, Darrick J. Wong wrote:
> > @@ -876,8 +877,11 @@ iomap_file_buffered_write(struct kiocb *iocb, struct
> > iov_iter *i,
> > if (iocb->ki_flags & IOCB_NOWAIT)
> > iter.flags |= IOMAP_NOWAIT;
> >
> > + current->backing_dev_info = inode_to_b
Factor out a helper that does filemap_write_and_wait_range for a the
range covered by a read kiocb, or returns -EAGAIN if the kiocb
is marked as nowait and there would be pages to write.
Signed-off-by: Christoph Hellwig
---
block/fops.c| 18 +++---
include/linux/pagemap.h
Refator the fuse direct write code so that the fuse_perform_write
callig convention is simplified to match generic_perform_write and
it's updating ki_pos directly, and the generic direct_write_fallback
helper is used to consolidate buffered I/O fallback code.
Signed-off-by: Christoph Hellwig
---
On Mon, Apr 24, 2023 at 07:49:20AM +0200, Christoph Hellwig wrote:
> Move the assignment to current->backing_dev_info from the callers into
> iomap_file_buffered_write. Note that zonefs was missing this assignment
> before.
>
> Signed-off-by: Christoph Hellwig
> ---
> fs/gfs2/file.c | 3
Add a new config option that controls building the buffer_head code, and
select it from all file systems and stacking drivers that need it.
For the block device nodes and alternative iomap based buffered I/O path
is provided when buffer_head support is not enabled, and iomap needs a
little tweak t
20 matches
Mail list logo