diff mbox series

mm/filemap.c: Use vmf_error()

Message ID 20180927171411.GA23331@jordon-HP-15-Notebook-PC (mailing list archive)
State New, archived
Headers show
Series mm/filemap.c: Use vmf_error() | expand

Commit Message

Souptick Joarder Sept. 27, 2018, 5:14 p.m. UTC
These codes can be replaced with new inline vmf_error().

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
---
 mm/filemap.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Jan Kara Oct. 1, 2018, 9:51 a.m. UTC | #1
On Thu 27-09-18 22:44:12, Souptick Joarder wrote:
> These codes can be replaced with new inline vmf_error().
> 
> Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>

Looks good. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  mm/filemap.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/mm/filemap.c b/mm/filemap.c
> index 52517f2..7d04d7c 100644
> --- a/mm/filemap.c
> +++ b/mm/filemap.c
> @@ -2581,9 +2581,7 @@ vm_fault_t filemap_fault(struct vm_fault *vmf)
>  	 * system is low on memory, or a problem occurs while trying
>  	 * to schedule I/O.
>  	 */
> -	if (error == -ENOMEM)
> -		return VM_FAULT_OOM;
> -	return VM_FAULT_SIGBUS;
> +	return vmf_error(error);
>  
>  page_not_uptodate:
>  	/*
> -- 
> 1.9.1
>
diff mbox series

Patch

diff --git a/mm/filemap.c b/mm/filemap.c
index 52517f2..7d04d7c 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2581,9 +2581,7 @@  vm_fault_t filemap_fault(struct vm_fault *vmf)
 	 * system is low on memory, or a problem occurs while trying
 	 * to schedule I/O.
 	 */
-	if (error == -ENOMEM)
-		return VM_FAULT_OOM;
-	return VM_FAULT_SIGBUS;
+	return vmf_error(error);
 
 page_not_uptodate:
 	/*