@@ -47,26 +47,27 @@ static bool page_cache_pipe_buf_try_steal(struct pipe_inode_info *pipe,
47
47
struct pipe_buffer * buf )
48
48
{
49
49
struct page * page = buf -> page ;
50
+ struct folio * folio = page_folio (page );
50
51
struct address_space * mapping ;
51
52
52
- lock_page ( page );
53
+ folio_lock ( folio );
53
54
54
- mapping = page_mapping ( page );
55
+ mapping = folio_mapping ( folio );
55
56
if (mapping ) {
56
- WARN_ON (!PageUptodate ( page ));
57
+ WARN_ON (!folio_test_uptodate ( folio ));
57
58
58
59
/*
59
60
* At least for ext2 with nobh option, we need to wait on
60
- * writeback completing on this page , since we'll remove it
61
+ * writeback completing on this folio , since we'll remove it
61
62
* from the pagecache. Otherwise truncate wont wait on the
62
- * page , allowing the disk blocks to be reused by someone else
63
+ * folio , allowing the disk blocks to be reused by someone else
63
64
* before we actually wrote our data to them. fs corruption
64
65
* ensues.
65
66
*/
66
- wait_on_page_writeback ( page );
67
+ folio_wait_writeback ( folio );
67
68
68
- if (page_has_private ( page ) &&
69
- !try_to_release_page ( page , GFP_KERNEL ))
69
+ if (folio_has_private ( folio ) &&
70
+ !filemap_release_folio ( folio , GFP_KERNEL ))
70
71
goto out_unlock ;
71
72
72
73
/*
@@ -80,11 +81,11 @@ static bool page_cache_pipe_buf_try_steal(struct pipe_inode_info *pipe,
80
81
}
81
82
82
83
/*
83
- * Raced with truncate or failed to remove page from current
84
+ * Raced with truncate or failed to remove folio from current
84
85
* address space, unlock and return failure.
85
86
*/
86
87
out_unlock :
87
- unlock_page ( page );
88
+ folio_unlock ( folio );
88
89
return false;
89
90
}
90
91
0 commit comments