aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-17 23:58:12 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-17 23:58:12 -0500
commit848b81415c42ff3dc9a4204749087b015c37ef66 (patch)
tree391da3a73aea48632248220d2d6b8d45a88f7eae /mm
parent992956189de58cae9f2be40585bc25105cd7c5ad (diff)
parent6fd59a83b9261fa53eaf98fb5514abba504a3ea3 (diff)
Merge branch 'akpm' (Andrew's patch-bomb)
Merge misc patches from Andrew Morton: "Incoming: - lots of misc stuff - backlight tree updates - lib/ updates - Oleg's percpu-rwsem changes - checkpatch - rtc - aoe - more checkpoint/restart support I still have a pile of MM stuff pending - Pekka should be merging later today after which that is good to go. A number of other things are twiddling thumbs awaiting maintainer merges." * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (180 commits) scatterlist: don't BUG when we can trivially return a proper error. docs: update documentation about /proc/<pid>/fdinfo/<fd> fanotify output fs, fanotify: add @mflags field to fanotify output docs: add documentation about /proc/<pid>/fdinfo/<fd> output fs, notify: add procfs fdinfo helper fs, exportfs: add exportfs_encode_inode_fh() helper fs, exportfs: escape nil dereference if no s_export_op present fs, epoll: add procfs fdinfo helper fs, eventfd: add procfs fdinfo helper procfs: add ability to plug in auxiliary fdinfo providers tools/testing/selftests/kcmp/kcmp_test.c: print reason for failure in kcmp_test breakpoint selftests: print failure status instead of cause make error kcmp selftests: print fail status instead of cause make error kcmp selftests: make run_tests fix mem-hotplug selftests: print failure status instead of cause make error cpu-hotplug selftests: print failure status instead of cause make error mqueue selftests: print failure status instead of cause make error vm selftests: print failure status instead of cause make error ubifs: use prandom_bytes mtd: nandsim: use prandom_bytes ...
Diffstat (limited to 'mm')
-rw-r--r--mm/memory.c9
-rw-r--r--mm/shmem.c20
2 files changed, 14 insertions, 15 deletions
diff --git a/mm/memory.c b/mm/memory.c
index e6a3b933517e..e0a9b0ce4f10 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -58,6 +58,7 @@
58#include <linux/elf.h> 58#include <linux/elf.h>
59#include <linux/gfp.h> 59#include <linux/gfp.h>
60#include <linux/migrate.h> 60#include <linux/migrate.h>
61#include <linux/string.h>
61 62
62#include <asm/io.h> 63#include <asm/io.h>
63#include <asm/pgalloc.h> 64#include <asm/pgalloc.h>
@@ -3590,6 +3591,7 @@ static int do_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
3590 unsigned long addr, pmd_t *pmdp) 3591 unsigned long addr, pmd_t *pmdp)
3591{ 3592{
3592 BUG(); 3593 BUG();
3594 return 0;
3593} 3595}
3594#endif /* CONFIG_NUMA_BALANCING */ 3596#endif /* CONFIG_NUMA_BALANCING */
3595 3597
@@ -4117,15 +4119,12 @@ void print_vma_addr(char *prefix, unsigned long ip)
4117 struct file *f = vma->vm_file; 4119 struct file *f = vma->vm_file;
4118 char *buf = (char *)__get_free_page(GFP_KERNEL); 4120 char *buf = (char *)__get_free_page(GFP_KERNEL);
4119 if (buf) { 4121 if (buf) {
4120 char *p, *s; 4122 char *p;
4121 4123
4122 p = d_path(&f->f_path, buf, PAGE_SIZE); 4124 p = d_path(&f->f_path, buf, PAGE_SIZE);
4123 if (IS_ERR(p)) 4125 if (IS_ERR(p))
4124 p = "?"; 4126 p = "?";
4125 s = strrchr(p, '/'); 4127 printk("%s%s[%lx+%lx]", prefix, kbasename(p),
4126 if (s)
4127 p = s+1;
4128 printk("%s%s[%lx+%lx]", prefix, p,
4129 vma->vm_start, 4128 vma->vm_start,
4130 vma->vm_end - vma->vm_start); 4129 vma->vm_end - vma->vm_start);
4131 free_page((unsigned long)buf); 4130 free_page((unsigned long)buf);
diff --git a/mm/shmem.c b/mm/shmem.c
index 03f9ba8fb8e5..5c90d84c2b02 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1719,7 +1719,7 @@ static ssize_t shmem_file_splice_read(struct file *in, loff_t *ppos,
1719 * llseek SEEK_DATA or SEEK_HOLE through the radix_tree. 1719 * llseek SEEK_DATA or SEEK_HOLE through the radix_tree.
1720 */ 1720 */
1721static pgoff_t shmem_seek_hole_data(struct address_space *mapping, 1721static pgoff_t shmem_seek_hole_data(struct address_space *mapping,
1722 pgoff_t index, pgoff_t end, int origin) 1722 pgoff_t index, pgoff_t end, int whence)
1723{ 1723{
1724 struct page *page; 1724 struct page *page;
1725 struct pagevec pvec; 1725 struct pagevec pvec;
@@ -1733,13 +1733,13 @@ static pgoff_t shmem_seek_hole_data(struct address_space *mapping,
1733 pvec.nr = shmem_find_get_pages_and_swap(mapping, index, 1733 pvec.nr = shmem_find_get_pages_and_swap(mapping, index,
1734 pvec.nr, pvec.pages, indices); 1734 pvec.nr, pvec.pages, indices);
1735 if (!pvec.nr) { 1735 if (!pvec.nr) {
1736 if (origin == SEEK_DATA) 1736 if (whence == SEEK_DATA)
1737 index = end; 1737 index = end;
1738 break; 1738 break;
1739 } 1739 }
1740 for (i = 0; i < pvec.nr; i++, index++) { 1740 for (i = 0; i < pvec.nr; i++, index++) {
1741 if (index < indices[i]) { 1741 if (index < indices[i]) {
1742 if (origin == SEEK_HOLE) { 1742 if (whence == SEEK_HOLE) {
1743 done = true; 1743 done = true;
1744 break; 1744 break;
1745 } 1745 }
@@ -1751,8 +1751,8 @@ static pgoff_t shmem_seek_hole_data(struct address_space *mapping,
1751 page = NULL; 1751 page = NULL;
1752 } 1752 }
1753 if (index >= end || 1753 if (index >= end ||
1754 (page && origin == SEEK_DATA) || 1754 (page && whence == SEEK_DATA) ||
1755 (!page && origin == SEEK_HOLE)) { 1755 (!page && whence == SEEK_HOLE)) {
1756 done = true; 1756 done = true;
1757 break; 1757 break;
1758 } 1758 }
@@ -1765,15 +1765,15 @@ static pgoff_t shmem_seek_hole_data(struct address_space *mapping,
1765 return index; 1765 return index;
1766} 1766}
1767 1767
1768static loff_t shmem_file_llseek(struct file *file, loff_t offset, int origin) 1768static loff_t shmem_file_llseek(struct file *file, loff_t offset, int whence)
1769{ 1769{
1770 struct address_space *mapping = file->f_mapping; 1770 struct address_space *mapping = file->f_mapping;
1771 struct inode *inode = mapping->host; 1771 struct inode *inode = mapping->host;
1772 pgoff_t start, end; 1772 pgoff_t start, end;
1773 loff_t new_offset; 1773 loff_t new_offset;
1774 1774
1775 if (origin != SEEK_DATA && origin != SEEK_HOLE) 1775 if (whence != SEEK_DATA && whence != SEEK_HOLE)
1776 return generic_file_llseek_size(file, offset, origin, 1776 return generic_file_llseek_size(file, offset, whence,
1777 MAX_LFS_FILESIZE, i_size_read(inode)); 1777 MAX_LFS_FILESIZE, i_size_read(inode));
1778 mutex_lock(&inode->i_mutex); 1778 mutex_lock(&inode->i_mutex);
1779 /* We're holding i_mutex so we can access i_size directly */ 1779 /* We're holding i_mutex so we can access i_size directly */
@@ -1785,12 +1785,12 @@ static loff_t shmem_file_llseek(struct file *file, loff_t offset, int origin)
1785 else { 1785 else {
1786 start = offset >> PAGE_CACHE_SHIFT; 1786 start = offset >> PAGE_CACHE_SHIFT;
1787 end = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; 1787 end = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
1788 new_offset = shmem_seek_hole_data(mapping, start, end, origin); 1788 new_offset = shmem_seek_hole_data(mapping, start, end, whence);
1789 new_offset <<= PAGE_CACHE_SHIFT; 1789 new_offset <<= PAGE_CACHE_SHIFT;
1790 if (new_offset > offset) { 1790 if (new_offset > offset) {
1791 if (new_offset < inode->i_size) 1791 if (new_offset < inode->i_size)
1792 offset = new_offset; 1792 offset = new_offset;
1793 else if (origin == SEEK_DATA) 1793 else if (whence == SEEK_DATA)
1794 offset = -ENXIO; 1794 offset = -ENXIO;
1795 else 1795 else
1796 offset = inode->i_size; 1796 offset = inode->i_size;