@@ -3889,33 +3889,32 @@ ssize_t generic_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
3889
3889
EXPORT_SYMBOL (generic_file_write_iter );
3890
3890
3891
3891
/**
3892
- * try_to_release_page() - release old fs-specific metadata on a page
3892
+ * filemap_release_folio() - Release fs-specific metadata on a folio.
3893
+ * @folio: The folio which the kernel is trying to free.
3894
+ * @gfp: Memory allocation flags (and I/O mode).
3893
3895
*
3894
- * @page: the page which the kernel is trying to free
3895
- * @gfp_mask: memory allocation flags (and I/O mode)
3896
+ * The address_space is trying to release any data attached to a folio
3897
+ * (presumably at folio->private).
3896
3898
*
3897
- * The address_space is to try to release any data against the page
3898
- * (presumably at page->private) .
3899
+ * This will also be called if the private_2 flag is set on a page,
3900
+ * indicating that the folio has other metadata associated with it .
3899
3901
*
3900
- * This may also be called if PG_fscache is set on a page, indicating that the
3901
- * page is known to the local caching routines.
3902
+ * The @gfp argument specifies whether I/O may be performed to release
3903
+ * this page (__GFP_IO), and whether the call may block
3904
+ * (__GFP_RECLAIM & __GFP_FS).
3902
3905
*
3903
- * The @gfp_mask argument specifies whether I/O may be performed to release
3904
- * this page (__GFP_IO), and whether the call may block (__GFP_RECLAIM & __GFP_FS).
3905
- *
3906
- * Return: %1 if the release was successful, otherwise return zero.
3906
+ * Return: %true if the release was successful, otherwise %false.
3907
3907
*/
3908
- int try_to_release_page (struct page * page , gfp_t gfp_mask )
3908
+ bool filemap_release_folio (struct folio * folio , gfp_t gfp )
3909
3909
{
3910
- struct address_space * const mapping = page -> mapping ;
3910
+ struct address_space * const mapping = folio -> mapping ;
3911
3911
3912
- BUG_ON (!PageLocked ( page ));
3913
- if (PageWriteback ( page ))
3914
- return 0 ;
3912
+ BUG_ON (!folio_test_locked ( folio ));
3913
+ if (folio_test_writeback ( folio ))
3914
+ return false ;
3915
3915
3916
3916
if (mapping && mapping -> a_ops -> releasepage )
3917
- return mapping -> a_ops -> releasepage (page , gfp_mask );
3918
- return try_to_free_buffers (page );
3917
+ return mapping -> a_ops -> releasepage (& folio -> page , gfp );
3918
+ return try_to_free_buffers (& folio -> page );
3919
3919
}
3920
-
3921
- EXPORT_SYMBOL (try_to_release_page );
3920
+ EXPORT_SYMBOL (filemap_release_folio );
0 commit comments