aboutsummaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2012-12-17 18:59:39 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-17 20:15:12 -0500
commit965c8e59cfcf845ecde2265a1d1bfee5f011d302 (patch)
tree22758a99b4ecb475750966d5202200dc0e89876c /mm/shmem.c
parentc0f041602c33bae10b8e321c49024490d03ced3d (diff)
lseek: the "whence" argument is called "whence"
But the kernel decided to call it "origin" instead. Fix most of the sites. Acked-by: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c20
1 files changed, 10 insertions, 10 deletions
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;