2020
2121static int afs_file_mmap (struct file * file , struct vm_area_struct * vma );
2222static int afs_symlink_read_folio (struct file * file , struct folio * folio );
23- static void afs_invalidate_folio (struct folio * folio , size_t offset ,
24- size_t length );
25- static bool afs_release_folio (struct folio * folio , gfp_t gfp_flags );
2623
2724static ssize_t afs_file_read_iter (struct kiocb * iocb , struct iov_iter * iter );
2825static ssize_t afs_file_splice_read (struct file * in , loff_t * ppos ,
@@ -57,8 +54,8 @@ const struct address_space_operations afs_file_aops = {
5754 .readahead = netfs_readahead ,
5855 .dirty_folio = netfs_dirty_folio ,
5956 .launder_folio = afs_launder_folio ,
60- .release_folio = afs_release_folio ,
61- .invalidate_folio = afs_invalidate_folio ,
57+ .release_folio = netfs_release_folio ,
58+ .invalidate_folio = netfs_invalidate_folio ,
6259 .write_begin = afs_write_begin ,
6360 .write_end = afs_write_end ,
6461 .writepages = afs_writepages ,
@@ -67,8 +64,8 @@ const struct address_space_operations afs_file_aops = {
6764
6865const struct address_space_operations afs_symlink_aops = {
6966 .read_folio = afs_symlink_read_folio ,
70- .release_folio = afs_release_folio ,
71- .invalidate_folio = afs_invalidate_folio ,
67+ .release_folio = netfs_release_folio ,
68+ .invalidate_folio = netfs_invalidate_folio ,
7269 .migrate_folio = filemap_migrate_folio ,
7370};
7471
@@ -386,48 +383,6 @@ const struct netfs_request_ops afs_req_ops = {
386383 .issue_read = afs_issue_read ,
387384};
388385
389- /*
390- * invalidate part or all of a page
391- * - release a page and clean up its private data if offset is 0 (indicating
392- * the entire page)
393- */
394- static void afs_invalidate_folio (struct folio * folio , size_t offset ,
395- size_t length )
396- {
397- _enter ("{%lu},%zu,%zu" , folio -> index , offset , length );
398-
399- folio_wait_fscache (folio );
400- _leave ("" );
401- }
402-
403- /*
404- * release a page and clean up its private state if it's not busy
405- * - return true if the page can now be released, false if not
406- */
407- static bool afs_release_folio (struct folio * folio , gfp_t gfp )
408- {
409- struct afs_vnode * vnode = AFS_FS_I (folio_inode (folio ));
410-
411- _enter ("{{%llx:%llu}[%lu],%lx},%x" ,
412- vnode -> fid .vid , vnode -> fid .vnode , folio_index (folio ), folio -> flags ,
413- gfp );
414-
415- /* deny if folio is being written to the cache and the caller hasn't
416- * elected to wait */
417- #ifdef CONFIG_AFS_FSCACHE
418- if (folio_test_fscache (folio )) {
419- if (current_is_kswapd () || !(gfp & __GFP_FS ))
420- return false;
421- folio_wait_fscache (folio );
422- }
423- fscache_note_page_release (afs_vnode_cache (vnode ));
424- #endif
425-
426- /* Indicate that the folio can be released */
427- _leave (" = T" );
428- return true;
429- }
430-
431386static void afs_add_open_mmap (struct afs_vnode * vnode )
432387{
433388 if (atomic_inc_return (& vnode -> cb_nr_mmap ) == 1 ) {
0 commit comments