Skip to content

Commit cda4351

Browse files
committed
Merge tag 'folio-5.18d' of git://git.infradead.org/users/willy/pagecache
Pull more filesystem folio updates from Matthew Wilcox: "A mixture of odd changes that didn't quite make it into the original pull and fixes for things that did. Also the readpages changes had to wait for the NFS tree to be pulled first. - Remove ->readpages infrastructure - Remove AOP_FLAG_CONT_EXPAND - Move read_descriptor_t to networking code - Pass the iocb to generic_perform_write - Minor updates to iomap, btrfs, ext4, f2fs, ntfs" * tag 'folio-5.18d' of git://git.infradead.org/users/willy/pagecache: btrfs: Remove a use of PAGE_SIZE in btrfs_invalidate_folio() ntfs: Correct mark_ntfs_record_dirty() folio conversion f2fs: Get the superblock from the mapping instead of the page f2fs: Correct f2fs_dirty_data_folio() conversion ext4: Correct ext4_journalled_dirty_folio() conversion filemap: Remove AOP_FLAG_CONT_EXPAND fs: Pass an iocb to generic_perform_write() fs, net: Move read_descriptor_t to net.h fs: Remove read_actor_t iomap: Simplify is_partially_uptodate a little readahead: Update comments mm: remove the skip_page argument to read_pages mm: remove the pages argument to read_pages fs: Remove ->readpages address space operation readahead: Remove read_cache_pages()
2 parents 5a3fe95 + 5a60542 commit cda4351

28 files changed

Lines changed: 113 additions & 236 deletions

File tree

Documentation/filesystems/fsverity.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ Pagecache
549549
~~~~~~~~~
550550

551551
For filesystems using Linux's pagecache, the ``->readpage()`` and
552-
``->readpages()`` methods must be modified to verify pages before they
552+
``->readahead()`` methods must be modified to verify pages before they
553553
are marked Uptodate. Merely hooking ``->read_iter()`` would be
554554
insufficient, since ``->read_iter()`` is not used for memory maps.
555555

@@ -611,7 +611,7 @@ workqueue, and then the workqueue work does the decryption or
611611
verification. Finally, pages where no decryption or verity error
612612
occurred are marked Uptodate, and the pages are unlocked.
613613

614-
Files on ext4 and f2fs may contain holes. Normally, ``->readpages()``
614+
Files on ext4 and f2fs may contain holes. Normally, ``->readahead()``
615615
simply zeroes holes and sets the corresponding pages Uptodate; no bios
616616
are issued. To prevent this case from bypassing fs-verity, these
617617
filesystems use fsverity_verify_page() to verify hole pages.
@@ -778,7 +778,7 @@ weren't already directly answered in other parts of this document.
778778
- To prevent bypassing verification, pages must not be marked
779779
Uptodate until they've been verified. Currently, each
780780
filesystem is responsible for marking pages Uptodate via
781-
``->readpages()``. Therefore, currently it's not possible for
781+
``->readahead()``. Therefore, currently it's not possible for
782782
the VFS to do the verification on its own. Changing this would
783783
require significant changes to the VFS and all filesystems.
784784

Documentation/filesystems/locking.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,6 @@ prototypes::
241241
int (*writepages)(struct address_space *, struct writeback_control *);
242242
bool (*dirty_folio)(struct address_space *, struct folio *folio);
243243
void (*readahead)(struct readahead_control *);
244-
int (*readpages)(struct file *filp, struct address_space *mapping,
245-
struct list_head *pages, unsigned nr_pages);
246244
int (*write_begin)(struct file *, struct address_space *mapping,
247245
loff_t pos, unsigned len, unsigned flags,
248246
struct page **pagep, void **fsdata);
@@ -274,7 +272,6 @@ readpage: yes, unlocks shared
274272
writepages:
275273
dirty_folio maybe
276274
readahead: yes, unlocks shared
277-
readpages: no shared
278275
write_begin: locks the page exclusive
279276
write_end: yes, unlocks exclusive
280277
bmap:
@@ -300,9 +297,6 @@ completion.
300297

301298
->readahead() unlocks the pages that I/O is attempted on like ->readpage().
302299

303-
->readpages() populates the pagecache with the passed pages and starts
304-
I/O against them. They come unlocked upon I/O completion.
305-
306300
->writepage() is used for two purposes: for "memory cleansing" and for
307301
"sync". These are quite different operations and the behaviour may differ
308302
depending upon the mode.

Documentation/filesystems/vfs.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,6 @@ cache in your filesystem. The following members are defined:
726726
int (*writepages)(struct address_space *, struct writeback_control *);
727727
bool (*dirty_folio)(struct address_space *, struct folio *);
728728
void (*readahead)(struct readahead_control *);
729-
int (*readpages)(struct file *filp, struct address_space *mapping,
730-
struct list_head *pages, unsigned nr_pages);
731729
int (*write_begin)(struct file *, struct address_space *mapping,
732730
loff_t pos, unsigned len, unsigned flags,
733731
struct page **pagep, void **fsdata);
@@ -817,15 +815,6 @@ cache in your filesystem. The following members are defined:
817815
completes successfully. Setting PageError on any page will be
818816
ignored; simply unlock the page if an I/O error occurs.
819817

820-
``readpages``
821-
called by the VM to read pages associated with the address_space
822-
object. This is essentially just a vector version of readpage.
823-
Instead of just one page, several pages are requested.
824-
readpages is only used for read-ahead, so read errors are
825-
ignored. If anything goes wrong, feel free to give up.
826-
This interface is deprecated and will be removed by the end of
827-
2020; implement readahead instead.
828-
829818
``write_begin``
830819
Called by the generic buffered write code to ask the filesystem
831820
to prepare to write len bytes at the given offset in the file.

fs/btrfs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8296,7 +8296,7 @@ static void btrfs_invalidate_folio(struct folio *folio, size_t offset,
82968296
* cover the full folio, like invalidating the last folio, we're
82978297
* still safe to wait for ordered extent to finish.
82988298
*/
8299-
if (!(offset == 0 && length == PAGE_SIZE)) {
8299+
if (!(offset == 0 && length == folio_size(folio))) {
83008300
btrfs_releasepage(&folio->page, GFP_NOFS);
83018301
return;
83028302
}

fs/btrfs/reflink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ static int btrfs_extent_same_range(struct inode *src, u64 loff, u64 len,
645645
int ret;
646646

647647
/*
648-
* Lock destination range to serialize with concurrent readpages() and
648+
* Lock destination range to serialize with concurrent readahead() and
649649
* source range to serialize with relocation.
650650
*/
651651
btrfs_double_extent_lock(src, loff, dst, dst_loff, len);
@@ -739,7 +739,7 @@ static noinline int btrfs_clone_files(struct file *file, struct file *file_src,
739739
}
740740

741741
/*
742-
* Lock destination range to serialize with concurrent readpages() and
742+
* Lock destination range to serialize with concurrent readahead() and
743743
* source range to serialize with relocation.
744744
*/
745745
btrfs_double_extent_lock(src, off, inode, destoff, len);

fs/buffer.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,8 +2352,7 @@ int generic_cont_expand_simple(struct inode *inode, loff_t size)
23522352
if (err)
23532353
goto out;
23542354

2355-
err = pagecache_write_begin(NULL, mapping, size, 0,
2356-
AOP_FLAG_CONT_EXPAND, &page, &fsdata);
2355+
err = pagecache_write_begin(NULL, mapping, size, 0, 0, &page, &fsdata);
23572356
if (err)
23582357
goto out;
23592358

fs/ceph/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1869,7 +1869,7 @@ static ssize_t ceph_write_iter(struct kiocb *iocb, struct iov_iter *from)
18691869
* are pending vmtruncate. So write and vmtruncate
18701870
* can not run at the same time
18711871
*/
1872-
written = generic_perform_write(file, from, pos);
1872+
written = generic_perform_write(iocb, from);
18731873
if (likely(written >= 0))
18741874
iocb->ki_pos = pos + written;
18751875
ceph_end_io_write(inode);

fs/cifs/cifssmb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ CIFSSMBNegotiate(const unsigned int xid,
597597
set_credits(server, server->maxReq);
598598
/* probably no need to store and check maxvcs */
599599
server->maxBuf = le32_to_cpu(pSMBr->MaxBufferSize);
600-
/* set up max_read for readpages check */
600+
/* set up max_read for readahead check */
601601
server->max_read = server->maxBuf;
602602
server->max_rw = le32_to_cpu(pSMBr->MaxRawSize);
603603
cifs_dbg(NOISY, "Max buf = %d\n", ses->server->maxBuf);

fs/cifs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static void cifs_set_ops(struct inode *inode)
4949
inode->i_fop = &cifs_file_ops;
5050
}
5151

52-
/* check if server can support readpages */
52+
/* check if server can support readahead */
5353
if (cifs_sb_master_tcon(cifs_sb)->ses->server->max_read <
5454
PAGE_SIZE + MAX_CIFS_HDR_SIZE)
5555
inode->i_data.a_ops = &cifs_addr_ops_smallbuf;

fs/crypto/crypto.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ EXPORT_SYMBOL(fscrypt_encrypt_block_inplace);
248248
* which must still be locked and not uptodate. Normally, blocksize ==
249249
* PAGE_SIZE and the whole page is decrypted at once.
250250
*
251-
* This is for use by the filesystem's ->readpages() method.
251+
* This is for use by the filesystem's ->readahead() method.
252252
*
253253
* Return: 0 on success; -errno on failure
254254
*/

0 commit comments

Comments
 (0)