diff options
| author | Matthew Wilcox <willy@infradead.org> | 2023-03-24 18:01:09 +0000 | 
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2023-04-06 13:39:51 -0400 | 
| commit | 3edde93e07954a8860d67be4a2165514a083b6e8 (patch) | |
| tree | 52c05df5c3ad44104675cb419208f8daae060de0 /fs/ext4/inline.c | |
| parent | e8d6062c50acbf1aba88ca6adaa1bcda058abeab (diff) | |
ext4: Convert ext4_readpage_inline() to take a folio
Use the folio API in this function, saves a few calls to compound_head().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Link: https://lore.kernel.org/r/20230324180129.1220691-10-willy@infradead.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inline.c')
| -rw-r--r-- | fs/ext4/inline.c | 14 | 
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 1602d74b5eeb..e9bae3002319 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -501,7 +501,7 @@ out:  	return ret;  } -int ext4_readpage_inline(struct inode *inode, struct page *page) +int ext4_readpage_inline(struct inode *inode, struct folio *folio)  {  	int ret = 0; @@ -515,16 +515,16 @@ int ext4_readpage_inline(struct inode *inode, struct page *page)  	 * Current inline data can only exist in the 1st page,  	 * So for all the other pages, just set them uptodate.  	 */ -	if (!page->index) -		ret = ext4_read_inline_page(inode, page); -	else if (!PageUptodate(page)) { -		zero_user_segment(page, 0, PAGE_SIZE); -		SetPageUptodate(page); +	if (!folio->index) +		ret = ext4_read_inline_page(inode, &folio->page); +	else if (!folio_test_uptodate(folio)) { +		folio_zero_segment(folio, 0, folio_size(folio)); +		folio_mark_uptodate(folio);  	}  	up_read(&EXT4_I(inode)->xattr_sem); -	unlock_page(page); +	folio_unlock(folio);  	return ret >= 0 ? 0 : ret;  }  | 
