Skip to content

Commit 704528d

Browse files
author
Matthew Wilcox (Oracle)
committed
fs: Remove ->readpages address space operation
All filesystems have now been converted to use ->readahead, so remove the ->readpages operation and fix all the comments that used to refer to it. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Al Viro <viro@zeniv.linux.org.uk> Acked-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent ebf921a commit 704528d

15 files changed

Lines changed: 18 additions & 52 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/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/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
*/

fs/ext4/readpage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static void verity_work(struct work_struct *work)
109109
struct bio *bio = ctx->bio;
110110

111111
/*
112-
* fsverity_verify_bio() may call readpages() again, and although verity
112+
* fsverity_verify_bio() may call readahead() again, and although verity
113113
* will be disabled for that, decryption may still be needed, causing
114114
* another bio_post_read_ctx to be allocated. So to guarantee that
115115
* mempool_alloc() never deadlocks we must free the current ctx first.

fs/f2fs/data.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static void f2fs_verify_bio(struct work_struct *work)
164164
bool may_have_compressed_pages = (ctx->enabled_steps & STEP_DECOMPRESS);
165165

166166
/*
167-
* fsverity_verify_bio() may call readpages() again, and while verity
167+
* fsverity_verify_bio() may call readahead() again, and while verity
168168
* will be disabled for this, decryption and/or decompression may still
169169
* be needed, resulting in another bio_post_read_ctx being allocated.
170170
* So to prevent deadlocks we need to release the current ctx to the
@@ -2392,7 +2392,7 @@ static void f2fs_readahead(struct readahead_control *rac)
23922392
if (!f2fs_is_compress_backend_ready(inode))
23932393
return;
23942394

2395-
/* If the file has inline data, skip readpages */
2395+
/* If the file has inline data, skip readahead */
23962396
if (f2fs_has_inline_data(inode))
23972397
return;
23982398

fs/fuse/fuse_i.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ struct fuse_conn {
627627
/** Connection successful. Only set in INIT */
628628
unsigned conn_init:1;
629629

630-
/** Do readpages asynchronously? Only set in INIT */
630+
/** Do readahead asynchronously? Only set in INIT */
631631
unsigned async_read:1;
632632

633633
/** Return an unique read error after abort. Only set in INIT */

0 commit comments

Comments
 (0)