Skip to contentSkip to conversation

mm: Make filemap_nopage use NOPAGE_SIGBUS

PATCH In review Adam Litke 2 participants 2 messages Sep 28, 2006

Subsystems (2)
lore
Share & tools
lore

Adam Litke

author
#0 lore raw

PATCH 1/1 mm: Make filemap_nopage use NOPAGE_SIGBUS

Hi Andrew. This is just a "nice to have" cleanup patch. Any chance on getting it merged (lest I forget about it again)? Thanks.

While reading trough filemap_nopage() I found the 'return NULL' statements a bit confusing since we already have two constants defined for ->nopage error conditions. Since a NULL return value really means NOPAGE_SIGBUS, just return that to make the code more readable.

 filemap.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
mm/filemap.c +3 -3
diff -upN reference/mm/filemap.c current/mm/filemap.c
@@ -1454,7 +1454,7 @@ outside_data_content:
 	 * accessible..
 	 */
 	if (area->vm_mm == current->mm)
-		return NULL;
+		return NOPAGE_SIGBUS;
 	/* Fall through to the non-read-ahead case */
 no_cached_page:
 	/*
@@ -1479,7 +1479,7 @@ no_cached_page:
 	 */
 	if (error == -ENOMEM)
 		return NOPAGE_OOM;
-	return NULL;
+	return NOPAGE_SIGBUS;
 
 page_not_uptodate:
 	if (!did_readaround) {
@@ -1548,7 +1548,7 @@ page_not_uptodate:
 	 */
 	shrink_readahead_size_eio(file, ra);
 	page_cache_release(page);
-	return NULL;
+	return NOPAGE_SIGBUS;
 }
 EXPORT_SYMBOL(filemap_nopage);
 
Signature · 2 lines
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Adam Litke

Hi Andrew. This is just a "nice to have" cleanup patch. Any chance on getting it merged (lest I forget about it again)? Thanks.

While reading trough filemap_nopage() I found the 'return NULL' statements a bit confusing since we already have two constants defined for ->nopage error conditions. Since a NULL return value really means NOPAGE_SIGBUS, just return that to make the code more readable.

That's long confused and irritated me, gladly

Quoted 37 lines
 filemap.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -upN reference/mm/filemap.c current/mm/filemap.c

mm/filemap.c +3 -3
@@ -1454,7 +1454,7 @@ outside_data_content:
 	 * accessible..
 	 */
 	if (area->vm_mm == current->mm)
-		return NULL;
+		return NOPAGE_SIGBUS;
 	/* Fall through to the non-read-ahead case */
 no_cached_page:
 	/*
@@ -1479,7 +1479,7 @@ no_cached_page:
 	 */
 	if (error == -ENOMEM)
 		return NOPAGE_OOM;
-	return NULL;
+	return NOPAGE_SIGBUS;
 
 page_not_uptodate:
 	if (!did_readaround) {
@@ -1548,7 +1548,7 @@ page_not_uptodate:
 	 */
 	shrink_readahead_size_eio(file, ra);
 	page_cache_release(page);
-	return NULL;
+	return NOPAGE_SIGBUS;
 }
 EXPORT_SYMBOL(filemap_nopage);
 
Signature · 2 lines
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>