linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Remove lock_page_killable()
@ 2023-02-08 14:56 Matthew Wilcox (Oracle)
  2023-02-08 14:56 ` [PATCH 1/2] cifs: Use a folio in cifs_page_mkwrite() Matthew Wilcox (Oracle)
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-02-08 14:56 UTC (permalink / raw)
  To: linux-cifs, linux-fsdevel, linux-mm; +Cc: Matthew Wilcox (Oracle)

Remove the last caller of lock_page_killable() and the API.

Matthew Wilcox (Oracle) (2):
  cifs: Use a folio in cifs_page_mkwrite()
  filemap: Remove lock_page_killable()

 fs/cifs/file.c          | 17 ++++++++---------
 include/linux/pagemap.h | 10 ----------
 2 files changed, 8 insertions(+), 19 deletions(-)

-- 
2.35.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] cifs: Use a folio in cifs_page_mkwrite()
  2023-02-08 14:56 [PATCH 0/2] Remove lock_page_killable() Matthew Wilcox (Oracle)
@ 2023-02-08 14:56 ` Matthew Wilcox (Oracle)
  2023-02-08 14:56 ` [PATCH 2/2] filemap: Remove lock_page_killable() Matthew Wilcox (Oracle)
  2023-02-09 19:43 ` [PATCH 0/2] " Steve French
  2 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-02-08 14:56 UTC (permalink / raw)
  To: linux-cifs, linux-fsdevel, linux-mm; +Cc: Matthew Wilcox (Oracle)

Avoids many calls to compound_head() and removes calls to various
compat functions.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/cifs/file.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 5568a5f4bc5a..233ce38ab612 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -4516,23 +4516,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;
 }
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] filemap: Remove lock_page_killable()
  2023-02-08 14:56 [PATCH 0/2] Remove lock_page_killable() Matthew Wilcox (Oracle)
  2023-02-08 14:56 ` [PATCH 1/2] cifs: Use a folio in cifs_page_mkwrite() Matthew Wilcox (Oracle)
@ 2023-02-08 14:56 ` Matthew Wilcox (Oracle)
  2023-02-09 19:43 ` [PATCH 0/2] " Steve French
  2 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-02-08 14:56 UTC (permalink / raw)
  To: linux-cifs, linux-fsdevel, linux-mm; +Cc: Matthew Wilcox (Oracle)

There are no more callers; remove this function before any more appear.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 include/linux/pagemap.h | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index cf0677419981..51b75b89730e 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -993,16 +993,6 @@ static inline int folio_lock_killable(struct folio *folio)
 	return 0;
 }
 
-/*
- * lock_page_killable is like lock_page but can be interrupted by fatal
- * signals.  It returns 0 if it locked the page and -EINTR if it was
- * killed while waiting.
- */
-static inline int lock_page_killable(struct page *page)
-{
-	return folio_lock_killable(page_folio(page));
-}
-
 /*
  * folio_lock_or_retry - Lock the folio, unless this would block and the
  * caller indicated that it can handle a retry.
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] Remove lock_page_killable()
  2023-02-08 14:56 [PATCH 0/2] Remove lock_page_killable() Matthew Wilcox (Oracle)
  2023-02-08 14:56 ` [PATCH 1/2] cifs: Use a folio in cifs_page_mkwrite() Matthew Wilcox (Oracle)
  2023-02-08 14:56 ` [PATCH 2/2] filemap: Remove lock_page_killable() Matthew Wilcox (Oracle)
@ 2023-02-09 19:43 ` Steve French
  2 siblings, 0 replies; 4+ messages in thread
From: Steve French @ 2023-02-09 19:43 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle); +Cc: linux-cifs, linux-fsdevel, linux-mm

merged into cifs-2.6.git for-next pending testing

On Wed, Feb 8, 2023 at 9:11 AM Matthew Wilcox (Oracle)
<willy@infradead.org> wrote:
>
> Remove the last caller of lock_page_killable() and the API.
>
> Matthew Wilcox (Oracle) (2):
>   cifs: Use a folio in cifs_page_mkwrite()
>   filemap: Remove lock_page_killable()
>
>  fs/cifs/file.c          | 17 ++++++++---------
>  include/linux/pagemap.h | 10 ----------
>  2 files changed, 8 insertions(+), 19 deletions(-)
>
> --
> 2.35.1
>


-- 
Thanks,

Steve


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-09 19:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-08 14:56 [PATCH 0/2] Remove lock_page_killable() Matthew Wilcox (Oracle)
2023-02-08 14:56 ` [PATCH 1/2] cifs: Use a folio in cifs_page_mkwrite() Matthew Wilcox (Oracle)
2023-02-08 14:56 ` [PATCH 2/2] filemap: Remove lock_page_killable() Matthew Wilcox (Oracle)
2023-02-09 19:43 ` [PATCH 0/2] " Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).