Commit 704528d8 authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle)
Browse files

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: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent ebf921a9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -549,7 +549,7 @@ Pagecache
~~~~~~~~~

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

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

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

+0 −6
Original line number Diff line number Diff line
@@ -241,8 +241,6 @@ prototypes::
	int (*writepages)(struct address_space *, struct writeback_control *);
	bool (*dirty_folio)(struct address_space *, struct folio *folio);
	void (*readahead)(struct readahead_control *);
	int (*readpages)(struct file *filp, struct address_space *mapping,
			struct list_head *pages, unsigned nr_pages);
	int (*write_begin)(struct file *, struct address_space *mapping,
				loff_t pos, unsigned len, unsigned flags,
				struct page **pagep, void **fsdata);
@@ -274,7 +272,6 @@ readpage: yes, unlocks shared
writepages:
dirty_folio		maybe
readahead:		yes, unlocks				shared
readpages:		no					shared
write_begin:		locks the page		 exclusive
write_end:		yes, unlocks		 exclusive
bmap:
@@ -300,9 +297,6 @@ completion.

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

->readpages() populates the pagecache with the passed pages and starts
I/O against them.  They come unlocked upon I/O completion.

->writepage() is used for two purposes: for "memory cleansing" and for
"sync".  These are quite different operations and the behaviour may differ
depending upon the mode.
+0 −11
Original line number Diff line number Diff line
@@ -726,8 +726,6 @@ cache in your filesystem. The following members are defined:
		int (*writepages)(struct address_space *, struct writeback_control *);
		bool (*dirty_folio)(struct address_space *, struct folio *);
		void (*readahead)(struct readahead_control *);
		int (*readpages)(struct file *filp, struct address_space *mapping,
				 struct list_head *pages, unsigned nr_pages);
		int (*write_begin)(struct file *, struct address_space *mapping,
				   loff_t pos, unsigned len, unsigned flags,
				struct page **pagep, void **fsdata);
@@ -817,15 +815,6 @@ cache in your filesystem. The following members are defined:
	completes successfully.  Setting PageError on any page will be
	ignored; simply unlock the page if an I/O error occurs.

``readpages``
	called by the VM to read pages associated with the address_space
	object.  This is essentially just a vector version of readpage.
	Instead of just one page, several pages are requested.
	readpages is only used for read-ahead, so read errors are
	ignored.  If anything goes wrong, feel free to give up.
	This interface is deprecated and will be removed by the end of
	2020; implement readahead instead.

``write_begin``
	Called by the generic buffered write code to ask the filesystem
	to prepare to write len bytes at the given offset in the file.
+2 −2
Original line number Diff line number Diff line
@@ -645,7 +645,7 @@ static int btrfs_extent_same_range(struct inode *src, u64 loff, u64 len,
	int ret;

	/*
	 * Lock destination range to serialize with concurrent readpages() and
	 * Lock destination range to serialize with concurrent readahead() and
	 * source range to serialize with relocation.
	 */
	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,
	}

	/*
	 * Lock destination range to serialize with concurrent readpages() and
	 * Lock destination range to serialize with concurrent readahead() and
	 * source range to serialize with relocation.
	 */
	btrfs_double_extent_lock(src, off, inode, destoff, len);
+1 −1
Original line number Diff line number Diff line
@@ -597,7 +597,7 @@ CIFSSMBNegotiate(const unsigned int xid,
	set_credits(server, server->maxReq);
	/* probably no need to store and check maxvcs */
	server->maxBuf = le32_to_cpu(pSMBr->MaxBufferSize);
	/* set up max_read for readpages check */
	/* set up max_read for readahead check */
	server->max_read = server->maxBuf;
	server->max_rw = le32_to_cpu(pSMBr->MaxRawSize);
	cifs_dbg(NOISY, "Max buf = %d\n", ses->server->maxBuf);
Loading