> direct_write_fallback(): on error revert the ->ki_pos update from buffered
> write
Al, Christian: can you send this fix on top Linus?
-= buffered_written.
>
> Or am I completely misparsing what you've written?
No, I misread the patch. Looks good:
Acked-by: Christoph Hellwig
On Sun, Aug 27, 2023 at 08:41:22PM +0100, Al Viro wrote:
> That part is somewhat fishy - there's a case where you return a positive value
> and advance ->ki_pos by more than that amount. I really wonder if all callers
> of ->write_iter() are OK with that. Consider e.g. this:
This should not exis
On Sun, Aug 27, 2023 at 10:45:18PM +0100, Al Viro wrote:
> IOW, I suspect that the right thing to do would be something along the lines
> of
The idea looks sensible to me, but we'll also need to do it for the
filemap_write_and_wait_range failure case.
On Thu, Jul 20, 2023 at 09:51:30AM -0500, Bob Peterson wrote:
> Gfs2 still uses buffer_heads to manage the metadata being pushed through
> its journals. We've been reducing our dependency on them but eliminating
> them altogether is a large and daunting task. We can still work toward that
> goal
On Wed, May 24, 2023 at 02:33:13PM +0100, Matthew Wilcox wrote:
> As you can see, do_page_cache_ra() does limit readahead to i_size.
> Is ractl->mapping->host the correct way to find the inode? I always
> get confused.
As far as I can tell it is the right inode, the indirection through
file->f_ma
On Fri, May 19, 2023 at 04:22:01PM +0200, Hannes Reinecke wrote:
> I'm hitting this during booting:
> [5.016324]
> [5.030256] iomap_iter+0x11a/0x350
> [5.030264] iomap_readahead+0x1eb/0x2c0
> [5.030272] read_pages+0x5d/0x220
> [5.030279] page_cache_ra_unbounded+0x131/0x180
On Thu, Jul 13, 2023 at 05:34:55PM +0200, Cyril Hrubis wrote:
> iter.processed = iomap_write_iter(&iter, i);
>
> + iocb->ki_pos += iter.pos - iocb->ki_pos;
> +
> if (unlikely(ret < 0))
> return ret;
> - ret = iter.pos - iocb->ki_pos;
> - io
pen_common for regular files that do not use data journalling.
Signed-off-by: Christoph Hellwig
---
fs/gfs2/aops.c | 1 -
fs/gfs2/file.c | 3 +++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index a5f4be6b9213ed..d95125714ebb38 100644
--- a/fs/gfs2/ao
On Mon, Jun 05, 2023 at 05:04:14PM -0700, Darrick J. Wong wrote:
> On Thu, Jun 01, 2023 at 04:59:01PM +0200, Christoph Hellwig wrote:
> > Add a helper dealing with handling the syncing of a buffered write fallback
> > for direct I/O.
> >
> > Signed-off-by: Christo
Use the generic direct_write_fallback helper instead of duplicating the
logic.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
---
fs/fuse/file.c | 24 ++--
1 file changed, 2 insertions(+), 22 deletions(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index
The last user of current->backing_dev_info disappeared in commit
b9b1335e6403 ("remove bdi_congested() and wb_congested() and related
functions"). Remove the field and all assignments to it.
Signed-off-by: Christoph Hellwig
Reviewed-by: Christian Brauner
Reviewed-by: Damien Le M
Add a helper dealing with handling the syncing of a buffered write fallback
for direct I/O.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Miklos Szeredi
---
fs/libfs.c | 41
include/linux/fs.h | 2 ++
mm/filemap.c | 66
Both callers of fuse_perform_write need to updated ki_pos, move it into
common code.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
---
fs/fuse/file.c | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index
All callers of iomap_file_buffered_write need to updated ki_pos, move it
into common code.
Signed-off-by: Christoph Hellwig
Reviewed-by: Andreas Gruenbacher
Reviewed-by: Hannes Reinecke
Reviewed-by: Darrick J. Wong
Acked-by: Damien Le Moal
---
fs/gfs2/file.c | 4 +---
fs/iomap
Factor out a helper that calls filemap_write_and_wait_range and
invalidate_inode_pages2_range for 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
Reviewed-by: Damien Le Moal
Add a helper to invalidate page cache after a dio write.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Acked-by: Darrick J. Wong
---
fs/direct-io.c | 10 ++
fs/iomap/direct-io.c| 12 ++--
include/linux/fs.h | 5
Factor out a helper that does filemap_write_and_wait_range for 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
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Acked-by: Darrick J
pos is always equal to iocb->ki_pos, and mapping is always equal to
iocb->ki_filp->f_mapping.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Acked-by: Miklos Szeredi
---
fs/fuse/file.c | 11 +--
1 file changed, 5 insertions(+), 6
Hi all,
this series cleans up some of the generic write helper calling
conventions and the page cache writeback / invalidation for
direct I/O. This is a spinoff from the no-bufferhead kernel
project, for which we'll want to an use iomap based buffered
write path in the block layer.
Changes since
All callers of generic_perform_write need to updated ki_pos, move it into
common code.
Signed-off-by: Christoph Hellwig
Reviewed-by: Xiubo Li
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Acked-by: Theodore Ts'o
Acked-by: Darrick J. Wong
---
fs/ceph/file.c | 2 --
fs/ext4/f
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
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Reviewed-by: Darrick J
Move the ki_pos update down a bit to prepare for a better common
helper that invalidates pages based of an iocb.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Reviewed-by: Darrick J. Wong
---
fs/iomap/direct-io.c | 21 +++--
1 file
On Wed, May 31, 2023 at 11:11:13AM +0200, Miklos Szeredi wrote:
> Why remove generic_write_sync()? Definitely doesn't belong in this
> patch even if there's a good reason.
Yes, this shouldn't have happened. I think this was a bad merge
resolution after the current->backing_dev removal.
On Thu, Jun 01, 2023 at 08:36:59AM +1000, Dave Chinner wrote:
> We lose adjacent page merging with this change.
This is only used for adding the first folio to a brand new bio,
so there is nothing to merge with yet at this point.
Looks good:
Reviewed-by: Christoph Hellwig
Looks good:
Reviewed-by: Christoph Hellwig
Looks good:
Reviewed-by: Christoph Hellwig
All callers of generic_perform_write need to updated ki_pos, move it into
common code.
Signed-off-by: Christoph Hellwig
Reviewed-by: Xiubo Li
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Acked-by: Darrick J. Wong
---
fs/ceph/file.c | 2 --
fs/ext4/file.c | 9 +++--
fs/f2fs
The last user of current->backing_dev_info disappeared in commit
b9b1335e6403 ("remove bdi_congested() and wb_congested() and related
functions"). Remove the field and all assignments to it.
Signed-off-by: Christoph Hellwig
Reviewed-by: Hannes Reinecke
Reviewed-by: Darrick J.
Hi all,
this series cleans up some of the generic write helper calling
conventions and the page cache writeback / invalidation for
direct I/O. This is a spinoff from the no-bufferhead kernel
project, for which we'll want to an use iomap based buffered
write path in the block layer.
Changes since
Move the ki_pos update down a bit to prepare for a better common
helper that invalidates pages based of an iocb.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Reviewed-by: Darrick J. Wong
---
fs/iomap/direct-io.c | 21 +++--
1 file
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
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Reviewed-by: Darrick J
Add a helper to invalidate page cache after a dio write.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Acked-by: Darrick J. Wong
---
fs/direct-io.c | 10 ++
fs/iomap/direct-io.c| 12 ++--
include/linux/fs.h | 5
Add a helper to invalidate page cache after a dio write.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Acked-by: Darrick J. Wong
---
fs/direct-io.c | 10 ++
fs/iomap/direct-io.c| 12 ++--
include/linux/fs.h | 5
Factor out a helper that does filemap_write_and_wait_range for 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
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Acked-by: Darrick J
Factor out a helper that calls filemap_write_and_wait_range and
invalidate_inode_pages2_range for 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
Reviewed-by: Damien Le Moal
Use the generic direct_write_fallback helper instead of duplicating the
logic.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
---
fs/fuse/file.c | 24 ++--
1 file changed, 2 insertions(+), 22 deletions(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index
The last user of current->backing_dev_info disappeared in commit
b9b1335e6403 ("remove bdi_congested() and wb_congested() and related
functions"). Remove the field and all assignments to it.
Signed-off-by: Christoph Hellwig
Reviewed-by: Hannes Reinecke
Reviewed-by: Darrick J.
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 | 41
include/linux/fs.h | 2 ++
mm/filemap.c | 66 +++---
3 files
Move the ki_pos update down a bit to prepare for a better common
helper that invalidates pages based of an iocb.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Reviewed-by: Darrick J. Wong
---
fs/iomap/direct-io.c | 21 +++--
1 file
Factor out a helper that calls filemap_write_and_wait_range and
invalidate_inode_pages2_range for 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
Reviewed-by: Damien Le Moal
All callers of generic_perform_write need to updated ki_pos, move it into
common code.
Signed-off-by: Christoph Hellwig
Reviewed-by: Xiubo Li
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Acked-by: Darrick J. Wong
---
fs/ceph/file.c | 2 --
fs/ext4/file.c | 9 +++--
fs/f2fs
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
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Reviewed-by: Darrick J
[Sorry for the previous attempt that stopped at patch 8]
Hi all,
this series cleans up some of the generic write helper calling
conventions and the page cache writeback / invalidation for
direct I/O. This is a spinoff from the no-bufferhead kernel
project, for which we'll want to an use iomap ba
All callers of iomap_file_buffered_write need to updated ki_pos, move it
into common code.
Signed-off-by: Christoph Hellwig
Reviewed-by: Andreas Gruenbacher
Reviewed-by: Hannes Reinecke
Reviewed-by: Darrick J. Wong
Acked-by: Damien Le Moal
---
fs/gfs2/file.c | 4 +---
fs/iomap
All callers of iomap_file_buffered_write need to updated ki_pos, move it
into common code.
Signed-off-by: Christoph Hellwig
Reviewed-by: Andreas Gruenbacher
Reviewed-by: Hannes Reinecke
Reviewed-by: Darrick J. Wong
Acked-by: Damien Le Moal
---
fs/gfs2/file.c | 4 +---
fs/iomap
Factor out a helper that does filemap_write_and_wait_range for 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
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Acked-by: Darrick J
Both callers of fuse_perform_write need to updated ki_pos, move it into
common code.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
---
fs/fuse/file.c | 23 ++-
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
pos is always equal to iocb->ki_pos, and mapping is always equal to
iocb->ki_filp->f_mapping.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Acked-by: Miklos Szeredi
---
fs/fuse/file.c | 11 +--
1 file changed, 5 insertions(+), 6
Looks good:
Reviewed-by: Christoph Hellwig
On Tue, May 30, 2023 at 08:49:23AM -0700, Johannes Thumshirn wrote:
> +bool __must_check bio_add_folio(struct bio *, struct folio *, size_t len,
> size_t off);
Please spell out the parameters and avoid the overly long line.
folio to a newly created bio can't fail, use the newly
> introduced __bio_add_folio() function.
Looks good:
Reviewed-by: Christoph Hellwig
On Tue, May 30, 2023 at 08:49:21AM -0700, Johannes Thumshirn wrote:
> Just like for bio_add_pages() add a no-fail variant for bio_add_folio().
Can we call this bio_add_folio_nofail? I really regret the __ prefix for
bio_add_page these days - it wasn't really intended to be used as widely
original
> +int __must_check bio_add_page(struct bio *, struct page *, unsigned len,
> unsigned off);
Please spell out all parameters while you touch this, and also avoid the
overly long line.
To me these look like __bio_add_page candidates, but I guess Song
preferred it this way? It'll add a bit pointless boilerplate code,
but I'm ok with that.
Looks good:
Reviewed-by: Christoph Hellwig
Looks good:
Reviewed-by: Christoph Hellwig
if not bail out.
>
> Reviewed-by: Damien Le Moal
> Signed-off-by: Johannes Thumshirn
Looks good:
Reviewed-by: Christoph Hellwig
Looks good:
Reviewed-by: Christoph Hellwig
Looks good:
Reviewed-by: Christoph Hellwig
Looks good:
Reviewed-by: Christoph Hellwig
Looks good:
Reviewed-by: Christoph Hellwig
Looks good:
Reviewed-by: Christoph Hellwig
Looks good:
Reviewed-by: Christoph Hellwig
Looks good:
Reviewed-by: Christoph Hellwig
Looks good:
Reviewed-by: Christoph Hellwig
On Thu, May 25, 2023 at 04:50:39PM -0400, Kent Overstreet wrote:
> A cache that isn't actually consistent is a _bug_. You're being
> Obsequious. And any time this has come up in previous discussions
> (including at LSF), that was never up for debate, the only question has
> been whether it was even
On Thu, May 25, 2023 at 07:20:46PM -0400, Kent Overstreet wrote:
> > > I'm absolutely not in favour to add workarounds for thes kind of locking
> > > problems to the core kernel. I already feel bad for allowing the
> > > small workaround in iomap for btrfs, as just fixing the locking back
> > > th
On Wed, May 24, 2023 at 09:00:36AM +0200, Miklos Szeredi wrote:
> > +ssize_t direct_write_fallback(struct kiocb *iocb, struct iov_iter *iter,
> > + ssize_t direct_written, ssize_t buffered_written)
> > +{
> > + struct address_space *mapping = iocb->ki_filp->f_mapping;
> > +
On Wed, May 24, 2023 at 09:07:22AM +0200, Miklos Szeredi wrote:
> > - endbyte = pos + written_buffered - 1;
> > + endbyte = iocb->ki_pos + written_buffered - 1;
>
> Wrong endpos.
>
> >
> > - err = filemap_write_and_wait_range(file->f_mapping, pos,
> > +
On Wed, May 24, 2023 at 04:09:02AM -0400, Kent Overstreet wrote:
> > Well, it seems like you are talking about something else than the
> > existing cases in gfs2 and btrfs, that is you want full consistency
> > between direct I/O and buffered I/O. That's something nothing in the
> > kernel has eve
All callers of iomap_file_buffered_write need to updated ki_pos, move it
into common code.
Signed-off-by: Christoph Hellwig
Acked-by: Damien Le Moal
Reviewed-by: Darrick J. Wong
---
fs/gfs2/file.c | 4 +---
fs/iomap/buffered-io.c | 9 ++---
fs/xfs/xfs_file.c | 2 --
fs/zonefs
Move the ki_pos update down a bit to prepare for a better common
helper that invalidates pages based of an iocb.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Reviewed-by: Darrick J. Wong
---
fs/iomap/direct-io.c | 21 +++--
1 file changed, 11 insertions(+), 10
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
Reviewed-by: Damien Le Moal
Reviewed-by: Darrick J. Wong
---
fs/iomap/direct
Factor out a helper that does filemap_write_and_wait_range for 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
Reviewed-by: Damien Le Moal
Acked-by: Darrick J. Wong
---
block/fops.c
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 | 66 +++---
3 files changed
All callers of generic_perform_write need to updated ki_pos, move it into
common code.
Signed-off-by: Christoph Hellwig
Reviewed-by: Xiubo Li
Reviewed-by: Damien Le Moal
Acked-by: Darrick J. Wong
---
fs/ceph/file.c | 2 --
fs/ext4/file.c | 9 +++--
fs/f2fs/file.c | 1 -
fs/nfs/file.c
Add a helper to invalidate page cache after a dio write.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
Acked-by: Darrick J. Wong
---
fs/direct-io.c | 10 ++
fs/iomap/direct-io.c| 12 ++--
include/linux/fs.h | 5 -
include/linux/pagemap.h
pos is always equal to iocb->ki_pos, and mapping is always equal to
iocb->ki_filp->f_mapping.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
---
fs/fuse/file.c | 11 +--
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/fs/fuse/file.c b/fs/fuse/fil
Hi all,
this series cleans up some of the generic write helper calling
conventions and the page cache writeback / invalidation for
direct I/O. This is a spinoff from the no-bufferhead kernel
project, for which we'll want to an use iomap based buffered
write path in the block layer.
Changes since
Both callers of fuse_perform_write need to updated ki_pos, move it into
common code.
Signed-off-by: Christoph Hellwig
Reviewed-by: Damien Le Moal
---
fs/fuse/file.c | 25 +++--
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
The last user of current->backing_dev_info disappeared in commit
b9b1335e6403 ("remove bdi_congested() and wb_congested() and related
functions"). Remove the field and all assignments to it.
Signed-off-by: Christoph Hellwig
---
fs/btrfs/file.c | 6 +-
fs/ceph/file
Factor out a helper that calls filemap_write_and_wait_range and
invalidate_inode_pages2_range for 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
Reviewed-by: Damien Le Moal
On Tue, May 23, 2023 at 12:35:35PM -0400, Kent Overstreet wrote:
> No, this is fundamentally because userspace controls the ordering of
> locking because the buffer passed to dio can point into any address
> space. You can't solve this by changing the locking heirarchy.
>
> If you want to be able
On Tue, May 23, 2023 at 03:34:31PM +0200, Jan Kara wrote:
> I've checked the code and AFAICT it is all indeed handled. BTW, I've now
> remembered that GFS2 has dealt with the same deadlocks - b01b2d72da25
> ("gfs2: Fix mmap + page fault deadlocks for direct I/O") - in a different
> way (by prefault
On Mon, May 22, 2023 at 04:19:38PM +0200, Miklos Szeredi wrote:
> > + ssize_t direct_written, ssize_t buffered_written)
> > +{
> > + struct address_space *mapping = iocb->ki_filp->f_mapping;
> > + loff_t pos = iocb->ki_pos, end;
>
> At this point pos will point after the
On Tue, May 23, 2023 at 04:30:51AM +0100, Matthew Wilcox wrote:
> AFAICT (the code went through some metamorphoses in the intervening
> twenty years), the last use of it ended up in current_may_throttle(),
> and it was removed in March 2022 by Neil Brown in commit b9b1335e6403.
> Since then, there
On Mon, May 22, 2023 at 09:01:05AM +0900, Damien Le Moal wrote:
> > - int ret;
> > + ssize_t ret;
> >
> > if (iocb->ki_flags & IOCB_NOWAIT)
> > iter.flags |= IOMAP_NOWAIT;
> >
> > while ((ret = iomap_iter(&iter, ops)) > 0)
> > iter.processed = iomap_write_ite
On Mon, May 22, 2023 at 08:56:34AM +0900, Damien Le Moal wrote:
> On 5/19/23 18:35, Christoph Hellwig wrote:
> > Add a helper to invalidate page cache after a dio write.
> >
> > Signed-off-by: Christoph Hellwig
>
> Nit: kiocb_invalidate_post_dio_write() may be a
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
All callers of iomap_file_buffered_write need to updated ki_pos, move it
into common code.
Signed-off-by: Christoph Hellwig
---
fs/gfs2/file.c | 4 +---
fs/iomap/buffered-io.c | 9 ++---
fs/xfs/xfs_file.c | 2 --
fs/zonefs/file.c | 4 +---
4 files changed, 8 insertions
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
Hi all,
this series cleans up some of the generic write helper calling
conventions and the page cache writeback / invalidation for
direct I/O. This is a spinoff from the no-bufferhead kernel
project, for while we'll want to an use iomap based buffered
write path in the block layer.
diffstat:
bl
Both callers of fuse_perform_write need to updated ki_pos, move it into
common code.
Signed-off-by: Christoph Hellwig
---
fs/fuse/file.c | 25 +++--
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 89d97f6188e05e
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
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
Move the assignment to current->backing_dev_info from the callers into
iomap_file_buffered_write to reduce boiler plate code and reduce the
scope to just around the page dirtying loop.
Note that zonefs was missing this assignment before.
Signed-off-by: Christoph Hellwig
---
fs/gfs2/fil
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
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
1 - 100 of 1075 matches
Mail list logo