Skip to content

Commit 1743d38

Browse files
committed
Merge branch 'vfs-6.15.shared.iomap' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs
Bring in iomap changes that xfs relies on. Signed-off-by: Christian Brauner <brauner@kernel.org>
2 parents 53cfafd + 13368df commit 1743d38

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed

Documentation/filesystems/iomap/design.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,11 @@ operations:
356356
``IOMAP_NOWAIT`` is often set on behalf of ``IOCB_NOWAIT`` or
357357
``RWF_NOWAIT``.
358358

359+
* ``IOMAP_DONTCACHE`` is set when the caller wishes to perform a
360+
buffered file I/O and would like the kernel to drop the pagecache
361+
after the I/O completes, if it isn't already being used by another
362+
thread.
363+
359364
If it is necessary to read existing file contents from a `different
360365
<https://lore.kernel.org/all/20191008071527.29304-9-hch@lst.de/>`_
361366
device or address range on a device, the filesystem should return that

Documentation/filesystems/iomap/operations.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ These ``struct kiocb`` flags are significant for buffered I/O with iomap:
131131

132132
* ``IOCB_NOWAIT``: Turns on ``IOMAP_NOWAIT``.
133133

134+
* ``IOCB_DONTCACHE``: Turns on ``IOMAP_DONTCACHE``.
135+
134136
Internal per-Folio State
135137
------------------------
136138

fs/iomap/buffered-io.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,8 @@ struct folio *iomap_get_folio(struct iomap_iter *iter, loff_t pos, size_t len)
594594

595595
if (iter->flags & IOMAP_NOWAIT)
596596
fgp |= FGP_NOWAIT;
597+
if (iter->flags & IOMAP_DONTCACHE)
598+
fgp |= FGP_DONTCACHE;
597599
fgp |= fgf_set_order(len);
598600

599601
return __filemap_get_folio(iter->inode->i_mapping, pos >> PAGE_SHIFT,
@@ -1019,6 +1021,8 @@ iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *i,
10191021

10201022
if (iocb->ki_flags & IOCB_NOWAIT)
10211023
iter.flags |= IOMAP_NOWAIT;
1024+
if (iocb->ki_flags & IOCB_DONTCACHE)
1025+
iter.flags |= IOMAP_DONTCACHE;
10221026

10231027
while ((ret = iomap_iter(&iter, ops)) > 0)
10241028
iter.status = iomap_write_iter(&iter, i);

fs/xfs/xfs_file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1627,7 +1627,8 @@ const struct file_operations xfs_file_operations = {
16271627
.fadvise = xfs_file_fadvise,
16281628
.remap_file_range = xfs_file_remap_range,
16291629
.fop_flags = FOP_MMAP_SYNC | FOP_BUFFER_RASYNC |
1630-
FOP_BUFFER_WASYNC | FOP_DIO_PARALLEL_WRITE,
1630+
FOP_BUFFER_WASYNC | FOP_DIO_PARALLEL_WRITE |
1631+
FOP_DONTCACHE,
16311632
};
16321633

16331634
const struct file_operations xfs_dir_file_operations = {

include/linux/iomap.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ struct iomap_folio_ops {
190190
#define IOMAP_DAX 0
191191
#endif /* CONFIG_FS_DAX */
192192
#define IOMAP_ATOMIC (1 << 9)
193+
#define IOMAP_DONTCACHE (1 << 10)
193194

194195
struct iomap_ops {
195196
/*

0 commit comments

Comments
 (0)