aboutsummaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/filemap.c6
-rw-r--r--mm/readahead.c1
2 files changed, 5 insertions, 2 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index f789500406f..3464b681f84 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1198,8 +1198,10 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
if (retval > 0)
*ppos = pos + retval;
}
- file_accessed(filp);
- goto out;
+ if (likely(retval != 0)) {
+ file_accessed(filp);
+ goto out;
+ }
}
retval = 0;
diff --git a/mm/readahead.c b/mm/readahead.c
index aa7ec424656..1ba736ac036 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -38,6 +38,7 @@ file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping)
ra->ra_pages = mapping->backing_dev_info->ra_pages;
ra->prev_page = -1;
}
+EXPORT_SYMBOL_GPL(file_ra_state_init);
/*
* Return max readahead size for this inode in number-of-pages.