Skip to content

Commit d06063c

Browse files
committed
Move FAULT_FLAG_xyz into handle_mm_fault() callers
This allows the callers to now pass down the full set of FAULT_FLAG_xyz flags to handle_mm_fault(). All callers have been (mechanically) converted to the new calling convention, there's almost certainly room for architectures to clean up their code and then add FAULT_FLAG_RETRY when that support is added. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 30c9f3a commit d06063c

25 files changed

Lines changed: 30 additions & 30 deletions

File tree

‎arch/alpha/mm/fault.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
146146
/* If for any reason at all we couldn't handle the fault,
147147
make sure we exit gracefully rather than endlessly redo
148148
the fault. */
149-
fault = handle_mm_fault(mm, vma, address, cause > 0);
149+
fault = handle_mm_fault(mm, vma, address, cause > 0 ? FAULT_FLAG_WRITE : 0);
150150
up_read(&mm->mmap_sem);
151151
if (unlikely(fault & VM_FAULT_ERROR)) {
152152
if (fault & VM_FAULT_OOM)

‎arch/arm/mm/fault.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ __do_page_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
208208
* than endlessly redo the fault.
209209
*/
210210
survive:
211-
fault = handle_mm_fault(mm, vma, addr & PAGE_MASK, fsr & (1 << 11));
211+
fault = handle_mm_fault(mm, vma, addr & PAGE_MASK, (fsr & (1 << 11)) ? FAULT_FLAG_WRITE : 0);
212212
if (unlikely(fault & VM_FAULT_ERROR)) {
213213
if (fault & VM_FAULT_OOM)
214214
goto out_of_memory;

‎arch/avr32/mm/fault.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ asmlinkage void do_page_fault(unsigned long ecr, struct pt_regs *regs)
133133
* fault.
134134
*/
135135
survive:
136-
fault = handle_mm_fault(mm, vma, address, writeaccess);
136+
fault = handle_mm_fault(mm, vma, address, writeaccess ? FAULT_FLAG_WRITE : 0);
137137
if (unlikely(fault & VM_FAULT_ERROR)) {
138138
if (fault & VM_FAULT_OOM)
139139
goto out_of_memory;

‎arch/cris/mm/fault.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ do_page_fault(unsigned long address, struct pt_regs *regs,
163163
* the fault.
164164
*/
165165

166-
fault = handle_mm_fault(mm, vma, address, writeaccess & 1);
166+
fault = handle_mm_fault(mm, vma, address, (writeaccess & 1) ? FAULT_FLAG_WRITE : 0);
167167
if (unlikely(fault & VM_FAULT_ERROR)) {
168168
if (fault & VM_FAULT_OOM)
169169
goto out_of_memory;

‎arch/frv/mm/fault.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ asmlinkage void do_page_fault(int datammu, unsigned long esr0, unsigned long ear
163163
* make sure we exit gracefully rather than endlessly redo
164164
* the fault.
165165
*/
166-
fault = handle_mm_fault(mm, vma, ear0, write);
166+
fault = handle_mm_fault(mm, vma, ear0, write ? FAULT_FLAG_WRITE : 0);
167167
if (unlikely(fault & VM_FAULT_ERROR)) {
168168
if (fault & VM_FAULT_OOM)
169169
goto out_of_memory;

‎arch/ia64/mm/fault.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
154154
* sure we exit gracefully rather than endlessly redo the
155155
* fault.
156156
*/
157-
fault = handle_mm_fault(mm, vma, address, (mask & VM_WRITE) != 0);
157+
fault = handle_mm_fault(mm, vma, address, (mask & VM_WRITE) ? FAULT_FLAG_WRITE : 0);
158158
if (unlikely(fault & VM_FAULT_ERROR)) {
159159
/*
160160
* We ran out of memory, or some other thing happened

‎arch/m32r/mm/fault.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code,
196196
*/
197197
addr = (address & PAGE_MASK);
198198
set_thread_fault_code(error_code);
199-
fault = handle_mm_fault(mm, vma, addr, write);
199+
fault = handle_mm_fault(mm, vma, addr, write ? FAULT_FLAG_WRITE : 0);
200200
if (unlikely(fault & VM_FAULT_ERROR)) {
201201
if (fault & VM_FAULT_OOM)
202202
goto out_of_memory;

‎arch/m68k/mm/fault.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ int do_page_fault(struct pt_regs *regs, unsigned long address,
155155
*/
156156

157157
survive:
158-
fault = handle_mm_fault(mm, vma, address, write);
158+
fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0);
159159
#ifdef DEBUG
160160
printk("handle_mm_fault returns %d\n",fault);
161161
#endif

‎arch/microblaze/mm/fault.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
232232
* the fault.
233233
*/
234234
survive:
235-
fault = handle_mm_fault(mm, vma, address, is_write);
235+
fault = handle_mm_fault(mm, vma, address, is_write ? FAULT_FLAG_WRITE : 0);
236236
if (unlikely(fault & VM_FAULT_ERROR)) {
237237
if (fault & VM_FAULT_OOM)
238238
goto out_of_memory;

‎arch/mips/mm/fault.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long write,
102102
* make sure we exit gracefully rather than endlessly redo
103103
* the fault.
104104
*/
105-
fault = handle_mm_fault(mm, vma, address, write);
105+
fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0);
106106
if (unlikely(fault & VM_FAULT_ERROR)) {
107107
if (fault & VM_FAULT_OOM)
108108
goto out_of_memory;

0 commit comments

Comments
 (0)