diff mbox

Change the check for PageReadahead into an else-if

Message ID 08589dd39c78346ec2ed2fedfd6e3121ca38acda.1350413420.git.rprabhu@wnohang.net (mailing list archive)
State New, archived
Headers show

Commit Message

Raghavendra D Prabhu Oct. 16, 2012, 6:58 p.m. UTC
From: Raghavendra D Prabhu <rprabhu@wnohang.net>

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@wnohang.net>
---
 fs/btrfs/relocation.c | 10 ++++------
 mm/filemap.c          |  3 +--
 2 files changed, 5 insertions(+), 8 deletions(-)

Comments

Fengguang Wu Oct. 17, 2012, 2 a.m. UTC | #1
On Wed, Oct 17, 2012 at 12:28:05AM +0530, raghu.prabhu13@gmail.com wrote:
> From: Raghavendra D Prabhu <rprabhu@wnohang.net>
> 
> >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@wnohang.net>
> ---
>  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);

That extra indent is not necessary.

Otherwise looks good to me. Thanks!

Reviewed-by: Fengguang Wu <fengguang.wu@intel.com>

>  		}
>  
>  		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 from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Motohiro KOSAKI Oct. 17, 2012, 2:02 a.m. UTC | #2
On Tue, Oct 16, 2012 at 10:00 PM, Fengguang Wu <fengguang.wu@intel.com> wrote:
> On Wed, Oct 17, 2012 at 12:28:05AM +0530, raghu.prabhu13@gmail.com wrote:
>> From: Raghavendra D Prabhu <rprabhu@wnohang.net>
>>
>> >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@wnohang.net>
>> ---
>>  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);
>
> That extra indent is not necessary.
>
> Otherwise looks good to me. Thanks!
>
> Reviewed-by: Fengguang Wu <fengguang.wu@intel.com>

Hi Raghavendra,

Indentation breakage is now welcome. Please respin it. Otherwise

Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Raghavendra D Prabhu Oct. 24, 2012, 8:44 p.m. UTC | #3
Hi,


* On Tue, Oct 16, 2012 at 10:02:44PM -0400, KOSAKI Motohiro <kosaki.motohiro@gmail.com> wrote:
>On Tue, Oct 16, 2012 at 10:00 PM, Fengguang Wu <fengguang.wu@intel.com> wrote:
>> On Wed, Oct 17, 2012 at 12:28:05AM +0530, raghu.prabhu13@gmail.com wrote:
>>> From: Raghavendra D Prabhu <rprabhu@wnohang.net>
>>>
>>> >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@wnohang.net>
>>> ---
>>>  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);
>>
>> That extra indent is not necessary.
>>
>> Otherwise looks good to me. Thanks!
>>
>> Reviewed-by: Fengguang Wu <fengguang.wu@intel.com>
>
>Hi Raghavendra,
>
>Indentation breakage is now welcome. Please respin it. Otherwise
>
>Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>

Thanks, will do.


Regards,
diff mbox

Patch

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);