[PATCH] Change the check for PageReadahead into an else-if

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Raghavendra D Prabhu <rprabhu@xxxxxxxxxxx>

>From 51daa88ebd8e0d437289f589af29d4b39379ea76, page_sync_readahead coalesces
async readahead into its readahead window, so another checking for that again is
not required.

Signed-off-by: Raghavendra D Prabhu <rprabhu@xxxxxxxxxxx>
---
 fs/btrfs/relocation.c | 10 ++++------
 mm/filemap.c          |  3 +--
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 4da0865..6362003 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -2996,12 +2996,10 @@ static int relocate_file_extent_cluster(struct inode *inode,
 				ret = -ENOMEM;
 				goto out;
 			}
-		}
-
-		if (PageReadahead(page)) {
-			page_cache_async_readahead(inode->i_mapping,
-						   ra, NULL, page, index,
-						   last_index + 1 - index);
+		} else if (PageReadahead(page)) {
+				page_cache_async_readahead(inode->i_mapping,
+							ra, NULL, page, index,
+							last_index + 1 - index);
 		}
 
 		if (!PageUptodate(page)) {
diff --git a/mm/filemap.c b/mm/filemap.c
index 3843445..d703224 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1113,8 +1113,7 @@ find_page:
 			page = find_get_page(mapping, index);
 			if (unlikely(page == NULL))
 				goto no_cached_page;
-		}
-		if (PageReadahead(page)) {
+		} else if (PageReadahead(page)) {
 			page_cache_async_readahead(mapping,
 					ra, filp, page,
 					index, last_index - index);
-- 
1.7.12.3

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


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]