Re: [PATCH 03/10] readahead: combine file_ra_state.prev_index/prev_offset into prev_pos

2007-07-24 Thread Fengguang Wu
On Mon, Jul 23, 2007 at 09:53:10PM -0700, Andrew Morton wrote: > On Tue, 24 Jul 2007 12:32:15 +0800 Fengguang Wu <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> wrote: > > >

Re: [PATCH 03/10] readahead: combine file_ra_state.prev_index/prev_offset into prev_pos

2007-07-24 Thread Fengguang Wu
On Mon, Jul 23, 2007 at 09:53:10PM -0700, Andrew Morton wrote: On Tue, 24 Jul 2007 12:32:15 +0800 Fengguang Wu [EMAIL PROTECTED] 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 [EMAIL PROTECTED] wrote: @@ -342,11

Re: [PATCH 03/10] readahead: combine file_ra_state.prev_index/prev_offset into prev_pos

2007-07-23 Thread Andrew Morton
On Tue, 24 Jul 2007 12:32:15 +0800 Fengguang Wu <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> wrote: > > > > > @@ -342,11 +342,9 @@ ondemand_readahead(struct address_space > > >

Re: [PATCH 03/10] readahead: combine file_ra_state.prev_index/prev_offset into prev_pos

2007-07-23 Thread Fengguang Wu
On Tue, Jul 24, 2007 at 12:32:15PM +0800, Fengguang Wu 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 <[EMAIL PROTECTED]> wrote: > > > > > @@ -342,11 +342,9 @@ ondemand_readahead(struct address_space > > >

Re: [PATCH 03/10] readahead: combine file_ra_state.prev_index/prev_offset into prev_pos

2007-07-23 Thread Fengguang Wu
On Mon, Jul 23, 2007 at 08:55:35PM -0700, Andrew Morton wrote: > On Tue, 24 Jul 2007 10:00:12 +0800 Fengguang Wu <[EMAIL PROTECTED]> wrote: > > > @@ -342,11 +342,9 @@ ondemand_readahead(struct address_space > >bool hit_readahead_marker, pgoff_t offset, > >unsigned

Re: [PATCH 03/10] readahead: combine file_ra_state.prev_index/prev_offset into prev_pos

2007-07-23 Thread Fengguang Wu
On Mon, Jul 23, 2007 at 08:52:41PM -0700, Andrew Morton wrote: > On Tue, 24 Jul 2007 10:00:12 +0800 Fengguang Wu <[EMAIL PROTECTED]> wrote: > > > - ra->prev_index = page->index; > > + ra->prev_pos = page->index << PAGE_CACHE_SHIFT; > > bug! The rhs will get truncated befire it gets assigned

Re: [PATCH 03/10] readahead: combine file_ra_state.prev_index/prev_offset into prev_pos

2007-07-23 Thread Andrew Morton
On Tue, 24 Jul 2007 10:00:12 +0800 Fengguang Wu <[EMAIL PROTECTED]> 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

Re: [PATCH 03/10] readahead: combine file_ra_state.prev_index/prev_offset into prev_pos

2007-07-23 Thread Andrew Morton
On Tue, 24 Jul 2007 10:00:12 +0800 Fengguang Wu <[EMAIL PROTECTED]> wrote: > - ra->prev_index = page->index; > + ra->prev_pos = page->index << PAGE_CACHE_SHIFT; bug! The rhs will get truncated befire it gets assigned to the lhs. Need to cast page->index to loff_t. I'll fix this one

[PATCH 03/10] readahead: combine file_ra_state.prev_index/prev_offset into prev_pos

2007-07-23 Thread Fengguang Wu
Combine the file_ra_state members unsigned long prev_index unsigned int prev_offset into loff_t prev_pos It is more consistent and better supports huge files. Thanks to Peter for the nice proposal!

[PATCH 03/10] readahead: combine file_ra_state.prev_index/prev_offset into prev_pos

2007-07-23 Thread Fengguang Wu
Combine the file_ra_state members unsigned long prev_index unsigned int prev_offset into loff_t prev_pos It is more consistent and better supports huge files. Thanks to Peter for the nice proposal!

Re: [PATCH 03/10] readahead: combine file_ra_state.prev_index/prev_offset into prev_pos

2007-07-23 Thread Andrew Morton
On Tue, 24 Jul 2007 10:00:12 +0800 Fengguang Wu [EMAIL PROTECTED] wrote: - ra-prev_index = page-index; + ra-prev_pos = page-index PAGE_CACHE_SHIFT; bug! The rhs will get truncated befire it gets assigned to the lhs. Need to cast page-index to loff_t. I'll fix this one up. Please

Re: [PATCH 03/10] readahead: combine file_ra_state.prev_index/prev_offset into prev_pos

2007-07-23 Thread Andrew Morton
On Tue, 24 Jul 2007 10:00:12 +0800 Fengguang Wu [EMAIL PROTECTED] 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 */ -

Re: [PATCH 03/10] readahead: combine file_ra_state.prev_index/prev_offset into prev_pos

2007-07-23 Thread Fengguang Wu
On Mon, Jul 23, 2007 at 08:52:41PM -0700, Andrew Morton wrote: On Tue, 24 Jul 2007 10:00:12 +0800 Fengguang Wu [EMAIL PROTECTED] wrote: - ra-prev_index = page-index; + ra-prev_pos = page-index PAGE_CACHE_SHIFT; bug! The rhs will get truncated befire it gets assigned to the lhs.

Re: [PATCH 03/10] readahead: combine file_ra_state.prev_index/prev_offset into prev_pos

2007-07-23 Thread Fengguang Wu
On Mon, Jul 23, 2007 at 08:55:35PM -0700, Andrew Morton wrote: On Tue, 24 Jul 2007 10:00:12 +0800 Fengguang Wu [EMAIL PROTECTED] wrote: @@ -342,11 +342,9 @@ ondemand_readahead(struct address_space bool hit_readahead_marker, pgoff_t offset, unsigned long

Re: [PATCH 03/10] readahead: combine file_ra_state.prev_index/prev_offset into prev_pos

2007-07-23 Thread Fengguang Wu
On Tue, Jul 24, 2007 at 12:32:15PM +0800, Fengguang Wu 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 [EMAIL PROTECTED] wrote: @@ -342,11 +342,9 @@ ondemand_readahead(struct address_space bool

Re: [PATCH 03/10] readahead: combine file_ra_state.prev_index/prev_offset into prev_pos

2007-07-23 Thread Andrew Morton
On Tue, 24 Jul 2007 12:32:15 +0800 Fengguang Wu [EMAIL PROTECTED] 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 [EMAIL PROTECTED] wrote: @@ -342,11 +342,9 @@ ondemand_readahead(struct address_space