Commit 467474d0 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] file_ra_state_init speedup

Marcelo points out that this function's main caller already memsets the
structure, so avoid doing it again.

Also, an earlier knfsd patch withdrew file_ra_state_init()'s other caller, so
unexport this function.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 484107a5
...@@ -28,16 +28,15 @@ struct backing_dev_info default_backing_dev_info = { ...@@ -28,16 +28,15 @@ struct backing_dev_info default_backing_dev_info = {
EXPORT_SYMBOL_GPL(default_backing_dev_info); 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 void
file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping) 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->ra_pages = mapping->backing_dev_info->ra_pages;
ra->average = ra->ra_pages / 2; ra->average = ra->ra_pages / 2;
} }
EXPORT_SYMBOL(file_ra_state_init);
/* /*
* Return max readahead size for this inode in number-of-pages. * Return max readahead size for this inode in number-of-pages.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment