aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/filemap.c8
-rw-r--r--mm/slab.c6
2 files changed, 13 insertions, 1 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 1d33fec7bac6..4a2fee2cb62b 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1968,6 +1968,7 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov,
1968 do { 1968 do {
1969 unsigned long index; 1969 unsigned long index;
1970 unsigned long offset; 1970 unsigned long offset;
1971 unsigned long maxlen;
1971 size_t copied; 1972 size_t copied;
1972 1973
1973 offset = (pos & (PAGE_CACHE_SIZE -1)); /* Within page */ 1974 offset = (pos & (PAGE_CACHE_SIZE -1)); /* Within page */
@@ -1982,7 +1983,10 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov,
1982 * same page as we're writing to, without it being marked 1983 * same page as we're writing to, without it being marked
1983 * up-to-date. 1984 * up-to-date.
1984 */ 1985 */
1985 fault_in_pages_readable(buf, bytes); 1986 maxlen = cur_iov->iov_len - iov_base;
1987 if (maxlen > bytes)
1988 maxlen = bytes;
1989 fault_in_pages_readable(buf, maxlen);
1986 1990
1987 page = __grab_cache_page(mapping,index,&cached_page,&lru_pvec); 1991 page = __grab_cache_page(mapping,index,&cached_page,&lru_pvec);
1988 if (!page) { 1992 if (!page) {
@@ -2024,6 +2028,8 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov,
2024 filemap_set_next_iovec(&cur_iov, 2028 filemap_set_next_iovec(&cur_iov,
2025 &iov_base, status); 2029 &iov_base, status);
2026 buf = cur_iov->iov_base + iov_base; 2030 buf = cur_iov->iov_base + iov_base;
2031 } else {
2032 iov_base += status;
2027 } 2033 }
2028 } 2034 }
2029 } 2035 }
diff --git a/mm/slab.c b/mm/slab.c
index 840742641152..c78d343b3c5f 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2620,6 +2620,12 @@ unsigned int kmem_cache_size(kmem_cache_t *cachep)
2620} 2620}
2621EXPORT_SYMBOL(kmem_cache_size); 2621EXPORT_SYMBOL(kmem_cache_size);
2622 2622
2623const char *kmem_cache_name(kmem_cache_t *cachep)
2624{
2625 return cachep->name;
2626}
2627EXPORT_SYMBOL_GPL(kmem_cache_name);
2628
2623struct ccupdate_struct { 2629struct ccupdate_struct {
2624 kmem_cache_t *cachep; 2630 kmem_cache_t *cachep;
2625 struct array_cache *new[NR_CPUS]; 2631 struct array_cache *new[NR_CPUS];