Commit cda43512 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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()
parents 5a3fe95d 5a60542c
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.
+1 −1
Original line number Diff line number Diff line
@@ -8296,7 +8296,7 @@ static void btrfs_invalidate_folio(struct folio *folio, size_t offset,
	 * cover the full folio, like invalidating the last folio, we're
	 * still safe to wait for ordered extent to finish.
	 */
	if (!(offset == 0 && length == PAGE_SIZE)) {
	if (!(offset == 0 && length == folio_size(folio))) {
		btrfs_releasepage(&folio->page, GFP_NOFS);
		return;
	}
+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);
Loading