lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070723215310.0a032635.akpm@linux-foundation.org>
Date:	Mon, 23 Jul 2007 21:53:10 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Fengguang Wu <wfg@...l.ustc.edu.cn>
Cc:	linux-kernel@...r.kernel.org, Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 03/10] readahead: combine
 file_ra_state.prev_index/prev_offset into prev_pos

On Tue, 24 Jul 2007 12:32:15 +0800 Fengguang Wu <wfg@...l.ustc.edu.cn> wrote:

> On Mon, Jul 23, 2007 at 08:55:35PM -0700, Andrew Morton wrote:
> > On Tue, 24 Jul 2007 10:00:12 +0800 Fengguang Wu <wfg@...l.ustc.edu.cn> wrote:
> > 
> > > @@ -342,11 +342,9 @@ ondemand_readahead(struct address_space 
> > >  		   bool hit_readahead_marker, pgoff_t offset,
> > >  		   unsigned long req_size)
> > >  {
> > > -	int max;	/* max readahead pages */
> > > -	int sequential;
> > > -
> > > -	max = ra->ra_pages;
> > > -	sequential = (offset - ra->prev_index <= 1UL) || (req_size > max);
> > > +	int	max = ra->ra_pages;	/* max readahead pages */
> > > +	pgoff_t prev_offset;
> > > +	int	sequential;
> > >  
> > >  	/*
> > >  	 * It's the expected callback offset, assume sequential access.
> > > @@ -360,6 +358,9 @@ ondemand_readahead(struct address_space 
> > >  		goto readit;
> > >  	}
> > >  
> > > +	prev_offset = ra->prev_pos >> PAGE_CACHE_SHIFT;
> > > +	sequential = offset - prev_offset <= 1UL || req_size > max;
> > 
> > It's a bit pointless using an opaque type for prev_offset here, and then
> > encoding the knowledge that it is implemented as "unsigned long".
> > 
> > It's a minor thing, but perhaps just "<= 1" would make more sense here.
> 
> Yeah, "<= 1" is OK.  But the expression still requires pgoff_t to be
> 'unsigned' to work correctly.
> 
> So what about "<= 1U"?

umm, if one really cared one could do

	<expr> == 1 || <expr> == 0

or something.  But whatever - let's leave it as-is.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ