Matthew Wilcox (Oracle) [Sun, 1 May 2022 05:08:08 +0000 (01:08 -0400)]
fs: Change try_to_free_buffers() to take a folio
All but two of the callers already have a folio; pass a folio into
try_to_free_buffers(). This removes the last user of cancel_dirty_page()
so remove that wrapper function too.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 04:52:35 +0000 (00:52 -0400)]
jbd2: Convert release_buffer_page() to use a folio
Saves a few calls to compound_head().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 04:46:03 +0000 (00:46 -0400)]
jbd2: Convert jbd2_journal_try_to_free_buffers to take a folio
Also convert it to return a bool since it's called from release_folio().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 04:35:39 +0000 (00:35 -0400)]
reiserfs: Convert release_buffer_page() to use a folio
Saves 671 bytes from an allmodconfig build (!)
Function old new delta
release_buffer_page 1617 946 -671
Total: Before=67656, After=66985, chg -0.99%
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 04:27:53 +0000 (00:27 -0400)]
fs: Remove last vestiges of releasepage
All users are now converted to release_folio
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 04:10:21 +0000 (00:10 -0400)]
ubifs: Convert to release_folio
Use folios throughout the release_folio path.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 04:10:21 +0000 (00:10 -0400)]
reiserfs: Convert to release_folio
Use folios throughout the release_folio path.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 04:10:21 +0000 (00:10 -0400)]
orangefs: Convert to release_folio
Use folios throughout the release_folio path.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 04:10:21 +0000 (00:10 -0400)]
ocfs2: Convert to release_folio
Use folios throughout the release_folio path.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 04:08:58 +0000 (00:08 -0400)]
nilfs2: Remove comment about releasepage
If we need a release_folio, we can add it back.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 03:53:28 +0000 (23:53 -0400)]
nfs: Convert to release_folio
Use folios throughout the release_folio paths.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 03:53:28 +0000 (23:53 -0400)]
jfs: Convert to release_folio
The use of folios should be pushed further down into jfs from here.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 03:53:28 +0000 (23:53 -0400)]
hfsplus: Convert to release_folio
Use a folio throughout hfsplus_release_folio().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 03:53:28 +0000 (23:53 -0400)]
hfs: Convert to release_folio
Use a folio throughout hfs_release_folio().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 03:49:17 +0000 (23:49 -0400)]
gfs2: Convert to release_folio
Use a folio throughout gfs2_release_folio().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Bob Peterson <rpeterso@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 03:41:46 +0000 (23:41 -0400)]
f2fs: Convert to release_folio
While converting f2fs_release_page() to f2fs_release_folio(), cache the
sb_info so we don't need to retrieve it twice, and remove the redundant
call to set_page_private(). The use of folios should be pushed further
into f2fs from here.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 03:33:38 +0000 (23:33 -0400)]
ext4: Convert to release_folio
The use of folios should be pushed deeper into ext4 from here.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 03:29:26 +0000 (23:29 -0400)]
erofs: Convert to release_folio
Use a folio in erofs_managed_cache_release_folio(), but use of folios
should be pushed into erofs_try_to_free_cached_page().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 03:26:14 +0000 (23:26 -0400)]
cifs: Convert to release_folio
Use a folio throughout cifs_release_folio().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 03:21:43 +0000 (23:21 -0400)]
ceph: Convert to release_folio
Use a folio throughout ceph_release_folio().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 03:15:16 +0000 (23:15 -0400)]
btrfs: Convert to release_folio
I've only converted the outer layers of the btrfs release_folio paths
to use folios; the use of folios should be pushed further down into
btrfs from here.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 03:05:09 +0000 (23:05 -0400)]
afs: Convert to release_folio
A straightforward conversion as they already work in terms of folios.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 03:05:09 +0000 (23:05 -0400)]
9p: Convert to release_folio
A straightforward conversion as it already works in terms of folios.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 03:01:08 +0000 (23:01 -0400)]
iomap: Convert to release_folio
Change all the filesystems which used iomap_releasepage to use the
new function.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 21:00:05 +0000 (17:00 -0400)]
fs: Add aops->release_folio
This replaces aops->releasepage. Update the documentation, and call it
if it exists.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Matthew Wilcox (Oracle) [Sun, 8 May 2022 19:07:11 +0000 (15:07 -0400)]
mm/filemap: Hoist filler_t decision to the top of do_read_cache_folio()
Now that filler_t and aops->read_folio() have the same type, we can decide
which one to use at the top of the function, and cache ->read_folio in
the filler parameter.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Mon, 2 May 2022 01:39:29 +0000 (21:39 -0400)]
fs: Change the type of filler_t
By making filler_t the same as read_folio, we can use the same function
for both in gfs2. We can push the use of folios down one more level
in jffs2 and nfs. We also increase type safety for future users of the
various read_cache_page() family of functions by forcing the parameter
to be a pointer to struct file (or NULL).
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 23:39:03 +0000 (19:39 -0400)]
nfs: Pass the file pointer to nfs_symlink_filler()
In preparation for unifying the read_cache_page() and read_folio()
implementations, make nfs_symlink_filler() get the inode
from the page instead of passing it in from read_cache_page().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Sun, 1 May 2022 23:39:03 +0000 (19:39 -0400)]
jffs2: Pass the file pointer to jffs2_do_readpage_unlock()
In preparation for unifying the read_cache_page() and read_folio()
implementations, make jffs2_do_readpage_unlock() get the inode
from the page instead of passing it in from read_cache_page().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:53:28 +0000 (11:53 -0400)]
mm,fs: Remove aops->readpage
With all implementations of aops->readpage converted to aops->read_folio,
we can stop checking whether it's set and remove the member from aops.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:51:22 +0000 (11:51 -0400)]
mm: Convert swap_readpage to call read_folio instead of readpage
This commit is split out so it can be dropped when resolving
conflicts with Neil Brown's series to stop calling ->readpage in
the swap code.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
vboxsf: Convert vboxsf to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
udf: Convert adinicb and symlinks to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
ubifs: Convert ubifs to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
squashfs: Convert squashfs to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
romfs: Convert romfs to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
orangefs: Convert orangefs to read_folio
This is a full conversion which should be large folio ready, although
I have not tested it.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
ocfs2: Convert ocfs2 to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
ntfs: Convert ntfs to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
nfs: Convert nfs to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
jfs: Convert metadata pages to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
jffs2: Convert jffs2 to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
isofs: Convert symlinks and zisofs to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
hpfs: Convert symlinks to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
hostfs: Convert hostfs to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
fuse: Convert fuse to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
freevxfs: Convert vxfs_immed to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
f2fs: Convert f2fs to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
ext4: Convert ext4 to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
erofs: Convert erofs zdata to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
efs: Convert efs symlinks to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
ecryptfs: Convert ecryptfs to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
cramfs: Convert cramfs to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
coda: Convert coda to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
cifs: Convert cifs to read_folio
This is a "weak" conversion which converts straight back to using pages.
CIFS should probably be converted to use netfs_read_folio() by someone
familiar with it.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
btrfs: Convert btrfs to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
befs: Convert befs to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:17:40 +0000 (11:17 -0400)]
afs: Convert afs_symlink_readpage to afs_symlink_read_folio
This function mostly used folios already, and only a few minor changes
were needed.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)]
affs: Convert affs to read_folio
This is a "weak" conversion which converts straight back to using pages.
A full conversion should be performed at some point, hopefully by
someone familiar with the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:49:41 +0000 (11:49 -0400)]
fs: Convert simple_readpage to simple_read_folio
This is a full folio conversion; it is prepared to handle folios of
arbitrary size.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:47:39 +0000 (11:47 -0400)]
fs: Convert mpage_readpage to mpage_read_folio
mpage_readpage still works in terms of pages, and has not been audited
for correctness with large folios, so include an assertion that the
filesystem is not passing it large folios. Convert all the filesystems
to call mpage_read_folio() instead of mpage_readpage().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 14:40:40 +0000 (10:40 -0400)]
fs: Convert block_read_full_page() to block_read_full_folio()
This function is NOT converted to handle large folios, so include
an assert that the filesystem isn't passing one in. Otherwise, use
the folio functions instead of the page functions, where they exist.
Convert all filesystems which use block_read_full_page().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 12:54:32 +0000 (08:54 -0400)]
fs: Convert iomap_readpage to iomap_read_folio
A straightforward conversion as iomap_readpage already worked in folios.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 12:49:28 +0000 (08:49 -0400)]
fs: Convert netfs_readpage to netfs_read_folio
This is straightforward because netfs already worked in terms of folios.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 12:45:43 +0000 (08:45 -0400)]
fs: Add read_folio documentation
Convert all the ->readpage documentation to ->read_folio.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 12:43:23 +0000 (08:43 -0400)]
fs: Introduce aops->read_folio
Change all the callers of ->readpage to call ->read_folio in preference,
if it exists. This is a transitional duplication, and will be removed
by the end of the series.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 03:59:15 +0000 (23:59 -0400)]
buffer: Rewrite nobh_truncate_page() to use folios
- Calculate iblock directly instead of using a while loop
- Move has_buffers to the end to remove a backwards jump
- Use __filemap_get_folio() instead of grab_cache_page(), which
removes a spurious FGP_ACCESSED flag.
- Eliminate length and pos variables
- Use folio APIs where they exist
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Thu, 18 Mar 2021 02:38:26 +0000 (22:38 -0400)]
mm/readahead: Convert page_cache_async_readahead to take a folio
Removes a couple of calls to compound_head and saves a few bytes.
Also convert verity's read_file_data_page() to be folio-based.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Mon, 17 Jan 2022 19:35:22 +0000 (14:35 -0500)]
fs: Convert is_dirty_writeback() to take a folio
Pass a folio instead of a page to aops->is_dirty_writeback().
Convert both implementations and the caller.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Thu, 31 Mar 2022 18:15:59 +0000 (14:15 -0400)]
readahead: Use a folio in read_pages()
Handle multi-page folios correctly and removes a few calls to
compound_head().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Thu, 28 Apr 2022 18:21:02 +0000 (14:21 -0400)]
filemap: Update the folio_mark_dirty documentation
The previous comment was not terribly helpful. Be a bit more explicit
about the necessary locking environment.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Mon, 4 Apr 2022 17:24:36 +0000 (13:24 -0400)]
filemap: Update the folio_lock documentation
Add kernel-doc for several functions relating to take the folio lock.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Miaohe Lin [Mon, 4 Apr 2022 15:38:20 +0000 (11:38 -0400)]
filemap: Remove obsolete comment in lock_page
We no longer need the page's inode pinned. This comment dates back to
commit
db37648cd6ce ("[PATCH] mm: non syncing lock_page()") which added
lock_page_nosync(). That was removed by commit
7eaceaccab5f ("block:
remove per-queue plugging") which also made this comment obsolete.
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Thu, 3 Mar 2022 20:00:20 +0000 (15:00 -0500)]
fs: Remove pagecache_write_begin() and pagecache_write_end()
These wrappers have no more users; remove them.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Thu, 3 Mar 2022 18:43:29 +0000 (13:43 -0500)]
i915: Call aops write_begin() and write_end() directly
pagecache_write_begin() and pagecache_write_end() are now trivial
wrappers, so call the aops directly.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Thu, 3 Mar 2022 18:43:29 +0000 (13:43 -0500)]
f2fs: Call aops write_begin() and write_end() directly
pagecache_write_begin() and pagecache_write_end() are now trivial
wrappers, so call the aops directly.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Thu, 3 Mar 2022 18:43:29 +0000 (13:43 -0500)]
ext4: Call aops write_begin() and write_end() directly
pagecache_write_begin() and pagecache_write_end() are now trivial
wrappers, so call the aops directly.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Thu, 3 Mar 2022 18:43:29 +0000 (13:43 -0500)]
hfsplus: Call hfsplus_write_begin() and generic_write_end() directly
There is only one kind of write_begin/write_end aops, so we don't need
to look up which aop it is, just make hfsplus_write_begin() available to
this file and call it directly.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Thu, 3 Mar 2022 18:43:29 +0000 (13:43 -0500)]
hfs: Call hfs_write_begin() and generic_write_end() directly
There is only one kind of write_begin/write_end aops, so we don't need
to look up which aop it is, just make hfs_write_begin() available to
this file and call it directly.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Sun, 8 May 2022 18:40:32 +0000 (14:40 -0400)]
ntfs3: Remove fsdata parameter from ntfs_extend_initialized_size()
After the last patch, Smatch reports:
fs/ntfs3/file.c:168 ntfs_extend_initialized_size()
error: uninitialized symbol 'fsdata'.
fsdata is indeed unused. This is not new, but Smatch couldn't see it
before because calls through pagecache_write_begin()/pagecache_write_end()
could theoretically call any implemention of ->write_begin/write_end,
some of which do use fsdata. Now that the calls are direct, Smatch can
see they're never used.
Fix this by simply passing NULL. While ntfs3 does pass this parameter
on to generic functions, those generic functions also never dereference
the fsdata parameter, so it's unnecessary to pass the address of a real
pointer.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) [Thu, 3 Mar 2022 18:43:29 +0000 (13:43 -0500)]
ntfs3: Call ntfs_write_begin() and ntfs_write_end() directly
There is only one kind of write_begin/write_end aops, so we don't need to
look up which aop it is, just make ntfs_write_begin() and ntfs_write_end()
available to this file and call them directly.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Thu, 3 Mar 2022 18:35:20 +0000 (13:35 -0500)]
namei: Call aops write_begin() and write_end() directly
pagecache_write_begin() and pagecache_write_end() are now trivial
wrappers, so call the aops directly.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Thu, 3 Mar 2022 18:35:20 +0000 (13:35 -0500)]
buffer: Call aops write_begin() and write_end() directly
pagecache_write_begin() and pagecache_write_end() are now trivial
wrappers, so call the aops directly.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Tue, 22 Feb 2022 19:31:43 +0000 (14:31 -0500)]
fs: Remove flags parameter from aops->write_begin
There are no more aop flags left, so remove the parameter.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Tue, 22 Feb 2022 16:54:56 +0000 (11:54 -0500)]
fs: Remove aop flags parameter from nobh_write_begin()
There are no more aop flags left, so remove the parameter.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Tue, 22 Feb 2022 16:25:12 +0000 (11:25 -0500)]
fs: Remove aop flags parameter from grab_cache_page_write_begin()
There are no more aop flags left, so remove the parameter.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Tue, 22 Feb 2022 16:25:12 +0000 (11:25 -0500)]
fs: Remove aop flags parameter from cont_write_begin()
There are no more aop flags left, so remove the parameter.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Tue, 22 Feb 2022 16:25:12 +0000 (11:25 -0500)]
fs: Remove aop flags parameter from block_write_begin()
There are no more aop flags left, so remove the parameter.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Tue, 22 Feb 2022 15:47:09 +0000 (10:47 -0500)]
fs: Remove aop_flags parameter from netfs_write_begin()
There are no more aop flags left, so remove the parameter.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Tue, 22 Feb 2022 15:40:11 +0000 (10:40 -0500)]
fs: Remove AOP_FLAG_NOFS
With all users of this flag gone, we can stop testing whether it's set.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Tue, 22 Feb 2022 15:36:28 +0000 (10:36 -0500)]
ext4: Use scoped memory APIs in ext4_write_begin()
Instead of setting AOP_FLAG_NOFS, use memalloc_nofs_save() and
memalloc_nofs_restore() to prevent GFP_FS allocations recursing
into the filesystem with a journal already started.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Theodore Ts'o <tytso@mit.edu>
Matthew Wilcox (Oracle) [Tue, 22 Feb 2022 15:36:28 +0000 (10:36 -0500)]
ext4: Use scoped memory APIs in ext4_da_write_begin()
Instead of setting AOP_FLAG_NOFS, use memalloc_nofs_save() and
memalloc_nofs_restore() to prevent GFP_FS allocations recursing
into the filesystem with a journal already started.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Theodore Ts'o <tytso@mit.edu>
Matthew Wilcox (Oracle) [Tue, 22 Feb 2022 15:15:07 +0000 (10:15 -0500)]
ext4: Use scoped memory API in mext_page_double_lock()
Replace use of AOP_FLAG_NOFS with calls to memalloc_nofs_save()
and memalloc_nofs_restore().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Theodore Ts'o <tytso@mit.edu>
Matthew Wilcox (Oracle) [Tue, 22 Feb 2022 15:10:51 +0000 (10:10 -0500)]
ext4: Allow GFP_FS allocations in ext4_da_convert_inline_data_to_extent()
Since commit
8bc1379b82b8, the transaction is stopped before calling
ext4_da_convert_inline_data_to_extent(), which means we can do GFP_FS
allocations and recurse into the filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Theodore Ts'o <tytso@mit.edu>
Matthew Wilcox (Oracle) [Tue, 22 Feb 2022 14:45:38 +0000 (09:45 -0500)]
f2fs: Convert f2fs_grab_cache_page() to use scoped memory APIs
Prevent GFP_FS allocations by using memalloc_nofs_save() instead
of AOP_FLAG_NOFS.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Tue, 22 Feb 2022 14:43:12 +0000 (09:43 -0500)]
namei: Convert page_symlink() to use memalloc_nofs_save()
Stop using AOP_FLAG_NOFS in favour of the scoped memory API.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Tue, 22 Feb 2022 14:40:54 +0000 (09:40 -0500)]
namei: Merge page_symlink() and __page_symlink()
There are no callers of __page_symlink() left, so we can remove that
entry point.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Matthew Wilcox (Oracle) [Tue, 22 Feb 2022 14:27:42 +0000 (09:27 -0500)]
ext4: Use page_symlink() instead of __page_symlink()
By using the memalloc_nofs_save() functionality, we can call
page_symlink(), safe in the knowledge that it won't recurse into the
filesystem.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Matthew Wilcox (Oracle) [Wed, 9 Feb 2022 17:58:22 +0000 (12:58 -0500)]
scsicam: Fix use of page cache
Convert scsicam to use a folio instead of a page. There is no need to
check the error flag here; read_cache_folio() will return -EIO if the
folio cannot be read correctly.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Linus Torvalds [Sun, 8 May 2022 17:10:51 +0000 (10:10 -0700)]
Merge tag 'sound-5.18-rc6' of git://git./linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
"This became slightly larger as I've been off in the last weeks.
The majority of changes here is about ASoC, fixes for dmaengine
and for addressing issues reported by CI, as well as other
device-specific small fixes.
Also, fixes for FireWire core stack and the usual HD-audio quirks
are included"
* tag 'sound-5.18-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (23 commits)
ASoC: SOF: Fix NULL pointer exception in sof_pci_probe callback
ASoC: ops: Validate input values in snd_soc_put_volsw_range()
ASoC: dmaengine: Restore NULL prepare_slave_config() callback
ASoC: atmel: mchp-pdmc: set prepare_slave_config
ASoC: max98090: Generate notifications on changes for custom control
ASoC: max98090: Reject invalid values in custom control put()
ALSA: fireworks: fix wrong return count shorter than expected by 4 bytes
ALSA: hda/realtek: Add quirk for Yoga Duet 7 13ITL6 speakers
firewire: core: extend card->lock in fw_core_handle_bus_reset
firewire: remove check of list iterator against head past the loop body
firewire: fix potential uaf in outbound_phy_packet_callback()
ASoC: rt9120: Correct the reg 0x09 size to one byte
ALSA: hda/realtek: Enable mute/micmute LEDs support for HP Laptops
ALSA: hda/realtek: Fix mute led issue on thinkpad with cs35l41 s-codec
ASoC: meson: axg-card: Fix nonatomic links
ASoC: meson: axg-tdm-interface: Fix formatters in trigger"
ASoC: soc-ops: fix error handling
ASoC: meson: Fix event generation for G12A tohdmi mux
ASoC: meson: Fix event generation for AUI CODEC mux
ASoC: meson: Fix event generation for AUI ACODEC mux
...