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>
This commit is contained in:
committed by
Steve French
parent
d447e794a3
commit
c191bc070e
+8
-9
@@ -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
|
* 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.
|
* sure that it doesn't change while being written back.
|
||||||
*/
|
*/
|
||||||
static vm_fault_t
|
static vm_fault_t cifs_page_mkwrite(struct vm_fault *vmf)
|
||||||
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
|
/* Wait for the folio to be written to the cache before we allow it to
|
||||||
* be modified. We then assume the entire page will need writing back.
|
* be modified. We then assume the entire folio will need writing back.
|
||||||
*/
|
*/
|
||||||
#ifdef CONFIG_CIFS_FSCACHE
|
#ifdef CONFIG_CIFS_FSCACHE
|
||||||
if (PageFsCache(page) &&
|
if (folio_test_fscache(folio) &&
|
||||||
wait_on_page_fscache_killable(page) < 0)
|
folio_wait_fscache_killable(folio) < 0)
|
||||||
return VM_FAULT_RETRY;
|
return VM_FAULT_RETRY;
|
||||||
#endif
|
#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_RETRY;
|
||||||
return VM_FAULT_LOCKED;
|
return VM_FAULT_LOCKED;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user