All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Souptick Joarder <jrdr.linux@gmail.com>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, devel@lists.orangefs.org,
	ceph-devel@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com,
	linux-mtd@lists.infradead.org, dri-devel@lists.freedesktop.org,
	lustre-devel@lists.lustre.org,
	linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org
Subject: [PATCH 12/14] lustre: separate errno from VM_FAULT_* values
Date: Wed, 16 May 2018 07:43:46 +0200	[thread overview]
Message-ID: <20180516054348.15950-13-hch@lst.de> (raw)
In-Reply-To: <20180516054348.15950-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 .../staging/lustre/lustre/llite/llite_mmap.c  | 37 +++++++------------
 .../lustre/lustre/llite/vvp_internal.h        |  2 +-
 2 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c b/drivers/staging/lustre/lustre/llite/llite_mmap.c
index 214b07554e62..061d98871959 100644
--- a/drivers/staging/lustre/lustre/llite/llite_mmap.c
+++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c
@@ -231,23 +231,18 @@ static int ll_page_mkwrite0(struct vm_area_struct *vma, struct page *vmpage,
 	return result;
 }
 
-static inline int to_fault_error(int result)
+static inline vm_fault_t to_fault_error(int result)
 {
 	switch (result) {
 	case 0:
-		result = VM_FAULT_LOCKED;
-		break;
+		return VM_FAULT_LOCKED;
 	case -EFAULT:
-		result = VM_FAULT_NOPAGE;
-		break;
+		return VM_FAULT_NOPAGE;
 	case -ENOMEM:
-		result = VM_FAULT_OOM;
-		break;
+		return VM_FAULT_OOM;
 	default:
-		result = VM_FAULT_SIGBUS;
-		break;
+		return VM_FAULT_SIGBUS;
 	}
-	return result;
 }
 
 /**
@@ -261,7 +256,7 @@ static inline int to_fault_error(int result)
  * \retval VM_FAULT_ERROR on general error
  * \retval NOPAGE_OOM not have memory for allocate new page
  */
-static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
+static vm_fault_t ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
 	struct lu_env	   *env;
 	struct cl_io	    *io;
@@ -269,7 +264,7 @@ static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
 	struct page	     *vmpage;
 	unsigned long	    ra_flags;
 	int		      result = 0;
-	int		      fault_ret = 0;
+	vm_fault_t	      fault_ret = 0;
 	u16 refcheck;
 
 	env = cl_env_get(&refcheck);
@@ -323,7 +318,7 @@ static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
 	return fault_ret;
 }
 
-static int ll_fault(struct vm_fault *vmf)
+static vm_fault_t ll_fault(struct vm_fault *vmf)
 {
 	int count = 0;
 	bool printed = false;
@@ -364,7 +359,7 @@ static int ll_fault(struct vm_fault *vmf)
 	return result;
 }
 
-static int ll_page_mkwrite(struct vm_fault *vmf)
+static vm_fault_t ll_page_mkwrite(struct vm_fault *vmf)
 {
 	struct vm_area_struct *vma = vmf->vma;
 	int count = 0;
@@ -390,22 +385,16 @@ static int ll_page_mkwrite(struct vm_fault *vmf)
 	switch (result) {
 	case 0:
 		LASSERT(PageLocked(vmf->page));
-		result = VM_FAULT_LOCKED;
-		break;
+		return VM_FAULT_LOCKED;
 	case -ENODATA:
 	case -EAGAIN:
 	case -EFAULT:
-		result = VM_FAULT_NOPAGE;
-		break;
+		return VM_FAULT_NOPAGE;
 	case -ENOMEM:
-		result = VM_FAULT_OOM;
-		break;
+		return VM_FAULT_OOM;
 	default:
-		result = VM_FAULT_SIGBUS;
-		break;
+		return VM_FAULT_SIGBUS;
 	}
-
-	return result;
 }
 
 /**
diff --git a/drivers/staging/lustre/lustre/llite/vvp_internal.h b/drivers/staging/lustre/lustre/llite/vvp_internal.h
index 7d3abb43584a..c194966a3d82 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_internal.h
+++ b/drivers/staging/lustre/lustre/llite/vvp_internal.h
@@ -83,7 +83,7 @@ struct vvp_io {
 			/**
 			 * fault API used bitflags for return code.
 			 */
-			unsigned int    ft_flags;
+			vm_fault_t    ft_flags;
 			/**
 			 * check that flags are from filemap_fault
 			 */
-- 
2.17.0


WARNING: multiple messages have this Message-ID
From: Christoph Hellwig <hch@lst.de>
To: Souptick Joarder <jrdr.linux@gmail.com>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-mm@kvack.org, ocfs2-devel@oss.oracle.com,
	devel@lists.orangefs.org, linux-fsdevel@vger.kernel.org,
	linux-mtd@lists.infradead.org, ceph-devel@vger.kernel.org,
	linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org,
	lustre-devel@lists.lustre.org
Subject: [PATCH 12/14] lustre: separate errno from VM_FAULT_* values
Date: Wed, 16 May 2018 07:43:46 +0200	[thread overview]
Message-ID: <20180516054348.15950-13-hch@lst.de> (raw)
In-Reply-To: <20180516054348.15950-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 .../staging/lustre/lustre/llite/llite_mmap.c  | 37 +++++++------------
 .../lustre/lustre/llite/vvp_internal.h        |  2 +-
 2 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c b/drivers/staging/lustre/lustre/llite/llite_mmap.c
index 214b07554e62..061d98871959 100644
--- a/drivers/staging/lustre/lustre/llite/llite_mmap.c
+++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c
@@ -231,23 +231,18 @@ static int ll_page_mkwrite0(struct vm_area_struct *vma, struct page *vmpage,
 	return result;
 }
 
-static inline int to_fault_error(int result)
+static inline vm_fault_t to_fault_error(int result)
 {
 	switch (result) {
 	case 0:
-		result = VM_FAULT_LOCKED;
-		break;
+		return VM_FAULT_LOCKED;
 	case -EFAULT:
-		result = VM_FAULT_NOPAGE;
-		break;
+		return VM_FAULT_NOPAGE;
 	case -ENOMEM:
-		result = VM_FAULT_OOM;
-		break;
+		return VM_FAULT_OOM;
 	default:
-		result = VM_FAULT_SIGBUS;
-		break;
+		return VM_FAULT_SIGBUS;
 	}
-	return result;
 }
 
 /**
@@ -261,7 +256,7 @@ static inline int to_fault_error(int result)
  * \retval VM_FAULT_ERROR on general error
  * \retval NOPAGE_OOM not have memory for allocate new page
  */
-static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
+static vm_fault_t ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
 	struct lu_env	   *env;
 	struct cl_io	    *io;
@@ -269,7 +264,7 @@ static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
 	struct page	     *vmpage;
 	unsigned long	    ra_flags;
 	int		      result = 0;
-	int		      fault_ret = 0;
+	vm_fault_t	      fault_ret = 0;
 	u16 refcheck;
 
 	env = cl_env_get(&refcheck);
@@ -323,7 +318,7 @@ static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
 	return fault_ret;
 }
 
-static int ll_fault(struct vm_fault *vmf)
+static vm_fault_t ll_fault(struct vm_fault *vmf)
 {
 	int count = 0;
 	bool printed = false;
@@ -364,7 +359,7 @@ static int ll_fault(struct vm_fault *vmf)
 	return result;
 }
 
-static int ll_page_mkwrite(struct vm_fault *vmf)
+static vm_fault_t ll_page_mkwrite(struct vm_fault *vmf)
 {
 	struct vm_area_struct *vma = vmf->vma;
 	int count = 0;
@@ -390,22 +385,16 @@ static int ll_page_mkwrite(struct vm_fault *vmf)
 	switch (result) {
 	case 0:
 		LASSERT(PageLocked(vmf->page));
-		result = VM_FAULT_LOCKED;
-		break;
+		return VM_FAULT_LOCKED;
 	case -ENODATA:
 	case -EAGAIN:
 	case -EFAULT:
-		result = VM_FAULT_NOPAGE;
-		break;
+		return VM_FAULT_NOPAGE;
 	case -ENOMEM:
-		result = VM_FAULT_OOM;
-		break;
+		return VM_FAULT_OOM;
 	default:
-		result = VM_FAULT_SIGBUS;
-		break;
+		return VM_FAULT_SIGBUS;
 	}
-
-	return result;
 }
 
 /**
diff --git a/drivers/staging/lustre/lustre/llite/vvp_internal.h b/drivers/staging/lustre/lustre/llite/vvp_internal.h
index 7d3abb43584a..c194966a3d82 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_internal.h
+++ b/drivers/staging/lustre/lustre/llite/vvp_internal.h
@@ -83,7 +83,7 @@ struct vvp_io {
 			/**
 			 * fault API used bitflags for return code.
 			 */
-			unsigned int    ft_flags;
+			vm_fault_t    ft_flags;
 			/**
 			 * check that flags are from filemap_fault
 			 */
-- 
2.17.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID
From: Christoph Hellwig <hch@lst.de>
To: Souptick Joarder <jrdr.linux@gmail.com>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-mm@kvack.org, ocfs2-devel@oss.oracle.com,
	devel@lists.orangefs.org, linux-fsdevel@vger.kernel.org,
	linux-mtd@lists.infradead.org, ceph-devel@vger.kernel.org,
	linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org,
	lustre-devel@lists.lustre.org
Subject: [Ocfs2-devel] [PATCH 12/14] lustre: separate errno from VM_FAULT_* values
Date: Wed, 16 May 2018 07:43:46 +0200	[thread overview]
Message-ID: <20180516054348.15950-13-hch@lst.de> (raw)
In-Reply-To: <20180516054348.15950-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 .../staging/lustre/lustre/llite/llite_mmap.c  | 37 +++++++------------
 .../lustre/lustre/llite/vvp_internal.h        |  2 +-
 2 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c b/drivers/staging/lustre/lustre/llite/llite_mmap.c
index 214b07554e62..061d98871959 100644
--- a/drivers/staging/lustre/lustre/llite/llite_mmap.c
+++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c
@@ -231,23 +231,18 @@ static int ll_page_mkwrite0(struct vm_area_struct *vma, struct page *vmpage,
 	return result;
 }
 
-static inline int to_fault_error(int result)
+static inline vm_fault_t to_fault_error(int result)
 {
 	switch (result) {
 	case 0:
-		result = VM_FAULT_LOCKED;
-		break;
+		return VM_FAULT_LOCKED;
 	case -EFAULT:
-		result = VM_FAULT_NOPAGE;
-		break;
+		return VM_FAULT_NOPAGE;
 	case -ENOMEM:
-		result = VM_FAULT_OOM;
-		break;
+		return VM_FAULT_OOM;
 	default:
-		result = VM_FAULT_SIGBUS;
-		break;
+		return VM_FAULT_SIGBUS;
 	}
-	return result;
 }
 
 /**
@@ -261,7 +256,7 @@ static inline int to_fault_error(int result)
  * \retval VM_FAULT_ERROR on general error
  * \retval NOPAGE_OOM not have memory for allocate new page
  */
-static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
+static vm_fault_t ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
 	struct lu_env	   *env;
 	struct cl_io	    *io;
@@ -269,7 +264,7 @@ static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
 	struct page	     *vmpage;
 	unsigned long	    ra_flags;
 	int		      result = 0;
-	int		      fault_ret = 0;
+	vm_fault_t	      fault_ret = 0;
 	u16 refcheck;
 
 	env = cl_env_get(&refcheck);
@@ -323,7 +318,7 @@ static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
 	return fault_ret;
 }
 
-static int ll_fault(struct vm_fault *vmf)
+static vm_fault_t ll_fault(struct vm_fault *vmf)
 {
 	int count = 0;
 	bool printed = false;
@@ -364,7 +359,7 @@ static int ll_fault(struct vm_fault *vmf)
 	return result;
 }
 
-static int ll_page_mkwrite(struct vm_fault *vmf)
+static vm_fault_t ll_page_mkwrite(struct vm_fault *vmf)
 {
 	struct vm_area_struct *vma = vmf->vma;
 	int count = 0;
@@ -390,22 +385,16 @@ static int ll_page_mkwrite(struct vm_fault *vmf)
 	switch (result) {
 	case 0:
 		LASSERT(PageLocked(vmf->page));
-		result = VM_FAULT_LOCKED;
-		break;
+		return VM_FAULT_LOCKED;
 	case -ENODATA:
 	case -EAGAIN:
 	case -EFAULT:
-		result = VM_FAULT_NOPAGE;
-		break;
+		return VM_FAULT_NOPAGE;
 	case -ENOMEM:
-		result = VM_FAULT_OOM;
-		break;
+		return VM_FAULT_OOM;
 	default:
-		result = VM_FAULT_SIGBUS;
-		break;
+		return VM_FAULT_SIGBUS;
 	}
-
-	return result;
 }
 
 /**
diff --git a/drivers/staging/lustre/lustre/llite/vvp_internal.h b/drivers/staging/lustre/lustre/llite/vvp_internal.h
index 7d3abb43584a..c194966a3d82 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_internal.h
+++ b/drivers/staging/lustre/lustre/llite/vvp_internal.h
@@ -83,7 +83,7 @@ struct vvp_io {
 			/**
 			 * fault API used bitflags for return code.
 			 */
-			unsigned int    ft_flags;
+			vm_fault_t    ft_flags;
 			/**
 			 * check that flags are from filemap_fault
 			 */
-- 
2.17.0

WARNING: multiple messages have this Message-ID
From: Christoph Hellwig <hch@lst.de>
To: Souptick Joarder <jrdr.linux@gmail.com>,
	Matthew Wilcox <willy@infradead.org>
Cc: linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-mm@kvack.org, ocfs2-devel@oss.oracle.com,
	devel@lists.orangefs.org, linux-fsdevel@vger.kernel.org,
	linux-mtd@lists.infradead.org, ceph-devel@vger.kernel.org,
	linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org,
	lustre-devel@lists.lustre.org
Subject: [lustre-devel] [PATCH 12/14] lustre: separate errno from VM_FAULT_* values
Date: Wed, 16 May 2018 07:43:46 +0200	[thread overview]
Message-ID: <20180516054348.15950-13-hch@lst.de> (raw)
In-Reply-To: <20180516054348.15950-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 .../staging/lustre/lustre/llite/llite_mmap.c  | 37 +++++++------------
 .../lustre/lustre/llite/vvp_internal.h        |  2 +-
 2 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c b/drivers/staging/lustre/lustre/llite/llite_mmap.c
index 214b07554e62..061d98871959 100644
--- a/drivers/staging/lustre/lustre/llite/llite_mmap.c
+++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c
@@ -231,23 +231,18 @@ static int ll_page_mkwrite0(struct vm_area_struct *vma, struct page *vmpage,
 	return result;
 }
 
-static inline int to_fault_error(int result)
+static inline vm_fault_t to_fault_error(int result)
 {
 	switch (result) {
 	case 0:
-		result = VM_FAULT_LOCKED;
-		break;
+		return VM_FAULT_LOCKED;
 	case -EFAULT:
-		result = VM_FAULT_NOPAGE;
-		break;
+		return VM_FAULT_NOPAGE;
 	case -ENOMEM:
-		result = VM_FAULT_OOM;
-		break;
+		return VM_FAULT_OOM;
 	default:
-		result = VM_FAULT_SIGBUS;
-		break;
+		return VM_FAULT_SIGBUS;
 	}
-	return result;
 }
 
 /**
@@ -261,7 +256,7 @@ static inline int to_fault_error(int result)
  * \retval VM_FAULT_ERROR on general error
  * \retval NOPAGE_OOM not have memory for allocate new page
  */
-static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
+static vm_fault_t ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
 	struct lu_env	   *env;
 	struct cl_io	    *io;
@@ -269,7 +264,7 @@ static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
 	struct page	     *vmpage;
 	unsigned long	    ra_flags;
 	int		      result = 0;
-	int		      fault_ret = 0;
+	vm_fault_t	      fault_ret = 0;
 	u16 refcheck;
 
 	env = cl_env_get(&refcheck);
@@ -323,7 +318,7 @@ static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
 	return fault_ret;
 }
 
-static int ll_fault(struct vm_fault *vmf)
+static vm_fault_t ll_fault(struct vm_fault *vmf)
 {
 	int count = 0;
 	bool printed = false;
@@ -364,7 +359,7 @@ static int ll_fault(struct vm_fault *vmf)
 	return result;
 }
 
-static int ll_page_mkwrite(struct vm_fault *vmf)
+static vm_fault_t ll_page_mkwrite(struct vm_fault *vmf)
 {
 	struct vm_area_struct *vma = vmf->vma;
 	int count = 0;
@@ -390,22 +385,16 @@ static int ll_page_mkwrite(struct vm_fault *vmf)
 	switch (result) {
 	case 0:
 		LASSERT(PageLocked(vmf->page));
-		result = VM_FAULT_LOCKED;
-		break;
+		return VM_FAULT_LOCKED;
 	case -ENODATA:
 	case -EAGAIN:
 	case -EFAULT:
-		result = VM_FAULT_NOPAGE;
-		break;
+		return VM_FAULT_NOPAGE;
 	case -ENOMEM:
-		result = VM_FAULT_OOM;
-		break;
+		return VM_FAULT_OOM;
 	default:
-		result = VM_FAULT_SIGBUS;
-		break;
+		return VM_FAULT_SIGBUS;
 	}
-
-	return result;
 }
 
 /**
diff --git a/drivers/staging/lustre/lustre/llite/vvp_internal.h b/drivers/staging/lustre/lustre/llite/vvp_internal.h
index 7d3abb43584a..c194966a3d82 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_internal.h
+++ b/drivers/staging/lustre/lustre/llite/vvp_internal.h
@@ -83,7 +83,7 @@ struct vvp_io {
 			/**
 			 * fault API used bitflags for return code.
 			 */
-			unsigned int    ft_flags;
+			vm_fault_t    ft_flags;
 			/**
 			 * check that flags are from filemap_fault
 			 */
-- 
2.17.0

WARNING: multiple messages have this Message-ID
From: hch@lst.de (Christoph Hellwig)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 12/14] lustre: separate errno from VM_FAULT_* values
Date: Wed, 16 May 2018 07:43:46 +0200	[thread overview]
Message-ID: <20180516054348.15950-13-hch@lst.de> (raw)
In-Reply-To: <20180516054348.15950-1-hch@lst.de>

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 .../staging/lustre/lustre/llite/llite_mmap.c  | 37 +++++++------------
 .../lustre/lustre/llite/vvp_internal.h        |  2 +-
 2 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c b/drivers/staging/lustre/lustre/llite/llite_mmap.c
index 214b07554e62..061d98871959 100644
--- a/drivers/staging/lustre/lustre/llite/llite_mmap.c
+++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c
@@ -231,23 +231,18 @@ static int ll_page_mkwrite0(struct vm_area_struct *vma, struct page *vmpage,
 	return result;
 }
 
-static inline int to_fault_error(int result)
+static inline vm_fault_t to_fault_error(int result)
 {
 	switch (result) {
 	case 0:
-		result = VM_FAULT_LOCKED;
-		break;
+		return VM_FAULT_LOCKED;
 	case -EFAULT:
-		result = VM_FAULT_NOPAGE;
-		break;
+		return VM_FAULT_NOPAGE;
 	case -ENOMEM:
-		result = VM_FAULT_OOM;
-		break;
+		return VM_FAULT_OOM;
 	default:
-		result = VM_FAULT_SIGBUS;
-		break;
+		return VM_FAULT_SIGBUS;
 	}
-	return result;
 }
 
 /**
@@ -261,7 +256,7 @@ static inline int to_fault_error(int result)
  * \retval VM_FAULT_ERROR on general error
  * \retval NOPAGE_OOM not have memory for allocate new page
  */
-static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
+static vm_fault_t ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
 	struct lu_env	   *env;
 	struct cl_io	    *io;
@@ -269,7 +264,7 @@ static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
 	struct page	     *vmpage;
 	unsigned long	    ra_flags;
 	int		      result = 0;
-	int		      fault_ret = 0;
+	vm_fault_t	      fault_ret = 0;
 	u16 refcheck;
 
 	env = cl_env_get(&refcheck);
@@ -323,7 +318,7 @@ static int ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf)
 	return fault_ret;
 }
 
-static int ll_fault(struct vm_fault *vmf)
+static vm_fault_t ll_fault(struct vm_fault *vmf)
 {
 	int count = 0;
 	bool printed = false;
@@ -364,7 +359,7 @@ static int ll_fault(struct vm_fault *vmf)
 	return result;
 }
 
-static int ll_page_mkwrite(struct vm_fault *vmf)
+static vm_fault_t ll_page_mkwrite(struct vm_fault *vmf)
 {
 	struct vm_area_struct *vma = vmf->vma;
 	int count = 0;
@@ -390,22 +385,16 @@ static int ll_page_mkwrite(struct vm_fault *vmf)
 	switch (result) {
 	case 0:
 		LASSERT(PageLocked(vmf->page));
-		result = VM_FAULT_LOCKED;
-		break;
+		return VM_FAULT_LOCKED;
 	case -ENODATA:
 	case -EAGAIN:
 	case -EFAULT:
-		result = VM_FAULT_NOPAGE;
-		break;
+		return VM_FAULT_NOPAGE;
 	case -ENOMEM:
-		result = VM_FAULT_OOM;
-		break;
+		return VM_FAULT_OOM;
 	default:
-		result = VM_FAULT_SIGBUS;
-		break;
+		return VM_FAULT_SIGBUS;
 	}
-
-	return result;
 }
 
 /**
diff --git a/drivers/staging/lustre/lustre/llite/vvp_internal.h b/drivers/staging/lustre/lustre/llite/vvp_internal.h
index 7d3abb43584a..c194966a3d82 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_internal.h
+++ b/drivers/staging/lustre/lustre/llite/vvp_internal.h
@@ -83,7 +83,7 @@ struct vvp_io {
 			/**
 			 * fault API used bitflags for return code.
 			 */
-			unsigned int    ft_flags;
+			vm_fault_t    ft_flags;
 			/**
 			 * check that flags are from filemap_fault
 			 */
-- 
2.17.0

  parent reply	other threads:[~2018-05-16  5:44 UTC|newest]

Thread overview: 125+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16  5:43 vm_fault_t conversion, for real Christoph Hellwig
2018-05-16  5:43 ` Christoph Hellwig
2018-05-16  5:43 ` [lustre-devel] " Christoph Hellwig
2018-05-16  5:43 ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16  5:43 ` [PATCH 01/14] orangefs: don't return errno values from ->fault Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43   ` [lustre-devel] " Christoph Hellwig
2018-05-16  5:43   ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16 11:18   ` Matthew Wilcox
2018-05-16 11:18     ` Matthew Wilcox
2018-05-16 11:18     ` [lustre-devel] " Matthew Wilcox
2018-05-16  5:43 ` [PATCH 02/14] fs: make the filemap_page_mkwrite prototype consistent Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43   ` [lustre-devel] " Christoph Hellwig
2018-05-16  5:43   ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43 ` [PATCH 03/14] dax: make the dax_iomap_fault " Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43   ` [lustre-devel] " Christoph Hellwig
2018-05-16  5:43   ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16  5:43 ` [PATCH 04/14] mm: remove the unused device_private_entry_fault export Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43   ` [lustre-devel] " Christoph Hellwig
2018-05-16  5:43   ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43 ` [PATCH 05/14] ceph: untangle ceph_filemap_fault Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43   ` [lustre-devel] " Christoph Hellwig
2018-05-16  5:43   ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16  5:43 ` [PATCH 06/14] btrfs: separate errno from VM_FAULT_* values Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43   ` [lustre-devel] " Christoph Hellwig
2018-05-16  5:43   ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16 11:13   ` David Sterba
2018-05-16 11:13     ` David Sterba
2018-05-16 11:13     ` [lustre-devel] " David Sterba
2018-05-16 11:13     ` [Ocfs2-devel] " David Sterba
2018-05-16 11:13     ` David Sterba
2018-05-16  5:43 ` [PATCH 07/14] ext4: " Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43   ` [lustre-devel] " Christoph Hellwig
2018-05-16  5:43   ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16  5:43 ` [PATCH 08/14] ocfs2: " Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43   ` [lustre-devel] " Christoph Hellwig
2018-05-16  5:43   ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16  5:43 ` [PATCH 09/14] ubifs: " Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43   ` [lustre-devel] " Christoph Hellwig
2018-05-16  5:43   ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43 ` [PATCH 10/14] vgem: " Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43   ` [lustre-devel] " Christoph Hellwig
2018-05-16  5:43   ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  9:53   ` Daniel Vetter
2018-05-16  9:53     ` Daniel Vetter
2018-05-16  9:53     ` [lustre-devel] " Daniel Vetter
2018-05-16  9:53     ` Daniel Vetter
2018-05-16 13:01     ` Christoph Hellwig
2018-05-16 13:01       ` Christoph Hellwig
2018-05-16 13:01       ` [lustre-devel] " Christoph Hellwig
2018-05-16 13:01       ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16 13:01       ` Christoph Hellwig
2018-05-16 13:13       ` Matthew Wilcox
2018-05-16 13:13         ` Matthew Wilcox
2018-05-16 13:13         ` [lustre-devel] " Matthew Wilcox
2018-05-16  5:43 ` [PATCH 11/14] ttm: " Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43   ` [lustre-devel] " Christoph Hellwig
2018-05-16  5:43   ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43 ` Christoph Hellwig [this message]
2018-05-16  5:43   ` [PATCH 12/14] lustre: " Christoph Hellwig
2018-05-16  5:43   ` [lustre-devel] " Christoph Hellwig
2018-05-16  5:43   ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43 ` [PATCH 13/14] mm: move arch specific VM_FAULT_* flags to mm.h Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43   ` [lustre-devel] " Christoph Hellwig
2018-05-16  5:43   ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16  5:43 ` [PATCH 14/14] mm: turn on vm_fault_t type checking Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43   ` [lustre-devel] " Christoph Hellwig
2018-05-16  5:43   ` Christoph Hellwig
2018-05-16  5:43   ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16 11:28   ` Matthew Wilcox
2018-05-16 11:28     ` Matthew Wilcox
2018-05-16 11:28     ` [lustre-devel] " Matthew Wilcox
2018-05-16 11:28     ` Matthew Wilcox
2018-05-16 13:03     ` Christoph Hellwig
2018-05-16 13:03       ` Christoph Hellwig
2018-05-16 13:03       ` [lustre-devel] " Christoph Hellwig
2018-05-16 13:03       ` Christoph Hellwig
2018-05-16 13:03       ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16 13:03       ` Christoph Hellwig
2018-05-16 15:08   ` Darrick J. Wong
2018-05-16 15:08     ` Darrick J. Wong
2018-05-16 15:08     ` [lustre-devel] " Darrick J. Wong
2018-05-16 15:08     ` Darrick J. Wong
2018-05-16 15:08     ` [Ocfs2-devel] " Darrick J. Wong
2018-05-16 15:08     ` Darrick J. Wong
2018-05-16 17:34     ` Christoph Hellwig
2018-05-16 17:34       ` Christoph Hellwig
2018-05-16 17:34       ` [lustre-devel] " Christoph Hellwig
2018-05-16 17:34       ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16 17:34       ` Christoph Hellwig
2018-05-16 11:23 ` vm_fault_t conversion, for real Matthew Wilcox
2018-05-16 11:23   ` Matthew Wilcox
2018-05-16 11:23   ` [lustre-devel] " Matthew Wilcox
2018-05-16 13:03   ` Christoph Hellwig
2018-05-16 13:03     ` Christoph Hellwig
2018-05-16 13:03     ` [lustre-devel] " Christoph Hellwig
2018-05-16 13:03     ` [Ocfs2-devel] " Christoph Hellwig
2018-05-16 13:03     ` Christoph Hellwig
2018-05-16 13:22     ` Matthew Wilcox
2018-05-16 13:22       ` Matthew Wilcox
2018-05-16 13:22       ` [lustre-devel] " Matthew Wilcox
2018-05-16 17:32       ` Christoph Hellwig
2018-05-16 17:32         ` Christoph Hellwig
2018-05-16 17:32         ` [lustre-devel] " Christoph Hellwig
2018-05-16 17:32         ` [Ocfs2-devel] " Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180516054348.15950-13-hch@lst.de \
    --to=hch@lst.de \
    --cc=ceph-devel@vger.kernel.org \
    --cc=devel@lists.orangefs.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jrdr.linux@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.