fsverity: remove fsverity_verify_page()
Eric Biggers
maintainerv4 cover fsverity: remove fsverity_verify_page()
This series removes the non-large-folio-aware function fsverity_verify_page(), which is no longer needed.
Changed in v4:
- Split ClearPageUptodate removal into a separate patch
Changed in v3:
- Additional scope creep: verify the entire folio, switch to several more folio functions, and stop clearing PG_uptodate
Changed in v2:
- Made one specific part of f2fs_verify_cluster() large-folio-aware
Eric Biggers (3):
f2fs: remove unnecessary ClearPageUptodate in f2fs_verify_cluster()
f2fs: make f2fs_verify_cluster() partially large-folio-aware
fsverity: remove fsverity_verify_page()
fs/f2fs/compress.c | 11 +++++------ fs/verity/verify.c | 4 ++-- include/linux/fsverity.h | 6 ------ 3 files changed, 7 insertions(+), 14 deletions(-)
base-commit: 64275e9fda3702bfb5ab3b95f7c2b9b414667164
Signature · 1 line
2.53.0
Eric Biggers
maintainerPATCH v4 1/3 f2fs: remove unnecessary ClearPageUptodate in f2fs_verify_cluster()
Remove the unnecessary clearing of PG_uptodate. It's guaranteed to already be clear.
--- fs/f2fs/compress.c | 2 -- 1 file changed, 2 deletions(-)
fs/f2fs/compress.c +0 -2
@@ -1817,12 +1817,10 @@ static void f2fs_verify_cluster(struct work_struct *work)if (!rpage)continue ;if (fsverity_verify_page (dic->vi, rpage))SetPageUptodate (rpage); -else -ClearPageUptodate (rpage);unlock_page (rpage); }f2fs_put_dic (dic, true); }
Signature · 1 line
2.53.0
Re: [PATCH v4 1/3] f2fs: remove unnecessary ClearPageUptodate in f2fs_verify_cluster()
Looks good:
Eric Biggers
maintainerPATCH v4 2/3 f2fs: make f2fs_verify_cluster() partially large-folio-aware
In reply to Eric Biggersf2fs_verify_cluster() is the only remaining caller of the
non-large-folio-aware function fsverity_verify_page(). To unblock the
removal of that function, change f2fs_verify_cluster() to verify the entire folio of each page and mark it up-to-date.
Note that this doesn't actually make f2fs_verify_cluster() large-folio-aware, as it is still passed an array of pages. Currently, it's never called with large folios.
--- fs/f2fs/compress.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
fs/f2fs/compress.c +5 -4
@@ -1811,17 +1811,18 @@ static void f2fs_verify_cluster(struct work_struct *work)int i;/* Verify, update, and unlock the decompressed pages. */ for (i =0 ; i < dic->cluster_size; i++) {struct page *rpage = dic->rpages[i]; +struct folio *rfolio;if (!rpage)continue ; - -if (fsverity_verify_page (dic->vi, rpage)) -SetPageUptodate (rpage); -unlock_page (rpage); + rfolio =page_folio (rpage); +if (fsverity_verify_folio (dic->vi, rfolio)) +folio_mark_uptodate (rfolio); +folio_unlock (rfolio); }f2fs_put_dic (dic, true); }
Signature · 1 line
2.53.0
Re: [PATCH v4 2/3] f2fs: make f2fs_verify_cluster() partially large-folio-aware
Quoted 8 lines · Eric Biggers
f2fs_verify_cluster()is the only remaining caller of the
non-large-folio-aware functionfsverity_verify_page(). To unblock the
removal of that function, changef2fs_verify_cluster()to verify the entire folio of each page and mark it up-to-date.Note that this doesn't actually make
f2fs_verify_cluster()large-folio-aware, as it is still passed an array of pages. Currently, it's never called with large folios.
Looks good:
Eric Biggers
maintainerPATCH v4 3/3 fsverity: remove fsverity_verify_page()
In reply to Eric BiggersNow that fsverity_verify_page() has no callers, remove it.
--- fs/verity/verify.c | 4 ++-- include/linux/fsverity.h | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-)
fs/verity/verify.c +2 -2
@@ -431,12 +431,12 @@ EXPORT_SYMBOL_GPL(fsverity_verify_blocks);* verification, then bio->bi_status is set to an error status. * * This is a helper function for use by the ->readahead() method of filesystems * that issue bios to read data directly into the page cache. Filesystems that * populate the page cache without issuing bios (e.g. non block-based -* filesystems) must instead call fsverity_verify_page() directly on each page. -* All filesystems must also call fsverity_verify_page() on holes. +* filesystems) must instead call fsverity_verify_blocks() directly. All +* filesystems must also call fsverity_verify_blocks() on holes. */ void fsverity_verify_bio (struct fsverity_info *vi,struct bio *bio) {struct fsverity_verification_context ctx;struct folio_iter fi;
include/linux/fsverity.h +0 -6
@@ -280,16 +280,10 @@ static inline bool fsverity_verify_folio(struct fsverity_info *vi, struct folio *folio) {return fsverity_verify_blocks (vi, folio,folio_size (folio),0 ); } -static inline bool fsverity_verify_page (struct fsverity_info *vi, -struct page *page) -{ -return fsverity_verify_blocks (vi,page_folio (page),PAGE_SIZE ,0 ); -} -/** * fsverity_file_open() - prepare to open a verity file * @inode: the inode being opened * @filp: the struct file being set up *
Signature · 1 line
2.53.0
Quoted 18 lines · Eric Biggers
This series removes the non-large-folio-aware function
fsverity_verify_page(), which is no longer needed.Changed in v4:
- Split ClearPageUptodate removal into a separate patchChanged in v3:
- Additional scope creep: verify the entire folio, switch to several more folio functions, and stop clearingPG_uptodateChanged in v2:
- Made one specific part off2fs_verify_cluster()large-folio-awareEric Biggers (3):
f2fs: remove unnecessary ClearPageUptodate inf2fs_verify_cluster()
f2fs: makef2fs_verify_cluster()partially large-folio-aware
fsverity: removefsverity_verify_page()
Quoted 4 lines
fs/f2fs/compress.c | 11 +++++------ fs/verity/verify.c | 4 ++-- include/linux/fsverity.h | 6 ------ 3 files changed, 7 insertions(+), 14 deletions(-)
Applied to https://git.kernel.org/pub/scm/fs/fsverity/linux.git/log/?h=for-next
- Eric