@@ -445,7 +445,7 @@ static unsigned long dev_pagemap_mapping_shift(struct vm_area_struct *vma,
445445 * Schedule a process for later kill.
446446 * Uses GFP_ATOMIC allocations to avoid potential recursions in the VM.
447447 */
448- static void __add_to_kill (struct task_struct * tsk , struct page * p ,
448+ static void __add_to_kill (struct task_struct * tsk , const struct page * p ,
449449 struct vm_area_struct * vma , struct list_head * to_kill ,
450450 unsigned long addr )
451451{
@@ -461,7 +461,7 @@ static void __add_to_kill(struct task_struct *tsk, struct page *p,
461461 if (is_zone_device_page (p ))
462462 tk -> size_shift = dev_pagemap_mapping_shift (vma , tk -> addr );
463463 else
464- tk -> size_shift = page_shift ( compound_head (p ));
464+ tk -> size_shift = folio_shift ( page_folio (p ));
465465
466466 /*
467467 * Send SIGKILL if "tk->addr == -EFAULT". Also, as
@@ -486,7 +486,7 @@ static void __add_to_kill(struct task_struct *tsk, struct page *p,
486486 list_add_tail (& tk -> nd , to_kill );
487487}
488488
489- static void add_to_kill_anon_file (struct task_struct * tsk , struct page * p ,
489+ static void add_to_kill_anon_file (struct task_struct * tsk , const struct page * p ,
490490 struct vm_area_struct * vma , struct list_head * to_kill ,
491491 unsigned long addr )
492492{
@@ -509,7 +509,7 @@ static bool task_in_to_kill_list(struct list_head *to_kill,
509509 return false;
510510}
511511
512- void add_to_kill_ksm (struct task_struct * tsk , struct page * p ,
512+ void add_to_kill_ksm (struct task_struct * tsk , const struct page * p ,
513513 struct vm_area_struct * vma , struct list_head * to_kill ,
514514 unsigned long addr )
515515{
@@ -606,8 +606,9 @@ struct task_struct *task_early_kill(struct task_struct *tsk, int force_early)
606606/*
607607 * Collect processes when the error hit an anonymous page.
608608 */
609- static void collect_procs_anon (struct folio * folio , struct page * page ,
610- struct list_head * to_kill , int force_early )
609+ static void collect_procs_anon (const struct folio * folio ,
610+ const struct page * page , struct list_head * to_kill ,
611+ int force_early )
611612{
612613 struct task_struct * tsk ;
613614 struct anon_vma * av ;
@@ -643,8 +644,9 @@ static void collect_procs_anon(struct folio *folio, struct page *page,
643644/*
644645 * Collect processes when the error hit a file mapped page.
645646 */
646- static void collect_procs_file (struct folio * folio , struct page * page ,
647- struct list_head * to_kill , int force_early )
647+ static void collect_procs_file (const struct folio * folio ,
648+ const struct page * page , struct list_head * to_kill ,
649+ int force_early )
648650{
649651 struct vm_area_struct * vma ;
650652 struct task_struct * tsk ;
@@ -680,7 +682,7 @@ static void collect_procs_file(struct folio *folio, struct page *page,
680682}
681683
682684#ifdef CONFIG_FS_DAX
683- static void add_to_kill_fsdax (struct task_struct * tsk , struct page * p ,
685+ static void add_to_kill_fsdax (struct task_struct * tsk , const struct page * p ,
684686 struct vm_area_struct * vma ,
685687 struct list_head * to_kill , pgoff_t pgoff )
686688{
@@ -691,7 +693,7 @@ static void add_to_kill_fsdax(struct task_struct *tsk, struct page *p,
691693/*
692694 * Collect processes when the error hit a fsdax page.
693695 */
694- static void collect_procs_fsdax (struct page * page ,
696+ static void collect_procs_fsdax (const struct page * page ,
695697 struct address_space * mapping , pgoff_t pgoff ,
696698 struct list_head * to_kill , bool pre_remove )
697699{
@@ -725,7 +727,7 @@ static void collect_procs_fsdax(struct page *page,
725727/*
726728 * Collect the processes who have the corrupted page mapped to kill.
727729 */
728- static void collect_procs (struct folio * folio , struct page * page ,
730+ static void collect_procs (const struct folio * folio , const struct page * page ,
729731 struct list_head * tokill , int force_early )
730732{
731733 if (!folio -> mapping )
0 commit comments