diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2023-02-08 14:56:10 +0000 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2023-02-20 11:48:48 -0600 |
commit | c191bc070eba9cbbd166322cad293dd09c48c78e (patch) | |
tree | fc2920c5228e5dc38186f010d6e94816e58bcc3e /fs/cifs/file.c | |
parent | d447e794a37288ec7a080aa1b044a8d9deebbab7 (diff) | |
download | lwn-c191bc070eba9cbbd166322cad293dd09c48c78e.tar.gz lwn-c191bc070eba9cbbd166322cad293dd09c48c78e.zip |
cifs: Use a folio in cifs_page_mkwrite()
Avoids many calls to compound_head() and removes calls to various
compat functions.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: David Howells <dhowells@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index b8d1cbadb689..7eb476a23701 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -4489,23 +4489,22 @@ cifs_read(struct file *file, char *read_data, size_t read_size, loff_t *offset) * If the page is mmap'ed into a process' page tables, then we need to make * sure that it doesn't change while being written back. */ -static vm_fault_t -cifs_page_mkwrite(struct vm_fault *vmf) +static vm_fault_t cifs_page_mkwrite(struct vm_fault *vmf) { - struct page *page = vmf->page; + struct folio *folio = page_folio(vmf->page); - /* Wait for the page to be written to the cache before we allow it to - * be modified. We then assume the entire page will need writing back. + /* Wait for the folio to be written to the cache before we allow it to + * be modified. We then assume the entire folio will need writing back. */ #ifdef CONFIG_CIFS_FSCACHE - if (PageFsCache(page) && - wait_on_page_fscache_killable(page) < 0) + if (folio_test_fscache(folio) && + folio_wait_fscache_killable(folio) < 0) return VM_FAULT_RETRY; #endif - wait_on_page_writeback(page); + folio_wait_writeback(folio); - if (lock_page_killable(page) < 0) + if (folio_lock_killable(folio) < 0) return VM_FAULT_RETRY; return VM_FAULT_LOCKED; } |