Skip to content

Commit 2bcd645

Browse files
Souptick Joardertorvalds
authored andcommitted
mm: use new return type vm_fault_t
Use new return type vm_fault_t for fault handler in struct vm_operations_struct. For now, this is just documenting that the function returns a VM_FAULT value rather than an errno. Once all instances are converted, vm_fault_t will become a distinct type. Link: http://lkml.kernel.org/r/20180511190542.GA2412@jordon-HP-15-Notebook-PC Signed-off-by: Souptick Joarder <[email protected]> Reviewed-by: Matthew Wilcox <[email protected]> Cc: Dan Williams <[email protected]> Cc: Jan Kara <[email protected]> Cc: Ross Zwisler <[email protected]> Cc: Rik van Riel <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Pavel Tatashin <[email protected]> Cc: Michal Hocko <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent a380b40 commit 2bcd645

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

include/linux/mm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2303,10 +2303,10 @@ extern void truncate_inode_pages_range(struct address_space *,
23032303
extern void truncate_inode_pages_final(struct address_space *);
23042304

23052305
/* generic vm_area_ops exported for stackable file systems */
2306-
extern int filemap_fault(struct vm_fault *vmf);
2306+
extern vm_fault_t filemap_fault(struct vm_fault *vmf);
23072307
extern void filemap_map_pages(struct vm_fault *vmf,
23082308
pgoff_t start_pgoff, pgoff_t end_pgoff);
2309-
extern int filemap_page_mkwrite(struct vm_fault *vmf);
2309+
extern vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf);
23102310

23112311
/* mm/page-writeback.c */
23122312
int __must_check write_one_page(struct page *page);

mm/filemap.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2489,7 +2489,7 @@ static void do_async_mmap_readahead(struct vm_area_struct *vma,
24892489
*
24902490
* We never return with VM_FAULT_RETRY and a bit from VM_FAULT_ERROR set.
24912491
*/
2492-
int filemap_fault(struct vm_fault *vmf)
2492+
vm_fault_t filemap_fault(struct vm_fault *vmf)
24932493
{
24942494
int error;
24952495
struct file *file = vmf->vma->vm_file;
@@ -2499,7 +2499,7 @@ int filemap_fault(struct vm_fault *vmf)
24992499
pgoff_t offset = vmf->pgoff;
25002500
pgoff_t max_off;
25012501
struct page *page;
2502-
int ret = 0;
2502+
vm_fault_t ret = 0;
25032503

25042504
max_off = DIV_ROUND_UP(i_size_read(inode), PAGE_SIZE);
25052505
if (unlikely(offset >= max_off))
@@ -2693,11 +2693,11 @@ void filemap_map_pages(struct vm_fault *vmf,
26932693
}
26942694
EXPORT_SYMBOL(filemap_map_pages);
26952695

2696-
int filemap_page_mkwrite(struct vm_fault *vmf)
2696+
vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf)
26972697
{
26982698
struct page *page = vmf->page;
26992699
struct inode *inode = file_inode(vmf->vma->vm_file);
2700-
int ret = VM_FAULT_LOCKED;
2700+
vm_fault_t ret = VM_FAULT_LOCKED;
27012701

27022702
sb_start_pagefault(inode->i_sb);
27032703
file_update_time(vmf->vma->vm_file);

mm/nommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,7 @@ unsigned long arch_get_unmapped_area(struct file *file, unsigned long addr,
17631763
return -ENOMEM;
17641764
}
17651765

1766-
int filemap_fault(struct vm_fault *vmf)
1766+
vm_fault_t filemap_fault(struct vm_fault *vmf)
17671767
{
17681768
BUG();
17691769
return 0;

0 commit comments

Comments
 (0)