mm: change return type to vm_fault_t
The plan for these patches is to introduce the typedef, initially just as documentation ("These functions should return a VM_FAULT_ status"). We'll trickle the patches to individual drivers/filesystems in through the maintainers, as far as possible. Then we'll change the typedef to an unsigned int and break the compilation of any unconverted drivers/filesystems. vmf_insert_page(), vmf_insert_mixed() and vmf_insert_pfn() are three newly added functions. The various drivers/filesystems where return value of fault(), huge_fault(), page_mkwrite() and pfn_mkwrite() get converted, will need them. These functions will return correct VM_FAULT_ code based on err value. We've had bugs before where drivers returned -EFOO. And we have this silly inefficiency where vm_insert_xxx() return an errno which (afaict) every driver then converts into a VM_FAULT code. In many cases drivers failed to return correct VM_FAULT code value despite of vm_insert_xxx() fails. We have indentified and clean up all those existing bugs and silly inefficiencies in driver/filesystems by adding these three new inline wrappers. As mentioned above, we will trickle those patches to individual drivers/filesystems in through maintainers after these three wrapper functions are merged. Eventually we can convert vm_insert_xxx() into vmf_insert_xxx() and remove these inline wrappers, but these are a good intermediate step. Link: http://lkml.kernel.org/r/20180310162351.GA7422@jordon-HP-15-Notebook-PC Signed-off-by:Souptick Joarder <jrdr.linux@gmail.com> Acked-by:
Michal Hocko <mhocko@suse.com> Cc: Matthew Wilcox <willy@infradead.org> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
Loading
-
mentioned in commit 41412fe9
-
mentioned in commit 29581051
-
mentioned in commit b3ec9f33
-
mentioned in commit 20acce67
-
mentioned in commit 1499fa80
-
mentioned in commit a528a241
-
mentioned in commit 3fb3894b
-
mentioned in commit 14f28f57
-
mentioned in commit f77bc3a8
-
mentioned in commit 8fb8876b
-
mentioned in commit 50a7ca3c
-
mentioned in commit 8bf782f6
-
mentioned in commit 46fb504a
-
mentioned in commit 42df0509
-
mentioned in commit 0722f186
-
mentioned in commit 0edf6813
Please register or sign in to comment