From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Chinner Subject: Re: [patch 05/19] Use page_cache_xxx in mm/rmap.c Date: Thu, 29 Nov 2007 14:59:55 +1100 Message-ID: <20071129035955.GZ119954183@sgi.com> References: <20071129011052.866354847@sgi.com> <20071129011145.414062339@sgi.com> <20071129031921.GS119954183@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: David Chinner , akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Christoph Hellwig , Mel Gorman , William Lee Irwin III , Jens Axboe , Badari Pulavarty , Maxim Levitsky , Fengguang Wu , swin wang , totty.lu@gmail.com, hugh@veritas.com, joern@lazybastard.org To: Christoph Lameter Return-path: Received: from relay1.sgi.com ([192.48.171.29]:42147 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756264AbXK2EAY (ORCPT ); Wed, 28 Nov 2007 23:00:24 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Wed, Nov 28, 2007 at 07:30:54PM -0800, Christoph Lameter wrote: > On Thu, 29 Nov 2007, David Chinner wrote: > > > > unsigned int mapcount; > > > struct address_space *mapping = page->mapping; > > > - pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); > > > + pgoff_t pgoff = page->index << (page_cache_shift(mapping) - PAGE_SHIFT); > > > > Based on the first hunk, shouldn't this be: > > > > pgoff_t pgoff = page->index << mapping_order(mapping); > > Yes that is much simpler > > > rmap: simplify page_referenced_file use of page cache inlines > > Signed-off-by: Christoph Lameter > > --- > mm/rmap.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Index: mm/mm/rmap.c > =================================================================== > --- mm.orig/mm/rmap.c 2007-11-28 19:28:45.689883608 -0800 > +++ mm/mm/rmap.c 2007-11-28 19:29:35.090382690 -0800 > @@ -350,7 +350,7 @@ static int page_referenced_file(struct p > { > unsigned int mapcount; > struct address_space *mapping = page->mapping; > - pgoff_t pgoff = page->index << (page_cache_shift(mapping) - PAGE_SHIFT); > + pgoff_t pgoff = page->index << mapping_order(mapping); > struct vm_area_struct *vma; > struct prio_tree_iter iter; > int referenced = 0; And the other two occurrences of this in the first patch? Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group