public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Pratt <slpratt@austin.ibm.com>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: linux-kernel@vger.kernel.org, Ram Pai <linuxram@us.ibm.com>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH 1/4] page_cache_readahead: unneeded prev_page assignments
Date: Tue, 25 Jan 2005 15:40:18 -0600	[thread overview]
Message-ID: <41F6BCC2.2080609@austin.ibm.com> (raw)
In-Reply-To: <41F6348E.A1CB395C@tv-sign.ru>

Looks fine, thought we had some reason for it in the past, but it will 
definitly be overwritten.

Signed-off-by: Steven Pratt <slpratt@austin.ibm.com>

Oleg Nesterov wrote:

>There is no point in setting ra->prev_page before 'goto out',
>it will be overwritten anyway.
>
>Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
>
>--- 2.6.11-rc2/mm/readahead.c~	Wed Jan 12 11:44:55 2005
>+++ 2.6.11-rc2/mm/readahead.c	Mon Jan 24 20:19:38 2005
>@@ -432,7 +432,6 @@ page_cache_readahead(struct address_spac
> 
> 	if (newsize == 0 || (ra->flags & RA_FLAG_INCACHE)) {
> 		newsize = 1;
>-		ra->prev_page = offset;
> 		goto out;	/* No readahead or file already in cache */
> 	}
> 	/*
>@@ -443,7 +442,6 @@ page_cache_readahead(struct address_spac
> 	if ((ra->size == 0 && offset == 0)	/* first io and start of file */
> 	    || (ra->size == -1 && ra->prev_page == offset - 1)) {
> 		/* First sequential */
>-		ra->prev_page  = offset + newsize - 1;
> 		ra->size = get_init_ra_size(newsize, max);
> 		ra->start = offset;
> 		if (!blockable_page_cache_readahead(mapping, filp, offset,
>@@ -475,7 +473,6 @@ page_cache_readahead(struct address_spac
> 	 */
> 	if ((offset != (ra->prev_page+1) || (ra->size == 0))) {
> 		ra_off(ra);
>-		ra->prev_page  = offset + newsize - 1;
> 		blockable_page_cache_readahead(mapping, filp, offset,
> 				 newsize, ra, 1);
> 		goto out;
>@@ -545,7 +542,7 @@ page_cache_readahead(struct address_spac
> 
> out:
> 	ra->prev_page = offset + newsize - 1;
>-	return(newsize);
>+	return newsize;
> }
> 
> /*
>  
>


      reply	other threads:[~2005-01-25 22:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-25 11:59 [PATCH 1/4] page_cache_readahead: unneeded prev_page assignments Oleg Nesterov
2005-01-25 21:40 ` Steven Pratt [this message]

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=41F6BCC2.2080609@austin.ibm.com \
    --to=slpratt@austin.ibm.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxram@us.ibm.com \
    --cc=oleg@tv-sign.ru \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox