lkml.org 
[lkml]   [2004]   [Aug]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: remove dentry_open::file_ra_init_state() duplicated memset was Re: kernbench on 512p
Marcelo Tosatti <marcelo.tosatti@cyclades.com> wrote:
>
> On Thu, Aug 19, 2004 at 11:21:45PM -0700, Andrew Morton wrote:
> > Marcelo Tosatti <marcelo.tosatti@cyclades.com> wrote:
> > >
> > > So this patch creates a __file_ra_state_init() function, which initializes
> > > the file_ra_state fields, without the memset.
> > >
> > > file_ra_state_init() does the memset + its __ counterpart.
> >
> > Seems unnecessarily fiddly. How about this?
>
> Thats cleaner yep. :)

It got even cleaner - Neil has just nuked the NFS callsite.


--- 25/mm/readahead.c~file_ra_state_init-speedup 2004-08-20 00:03:19.979397128 -0700
+++ 25-akpm/mm/readahead.c 2004-08-20 00:04:25.159488248 -0700
@@ -28,16 +28,15 @@ struct backing_dev_info default_backing_
EXPORT_SYMBOL_GPL(default_backing_dev_info);

/*
- * Initialise a struct file's readahead state
+ * Initialise a struct file's readahead state. Assumes that the caller has
+ * memset *ra to zero.
*/
void
file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping)
{
- memset(ra, 0, sizeof(*ra));
ra->ra_pages = mapping->backing_dev_info->ra_pages;
ra->average = ra->ra_pages / 2;
}
-EXPORT_SYMBOL(file_ra_state_init);

/*
* Return max readahead size for this inode in number-of-pages.
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:05    [W:0.470 / U:0.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site