aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--fs/bad_inode.c2
-rw-r--r--fs/block_dev.c4
-rw-r--r--fs/btrfs/file.c16
-rw-r--r--fs/ceph/dir.c4
-rw-r--r--fs/ceph/file.c6
-rw-r--r--fs/cifs/cifsfs.c8
-rw-r--r--fs/configfs/dir.c4
-rw-r--r--fs/ext3/dir.c6
-rw-r--r--fs/ext4/dir.c6
-rw-r--r--fs/ext4/file.c22
-rw-r--r--fs/fuse/file.c8
-rw-r--r--fs/gfs2/file.c10
-rw-r--r--fs/libfs.c4
-rw-r--r--fs/nfs/dir.c6
-rw-r--r--fs/nfs/file.c10
-rw-r--r--fs/ocfs2/extent_map.c12
-rw-r--r--fs/ocfs2/file.c6
-rw-r--r--fs/pstore/inode.c6
-rw-r--r--fs/read_write.c40
-rw-r--r--fs/seq_file.c4
-rw-r--r--fs/ubifs/dir.c4
-rw-r--r--include/linux/fs.h12
-rw-r--r--include/linux/ftrace.h4
-rw-r--r--include/linux/syscalls.h4
-rw-r--r--kernel/trace/ftrace.c4
-rw-r--r--mm/shmem.c20
26 files changed, 116 insertions, 116 deletions
diff --git a/fs/bad_inode.c b/fs/bad_inode.c
index b1342ffb3cf6..922ad460bff9 100644
--- a/fs/bad_inode.c
+++ b/fs/bad_inode.c
@@ -16,7 +16,7 @@
16#include <linux/poll.h> 16#include <linux/poll.h>
17 17
18 18
19static loff_t bad_file_llseek(struct file *file, loff_t offset, int origin) 19static loff_t bad_file_llseek(struct file *file, loff_t offset, int whence)
20{ 20{
21 return -EIO; 21 return -EIO;
22} 22}
diff --git a/fs/block_dev.c b/fs/block_dev.c
index ab3a456f6650..172f8491a2bd 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -321,7 +321,7 @@ static int blkdev_write_end(struct file *file, struct address_space *mapping,
321 * for a block special file file->f_path.dentry->d_inode->i_size is zero 321 * for a block special file file->f_path.dentry->d_inode->i_size is zero
322 * so we compute the size by hand (just as in block_read/write above) 322 * so we compute the size by hand (just as in block_read/write above)
323 */ 323 */
324static loff_t block_llseek(struct file *file, loff_t offset, int origin) 324static loff_t block_llseek(struct file *file, loff_t offset, int whence)
325{ 325{
326 struct inode *bd_inode = file->f_mapping->host; 326 struct inode *bd_inode = file->f_mapping->host;
327 loff_t size; 327 loff_t size;
@@ -331,7 +331,7 @@ static loff_t block_llseek(struct file *file, loff_t offset, int origin)
331 size = i_size_read(bd_inode); 331 size = i_size_read(bd_inode);
332 332
333 retval = -EINVAL; 333 retval = -EINVAL;
334 switch (origin) { 334 switch (whence) {
335 case SEEK_END: 335 case SEEK_END:
336 offset += size; 336 offset += size;
337 break; 337 break;
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index a8ee75cb96ee..9c6673a9231f 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -2120,7 +2120,7 @@ out:
2120 return ret; 2120 return ret;
2121} 2121}
2122 2122
2123static int find_desired_extent(struct inode *inode, loff_t *offset, int origin) 2123static int find_desired_extent(struct inode *inode, loff_t *offset, int whence)
2124{ 2124{
2125 struct btrfs_root *root = BTRFS_I(inode)->root; 2125 struct btrfs_root *root = BTRFS_I(inode)->root;
2126 struct extent_map *em; 2126 struct extent_map *em;
@@ -2154,7 +2154,7 @@ static int find_desired_extent(struct inode *inode, loff_t *offset, int origin)
2154 * before the position we want in case there is outstanding delalloc 2154 * before the position we want in case there is outstanding delalloc
2155 * going on here. 2155 * going on here.
2156 */ 2156 */
2157 if (origin == SEEK_HOLE && start != 0) { 2157 if (whence == SEEK_HOLE && start != 0) {
2158 if (start <= root->sectorsize) 2158 if (start <= root->sectorsize)
2159 em = btrfs_get_extent_fiemap(inode, NULL, 0, 0, 2159 em = btrfs_get_extent_fiemap(inode, NULL, 0, 0,
2160 root->sectorsize, 0); 2160 root->sectorsize, 0);
@@ -2188,13 +2188,13 @@ static int find_desired_extent(struct inode *inode, loff_t *offset, int origin)
2188 } 2188 }
2189 } 2189 }
2190 2190
2191 if (origin == SEEK_HOLE) { 2191 if (whence == SEEK_HOLE) {
2192 *offset = start; 2192 *offset = start;
2193 free_extent_map(em); 2193 free_extent_map(em);
2194 break; 2194 break;
2195 } 2195 }
2196 } else { 2196 } else {
2197 if (origin == SEEK_DATA) { 2197 if (whence == SEEK_DATA) {
2198 if (em->block_start == EXTENT_MAP_DELALLOC) { 2198 if (em->block_start == EXTENT_MAP_DELALLOC) {
2199 if (start >= inode->i_size) { 2199 if (start >= inode->i_size) {
2200 free_extent_map(em); 2200 free_extent_map(em);
@@ -2231,16 +2231,16 @@ out:
2231 return ret; 2231 return ret;
2232} 2232}
2233 2233
2234static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int origin) 2234static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int whence)
2235{ 2235{
2236 struct inode *inode = file->f_mapping->host; 2236 struct inode *inode = file->f_mapping->host;
2237 int ret; 2237 int ret;
2238 2238
2239 mutex_lock(&inode->i_mutex); 2239 mutex_lock(&inode->i_mutex);
2240 switch (origin) { 2240 switch (whence) {
2241 case SEEK_END: 2241 case SEEK_END:
2242 case SEEK_CUR: 2242 case SEEK_CUR:
2243 offset = generic_file_llseek(file, offset, origin); 2243 offset = generic_file_llseek(file, offset, whence);
2244 goto out; 2244 goto out;
2245 case SEEK_DATA: 2245 case SEEK_DATA:
2246 case SEEK_HOLE: 2246 case SEEK_HOLE:
@@ -2249,7 +2249,7 @@ static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int origin)
2249 return -ENXIO; 2249 return -ENXIO;
2250 } 2250 }
2251 2251
2252 ret = find_desired_extent(inode, &offset, origin); 2252 ret = find_desired_extent(inode, &offset, whence);
2253 if (ret) { 2253 if (ret) {
2254 mutex_unlock(&inode->i_mutex); 2254 mutex_unlock(&inode->i_mutex);
2255 return ret; 2255 return ret;
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index e5b77319c97b..8c1aabe93b67 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -454,7 +454,7 @@ static void reset_readdir(struct ceph_file_info *fi)
454 fi->flags &= ~CEPH_F_ATEND; 454 fi->flags &= ~CEPH_F_ATEND;
455} 455}
456 456
457static loff_t ceph_dir_llseek(struct file *file, loff_t offset, int origin) 457static loff_t ceph_dir_llseek(struct file *file, loff_t offset, int whence)
458{ 458{
459 struct ceph_file_info *fi = file->private_data; 459 struct ceph_file_info *fi = file->private_data;
460 struct inode *inode = file->f_mapping->host; 460 struct inode *inode = file->f_mapping->host;
@@ -463,7 +463,7 @@ static loff_t ceph_dir_llseek(struct file *file, loff_t offset, int origin)
463 463
464 mutex_lock(&inode->i_mutex); 464 mutex_lock(&inode->i_mutex);
465 retval = -EINVAL; 465 retval = -EINVAL;
466 switch (origin) { 466 switch (whence) {
467 case SEEK_END: 467 case SEEK_END:
468 offset += inode->i_size + 2; /* FIXME */ 468 offset += inode->i_size + 2; /* FIXME */
469 break; 469 break;
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 5840d2aaed15..d4dfdcf76d7f 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -797,7 +797,7 @@ out:
797/* 797/*
798 * llseek. be sure to verify file size on SEEK_END. 798 * llseek. be sure to verify file size on SEEK_END.
799 */ 799 */
800static loff_t ceph_llseek(struct file *file, loff_t offset, int origin) 800static loff_t ceph_llseek(struct file *file, loff_t offset, int whence)
801{ 801{
802 struct inode *inode = file->f_mapping->host; 802 struct inode *inode = file->f_mapping->host;
803 int ret; 803 int ret;
@@ -805,7 +805,7 @@ static loff_t ceph_llseek(struct file *file, loff_t offset, int origin)
805 mutex_lock(&inode->i_mutex); 805 mutex_lock(&inode->i_mutex);
806 __ceph_do_pending_vmtruncate(inode); 806 __ceph_do_pending_vmtruncate(inode);
807 807
808 if (origin == SEEK_END || origin == SEEK_DATA || origin == SEEK_HOLE) { 808 if (whence == SEEK_END || whence == SEEK_DATA || whence == SEEK_HOLE) {
809 ret = ceph_do_getattr(inode, CEPH_STAT_CAP_SIZE); 809 ret = ceph_do_getattr(inode, CEPH_STAT_CAP_SIZE);
810 if (ret < 0) { 810 if (ret < 0) {
811 offset = ret; 811 offset = ret;
@@ -813,7 +813,7 @@ static loff_t ceph_llseek(struct file *file, loff_t offset, int origin)
813 } 813 }
814 } 814 }
815 815
816 switch (origin) { 816 switch (whence) {
817 case SEEK_END: 817 case SEEK_END:
818 offset += inode->i_size; 818 offset += inode->i_size;
819 break; 819 break;
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 210f0af83fc4..ce9f3c5421bf 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -695,13 +695,13 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
695 return written; 695 return written;
696} 696}
697 697
698static loff_t cifs_llseek(struct file *file, loff_t offset, int origin) 698static loff_t cifs_llseek(struct file *file, loff_t offset, int whence)
699{ 699{
700 /* 700 /*
701 * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate 701 * whence == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate
702 * the cached file length 702 * the cached file length
703 */ 703 */
704 if (origin != SEEK_SET && origin != SEEK_CUR) { 704 if (whence != SEEK_SET && whence != SEEK_CUR) {
705 int rc; 705 int rc;
706 struct inode *inode = file->f_path.dentry->d_inode; 706 struct inode *inode = file->f_path.dentry->d_inode;
707 707
@@ -728,7 +728,7 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int origin)
728 if (rc < 0) 728 if (rc < 0)
729 return (loff_t)rc; 729 return (loff_t)rc;
730 } 730 }
731 return generic_file_llseek(file, offset, origin); 731 return generic_file_llseek(file, offset, whence);
732} 732}
733 733
734static int cifs_setlease(struct file *file, long arg, struct file_lock **lease) 734static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
index 7414ae24a79b..712b10f64c70 100644
--- a/fs/configfs/dir.c
+++ b/fs/configfs/dir.c
@@ -1613,12 +1613,12 @@ static int configfs_readdir(struct file * filp, void * dirent, filldir_t filldir
1613 return 0; 1613 return 0;
1614} 1614}
1615 1615
1616static loff_t configfs_dir_lseek(struct file * file, loff_t offset, int origin) 1616static loff_t configfs_dir_lseek(struct file *file, loff_t offset, int whence)
1617{ 1617{
1618 struct dentry * dentry = file->f_path.dentry; 1618 struct dentry * dentry = file->f_path.dentry;
1619 1619
1620 mutex_lock(&dentry->d_inode->i_mutex); 1620 mutex_lock(&dentry->d_inode->i_mutex);
1621 switch (origin) { 1621 switch (whence) {
1622 case 1: 1622 case 1:
1623 offset += file->f_pos; 1623 offset += file->f_pos;
1624 case 0: 1624 case 0:
diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c
index c8fff930790d..dd91264ba94f 100644
--- a/fs/ext3/dir.c
+++ b/fs/ext3/dir.c
@@ -296,17 +296,17 @@ static inline loff_t ext3_get_htree_eof(struct file *filp)
296 * NOTE: offsets obtained *before* ext3_set_inode_flag(dir, EXT3_INODE_INDEX) 296 * NOTE: offsets obtained *before* ext3_set_inode_flag(dir, EXT3_INODE_INDEX)
297 * will be invalid once the directory was converted into a dx directory 297 * will be invalid once the directory was converted into a dx directory
298 */ 298 */
299loff_t ext3_dir_llseek(struct file *file, loff_t offset, int origin) 299loff_t ext3_dir_llseek(struct file *file, loff_t offset, int whence)
300{ 300{
301 struct inode *inode = file->f_mapping->host; 301 struct inode *inode = file->f_mapping->host;
302 int dx_dir = is_dx_dir(inode); 302 int dx_dir = is_dx_dir(inode);
303 loff_t htree_max = ext3_get_htree_eof(file); 303 loff_t htree_max = ext3_get_htree_eof(file);
304 304
305 if (likely(dx_dir)) 305 if (likely(dx_dir))
306 return generic_file_llseek_size(file, offset, origin, 306 return generic_file_llseek_size(file, offset, whence,
307 htree_max, htree_max); 307 htree_max, htree_max);
308 else 308 else
309 return generic_file_llseek(file, offset, origin); 309 return generic_file_llseek(file, offset, whence);
310} 310}
311 311
312/* 312/*
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index b8d877f6c1fa..80a28b297279 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -333,17 +333,17 @@ static inline loff_t ext4_get_htree_eof(struct file *filp)
333 * 333 *
334 * For non-htree, ext4_llseek already chooses the proper max offset. 334 * For non-htree, ext4_llseek already chooses the proper max offset.
335 */ 335 */
336loff_t ext4_dir_llseek(struct file *file, loff_t offset, int origin) 336loff_t ext4_dir_llseek(struct file *file, loff_t offset, int whence)
337{ 337{
338 struct inode *inode = file->f_mapping->host; 338 struct inode *inode = file->f_mapping->host;
339 int dx_dir = is_dx_dir(inode); 339 int dx_dir = is_dx_dir(inode);
340 loff_t htree_max = ext4_get_htree_eof(file); 340 loff_t htree_max = ext4_get_htree_eof(file);
341 341
342 if (likely(dx_dir)) 342 if (likely(dx_dir))
343 return generic_file_llseek_size(file, offset, origin, 343 return generic_file_llseek_size(file, offset, whence,
344 htree_max, htree_max); 344 htree_max, htree_max);
345 else 345 else
346 return ext4_llseek(file, offset, origin); 346 return ext4_llseek(file, offset, whence);
347} 347}
348 348
349/* 349/*
diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index b64a60bf105a..d07c27ca594a 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -303,7 +303,7 @@ static int ext4_file_open(struct inode * inode, struct file * filp)
303 * page cache has data or not. 303 * page cache has data or not.
304 */ 304 */
305static int ext4_find_unwritten_pgoff(struct inode *inode, 305static int ext4_find_unwritten_pgoff(struct inode *inode,
306 int origin, 306 int whence,
307 struct ext4_map_blocks *map, 307 struct ext4_map_blocks *map,
308 loff_t *offset) 308 loff_t *offset)
309{ 309{
@@ -333,10 +333,10 @@ static int ext4_find_unwritten_pgoff(struct inode *inode,
333 nr_pages = pagevec_lookup(&pvec, inode->i_mapping, index, 333 nr_pages = pagevec_lookup(&pvec, inode->i_mapping, index,
334 (pgoff_t)num); 334 (pgoff_t)num);
335 if (nr_pages == 0) { 335 if (nr_pages == 0) {
336 if (origin == SEEK_DATA) 336 if (whence == SEEK_DATA)
337 break; 337 break;
338 338
339 BUG_ON(origin != SEEK_HOLE); 339 BUG_ON(whence != SEEK_HOLE);
340 /* 340 /*
341 * If this is the first time to go into the loop and 341 * If this is the first time to go into the loop and
342 * offset is not beyond the end offset, it will be a 342 * offset is not beyond the end offset, it will be a
@@ -352,7 +352,7 @@ static int ext4_find_unwritten_pgoff(struct inode *inode,
352 * offset is smaller than the first page offset, it will be a 352 * offset is smaller than the first page offset, it will be a
353 * hole at this offset. 353 * hole at this offset.
354 */ 354 */
355 if (lastoff == startoff && origin == SEEK_HOLE && 355 if (lastoff == startoff && whence == SEEK_HOLE &&
356 lastoff < page_offset(pvec.pages[0])) { 356 lastoff < page_offset(pvec.pages[0])) {
357 found = 1; 357 found = 1;
358 break; 358 break;
@@ -366,7 +366,7 @@ static int ext4_find_unwritten_pgoff(struct inode *inode,
366 * If the current offset is not beyond the end of given 366 * If the current offset is not beyond the end of given
367 * range, it will be a hole. 367 * range, it will be a hole.
368 */ 368 */
369 if (lastoff < endoff && origin == SEEK_HOLE && 369 if (lastoff < endoff && whence == SEEK_HOLE &&
370 page->index > end) { 370 page->index > end) {
371 found = 1; 371 found = 1;
372 *offset = lastoff; 372 *offset = lastoff;
@@ -391,10 +391,10 @@ static int ext4_find_unwritten_pgoff(struct inode *inode,
391 do { 391 do {
392 if (buffer_uptodate(bh) || 392 if (buffer_uptodate(bh) ||
393 buffer_unwritten(bh)) { 393 buffer_unwritten(bh)) {
394 if (origin == SEEK_DATA) 394 if (whence == SEEK_DATA)
395 found = 1; 395 found = 1;
396 } else { 396 } else {
397 if (origin == SEEK_HOLE) 397 if (whence == SEEK_HOLE)
398 found = 1; 398 found = 1;
399 } 399 }
400 if (found) { 400 if (found) {
@@ -416,7 +416,7 @@ static int ext4_find_unwritten_pgoff(struct inode *inode,
416 * The no. of pages is less than our desired, that would be a 416 * The no. of pages is less than our desired, that would be a
417 * hole in there. 417 * hole in there.
418 */ 418 */
419 if (nr_pages < num && origin == SEEK_HOLE) { 419 if (nr_pages < num && whence == SEEK_HOLE) {
420 found = 1; 420 found = 1;
421 *offset = lastoff; 421 *offset = lastoff;
422 break; 422 break;
@@ -609,7 +609,7 @@ static loff_t ext4_seek_hole(struct file *file, loff_t offset, loff_t maxsize)
609 * by calling generic_file_llseek_size() with the appropriate maxbytes 609 * by calling generic_file_llseek_size() with the appropriate maxbytes
610 * value for each. 610 * value for each.
611 */ 611 */
612loff_t ext4_llseek(struct file *file, loff_t offset, int origin) 612loff_t ext4_llseek(struct file *file, loff_t offset, int whence)
613{ 613{
614 struct inode *inode = file->f_mapping->host; 614 struct inode *inode = file->f_mapping->host;
615 loff_t maxbytes; 615 loff_t maxbytes;
@@ -619,11 +619,11 @@ loff_t ext4_llseek(struct file *file, loff_t offset, int origin)
619 else 619 else
620 maxbytes = inode->i_sb->s_maxbytes; 620 maxbytes = inode->i_sb->s_maxbytes;
621 621
622 switch (origin) { 622 switch (whence) {
623 case SEEK_SET: 623 case SEEK_SET:
624 case SEEK_CUR: 624 case SEEK_CUR:
625 case SEEK_END: 625 case SEEK_END:
626 return generic_file_llseek_size(file, offset, origin, 626 return generic_file_llseek_size(file, offset, whence,
627 maxbytes, i_size_read(inode)); 627 maxbytes, i_size_read(inode));
628 case SEEK_DATA: 628 case SEEK_DATA:
629 return ext4_seek_data(file, offset, maxbytes); 629 return ext4_seek_data(file, offset, maxbytes);
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 78d2837bc940..e21d4d8f87e3 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1599,19 +1599,19 @@ static sector_t fuse_bmap(struct address_space *mapping, sector_t block)
1599 return err ? 0 : outarg.block; 1599 return err ? 0 : outarg.block;
1600} 1600}
1601 1601
1602static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin) 1602static loff_t fuse_file_llseek(struct file *file, loff_t offset, int whence)
1603{ 1603{
1604 loff_t retval; 1604 loff_t retval;
1605 struct inode *inode = file->f_path.dentry->d_inode; 1605 struct inode *inode = file->f_path.dentry->d_inode;
1606 1606
1607 /* No i_mutex protection necessary for SEEK_CUR and SEEK_SET */ 1607 /* No i_mutex protection necessary for SEEK_CUR and SEEK_SET */
1608 if (origin == SEEK_CUR || origin == SEEK_SET) 1608 if (whence == SEEK_CUR || whence == SEEK_SET)
1609 return generic_file_llseek(file, offset, origin); 1609 return generic_file_llseek(file, offset, whence);
1610 1610
1611 mutex_lock(&inode->i_mutex); 1611 mutex_lock(&inode->i_mutex);
1612 retval = fuse_update_attributes(inode, NULL, file, NULL); 1612 retval = fuse_update_attributes(inode, NULL, file, NULL);
1613 if (!retval) 1613 if (!retval)
1614 retval = generic_file_llseek(file, offset, origin); 1614 retval = generic_file_llseek(file, offset, whence);
1615 mutex_unlock(&inode->i_mutex); 1615 mutex_unlock(&inode->i_mutex);
1616 1616
1617 return retval; 1617 return retval;
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index dfe2d8cb9b2c..991ab2d484dd 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -44,7 +44,7 @@
44 * gfs2_llseek - seek to a location in a file 44 * gfs2_llseek - seek to a location in a file
45 * @file: the file 45 * @file: the file
46 * @offset: the offset 46 * @offset: the offset
47 * @origin: Where to seek from (SEEK_SET, SEEK_CUR, or SEEK_END) 47 * @whence: Where to seek from (SEEK_SET, SEEK_CUR, or SEEK_END)
48 * 48 *
49 * SEEK_END requires the glock for the file because it references the 49 * SEEK_END requires the glock for the file because it references the
50 * file's size. 50 * file's size.
@@ -52,26 +52,26 @@
52 * Returns: The new offset, or errno 52 * Returns: The new offset, or errno
53 */ 53 */
54 54
55static loff_t gfs2_llseek(struct file *file, loff_t offset, int origin) 55static loff_t gfs2_llseek(struct file *file, loff_t offset, int whence)
56{ 56{
57 struct gfs2_inode *ip = GFS2_I(file->f_mapping->host); 57 struct gfs2_inode *ip = GFS2_I(file->f_mapping->host);
58 struct gfs2_holder i_gh; 58 struct gfs2_holder i_gh;
59 loff_t error; 59 loff_t error;
60 60
61 switch (origin) { 61 switch (whence) {
62 case SEEK_END: /* These reference inode->i_size */ 62 case SEEK_END: /* These reference inode->i_size */
63 case SEEK_DATA: 63 case SEEK_DATA:
64 case SEEK_HOLE: 64 case SEEK_HOLE:
65 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, 65 error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY,
66 &i_gh); 66 &i_gh);
67 if (!error) { 67 if (!error) {
68 error = generic_file_llseek(file, offset, origin); 68 error = generic_file_llseek(file, offset, whence);
69 gfs2_glock_dq_uninit(&i_gh); 69 gfs2_glock_dq_uninit(&i_gh);
70 } 70 }
71 break; 71 break;
72 case SEEK_CUR: 72 case SEEK_CUR:
73 case SEEK_SET: 73 case SEEK_SET:
74 error = generic_file_llseek(file, offset, origin); 74 error = generic_file_llseek(file, offset, whence);
75 break; 75 break;
76 default: 76 default:
77 error = -EINVAL; 77 error = -EINVAL;
diff --git a/fs/libfs.c b/fs/libfs.c
index 7cc37ca19cd8..35fc6e74cd88 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -81,11 +81,11 @@ int dcache_dir_close(struct inode *inode, struct file *file)
81 return 0; 81 return 0;
82} 82}
83 83
84loff_t dcache_dir_lseek(struct file *file, loff_t offset, int origin) 84loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence)
85{ 85{
86 struct dentry *dentry = file->f_path.dentry; 86 struct dentry *dentry = file->f_path.dentry;
87 mutex_lock(&dentry->d_inode->i_mutex); 87 mutex_lock(&dentry->d_inode->i_mutex);
88 switch (origin) { 88 switch (whence) {
89 case 1: 89 case 1:
90 offset += file->f_pos; 90 offset += file->f_pos;
91 case 0: 91 case 0:
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index b9e66b7e0c14..1cc71f60b491 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -871,7 +871,7 @@ out:
871 return res; 871 return res;
872} 872}
873 873
874static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin) 874static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence)
875{ 875{
876 struct dentry *dentry = filp->f_path.dentry; 876 struct dentry *dentry = filp->f_path.dentry;
877 struct inode *inode = dentry->d_inode; 877 struct inode *inode = dentry->d_inode;
@@ -880,10 +880,10 @@ static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin)
880 dfprintk(FILE, "NFS: llseek dir(%s/%s, %lld, %d)\n", 880 dfprintk(FILE, "NFS: llseek dir(%s/%s, %lld, %d)\n",
881 dentry->d_parent->d_name.name, 881 dentry->d_parent->d_name.name,
882 dentry->d_name.name, 882 dentry->d_name.name,
883 offset, origin); 883 offset, whence);
884 884
885 mutex_lock(&inode->i_mutex); 885 mutex_lock(&inode->i_mutex);
886 switch (origin) { 886 switch (whence) {
887 case 1: 887 case 1:
888 offset += filp->f_pos; 888 offset += filp->f_pos;
889 case 0: 889 case 0:
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 582bb8866131..3c2b893665ba 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -119,18 +119,18 @@ force_reval:
119 return __nfs_revalidate_inode(server, inode); 119 return __nfs_revalidate_inode(server, inode);
120} 120}
121 121
122loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin) 122loff_t nfs_file_llseek(struct file *filp, loff_t offset, int whence)
123{ 123{
124 dprintk("NFS: llseek file(%s/%s, %lld, %d)\n", 124 dprintk("NFS: llseek file(%s/%s, %lld, %d)\n",
125 filp->f_path.dentry->d_parent->d_name.name, 125 filp->f_path.dentry->d_parent->d_name.name,
126 filp->f_path.dentry->d_name.name, 126 filp->f_path.dentry->d_name.name,
127 offset, origin); 127 offset, whence);
128 128
129 /* 129 /*
130 * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate 130 * whence == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate
131 * the cached file length 131 * the cached file length
132 */ 132 */
133 if (origin != SEEK_SET && origin != SEEK_CUR) { 133 if (whence != SEEK_SET && whence != SEEK_CUR) {
134 struct inode *inode = filp->f_mapping->host; 134 struct inode *inode = filp->f_mapping->host;
135 135
136 int retval = nfs_revalidate_file_size(inode, filp); 136 int retval = nfs_revalidate_file_size(inode, filp);
@@ -138,7 +138,7 @@ loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin)
138 return (loff_t)retval; 138 return (loff_t)retval;
139 } 139 }
140 140
141 return generic_file_llseek(filp, offset, origin); 141 return generic_file_llseek(filp, offset, whence);
142} 142}
143EXPORT_SYMBOL_GPL(nfs_file_llseek); 143EXPORT_SYMBOL_GPL(nfs_file_llseek);
144 144
diff --git a/fs/ocfs2/extent_map.c b/fs/ocfs2/extent_map.c
index 70b5863a2d64..f487aa343442 100644
--- a/fs/ocfs2/extent_map.c
+++ b/fs/ocfs2/extent_map.c
@@ -832,7 +832,7 @@ out:
832 return ret; 832 return ret;
833} 833}
834 834
835int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int origin) 835int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int whence)
836{ 836{
837 struct inode *inode = file->f_mapping->host; 837 struct inode *inode = file->f_mapping->host;
838 int ret; 838 int ret;
@@ -843,7 +843,7 @@ int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int origin)
843 struct buffer_head *di_bh = NULL; 843 struct buffer_head *di_bh = NULL;
844 struct ocfs2_extent_rec rec; 844 struct ocfs2_extent_rec rec;
845 845
846 BUG_ON(origin != SEEK_DATA && origin != SEEK_HOLE); 846 BUG_ON(whence != SEEK_DATA && whence != SEEK_HOLE);
847 847
848 ret = ocfs2_inode_lock(inode, &di_bh, 0); 848 ret = ocfs2_inode_lock(inode, &di_bh, 0);
849 if (ret) { 849 if (ret) {
@@ -859,7 +859,7 @@ int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int origin)
859 } 859 }
860 860
861 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) { 861 if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
862 if (origin == SEEK_HOLE) 862 if (whence == SEEK_HOLE)
863 *offset = inode->i_size; 863 *offset = inode->i_size;
864 goto out_unlock; 864 goto out_unlock;
865 } 865 }
@@ -888,8 +888,8 @@ int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int origin)
888 is_data = (rec.e_flags & OCFS2_EXT_UNWRITTEN) ? 0 : 1; 888 is_data = (rec.e_flags & OCFS2_EXT_UNWRITTEN) ? 0 : 1;
889 } 889 }
890 890
891 if ((!is_data && origin == SEEK_HOLE) || 891 if ((!is_data && whence == SEEK_HOLE) ||
892 (is_data && origin == SEEK_DATA)) { 892 (is_data && whence == SEEK_DATA)) {
893 if (extoff > *offset) 893 if (extoff > *offset)
894 *offset = extoff; 894 *offset = extoff;
895 goto out_unlock; 895 goto out_unlock;
@@ -899,7 +899,7 @@ int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int origin)
899 cpos += clen; 899 cpos += clen;
900 } 900 }
901 901
902 if (origin == SEEK_HOLE) { 902 if (whence == SEEK_HOLE) {
903 extoff = cpos; 903 extoff = cpos;
904 extoff <<= cs_bits; 904 extoff <<= cs_bits;
905 extlen = clen; 905 extlen = clen;
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index dda089804942..fe492e1a3cfc 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -2637,14 +2637,14 @@ bail:
2637} 2637}
2638 2638
2639/* Refer generic_file_llseek_unlocked() */ 2639/* Refer generic_file_llseek_unlocked() */
2640static loff_t ocfs2_file_llseek(struct file *file, loff_t offset, int origin) 2640static loff_t ocfs2_file_llseek(struct file *file, loff_t offset, int whence)
2641{ 2641{
2642 struct inode *inode = file->f_mapping->host; 2642 struct inode *inode = file->f_mapping->host;
2643 int ret = 0; 2643 int ret = 0;
2644 2644
2645 mutex_lock(&inode->i_mutex); 2645 mutex_lock(&inode->i_mutex);
2646 2646
2647 switch (origin) { 2647 switch (whence) {
2648 case SEEK_SET: 2648 case SEEK_SET:
2649 break; 2649 break;
2650 case SEEK_END: 2650 case SEEK_END:
@@ -2659,7 +2659,7 @@ static loff_t ocfs2_file_llseek(struct file *file, loff_t offset, int origin)
2659 break; 2659 break;
2660 case SEEK_DATA: 2660 case SEEK_DATA:
2661 case SEEK_HOLE: 2661 case SEEK_HOLE:
2662 ret = ocfs2_seek_data_hole_offset(file, &offset, origin); 2662 ret = ocfs2_seek_data_hole_offset(file, &offset, whence);
2663 if (ret) 2663 if (ret)
2664 goto out; 2664 goto out;
2665 break; 2665 break;
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c
index ed1d8c7212da..67de74ca85f4 100644
--- a/fs/pstore/inode.c
+++ b/fs/pstore/inode.c
@@ -151,13 +151,13 @@ static int pstore_file_open(struct inode *inode, struct file *file)
151 return 0; 151 return 0;
152} 152}
153 153
154static loff_t pstore_file_llseek(struct file *file, loff_t off, int origin) 154static loff_t pstore_file_llseek(struct file *file, loff_t off, int whence)
155{ 155{
156 struct seq_file *sf = file->private_data; 156 struct seq_file *sf = file->private_data;
157 157
158 if (sf->op) 158 if (sf->op)
159 return seq_lseek(file, off, origin); 159 return seq_lseek(file, off, whence);
160 return default_llseek(file, off, origin); 160 return default_llseek(file, off, whence);
161} 161}
162 162
163static const struct file_operations pstore_file_operations = { 163static const struct file_operations pstore_file_operations = {
diff --git a/fs/read_write.c b/fs/read_write.c
index d06534857e9e..1edaf099ddd7 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -54,7 +54,7 @@ static loff_t lseek_execute(struct file *file, struct inode *inode,
54 * generic_file_llseek_size - generic llseek implementation for regular files 54 * generic_file_llseek_size - generic llseek implementation for regular files
55 * @file: file structure to seek on 55 * @file: file structure to seek on
56 * @offset: file offset to seek to 56 * @offset: file offset to seek to
57 * @origin: type of seek 57 * @whence: type of seek
58 * @size: max size of this file in file system 58 * @size: max size of this file in file system
59 * @eof: offset used for SEEK_END position 59 * @eof: offset used for SEEK_END position
60 * 60 *
@@ -67,12 +67,12 @@ static loff_t lseek_execute(struct file *file, struct inode *inode,
67 * read/writes behave like SEEK_SET against seeks. 67 * read/writes behave like SEEK_SET against seeks.
68 */ 68 */
69loff_t 69loff_t
70generic_file_llseek_size(struct file *file, loff_t offset, int origin, 70generic_file_llseek_size(struct file *file, loff_t offset, int whence,
71 loff_t maxsize, loff_t eof) 71 loff_t maxsize, loff_t eof)
72{ 72{
73 struct inode *inode = file->f_mapping->host; 73 struct inode *inode = file->f_mapping->host;
74 74
75 switch (origin) { 75 switch (whence) {
76 case SEEK_END: 76 case SEEK_END:
77 offset += eof; 77 offset += eof;
78 break; 78 break;
@@ -122,17 +122,17 @@ EXPORT_SYMBOL(generic_file_llseek_size);
122 * generic_file_llseek - generic llseek implementation for regular files 122 * generic_file_llseek - generic llseek implementation for regular files
123 * @file: file structure to seek on 123 * @file: file structure to seek on
124 * @offset: file offset to seek to 124 * @offset: file offset to seek to
125 * @origin: type of seek 125 * @whence: type of seek
126 * 126 *
127 * This is a generic implemenation of ->llseek useable for all normal local 127 * This is a generic implemenation of ->llseek useable for all normal local
128 * filesystems. It just updates the file offset to the value specified by 128 * filesystems. It just updates the file offset to the value specified by
129 * @offset and @origin under i_mutex. 129 * @offset and @whence under i_mutex.
130 */ 130 */
131loff_t generic_file_llseek(struct file *file, loff_t offset, int origin) 131loff_t generic_file_llseek(struct file *file, loff_t offset, int whence)
132{ 132{
133 struct inode *inode = file->f_mapping->host; 133 struct inode *inode = file->f_mapping->host;
134 134
135 return generic_file_llseek_size(file, offset, origin, 135 return generic_file_llseek_size(file, offset, whence,
136 inode->i_sb->s_maxbytes, 136 inode->i_sb->s_maxbytes,
137 i_size_read(inode)); 137 i_size_read(inode));
138} 138}
@@ -142,32 +142,32 @@ EXPORT_SYMBOL(generic_file_llseek);
142 * noop_llseek - No Operation Performed llseek implementation 142 * noop_llseek - No Operation Performed llseek implementation
143 * @file: file structure to seek on 143 * @file: file structure to seek on
144 * @offset: file offset to seek to 144 * @offset: file offset to seek to
145 * @origin: type of seek 145 * @whence: type of seek
146 * 146 *
147 * This is an implementation of ->llseek useable for the rare special case when 147 * This is an implementation of ->llseek useable for the rare special case when
148 * userspace expects the seek to succeed but the (device) file is actually not 148 * userspace expects the seek to succeed but the (device) file is actually not
149 * able to perform the seek. In this case you use noop_llseek() instead of 149 * able to perform the seek. In this case you use noop_llseek() instead of
150 * falling back to the default implementation of ->llseek. 150 * falling back to the default implementation of ->llseek.
151 */ 151 */
152loff_t noop_llseek(struct file *file, loff_t offset, int origin) 152loff_t noop_llseek(struct file *file, loff_t offset, int whence)
153{ 153{
154 return file->f_pos; 154 return file->f_pos;
155} 155}
156EXPORT_SYMBOL(noop_llseek); 156EXPORT_SYMBOL(noop_llseek);
157 157
158loff_t no_llseek(struct file *file, loff_t offset, int origin) 158loff_t no_llseek(struct file *file, loff_t offset, int whence)
159{ 159{
160 return -ESPIPE; 160 return -ESPIPE;
161} 161}
162EXPORT_SYMBOL(no_llseek); 162EXPORT_SYMBOL(no_llseek);
163 163
164loff_t default_llseek(struct file *file, loff_t offset, int origin) 164loff_t default_llseek(struct file *file, loff_t offset, int whence)
165{ 165{
166 struct inode *inode = file->f_path.dentry->d_inode; 166 struct inode *inode = file->f_path.dentry->d_inode;
167 loff_t retval; 167 loff_t retval;
168 168
169 mutex_lock(&inode->i_mutex); 169 mutex_lock(&inode->i_mutex);
170 switch (origin) { 170 switch (whence) {
171 case SEEK_END: 171 case SEEK_END:
172 offset += i_size_read(inode); 172 offset += i_size_read(inode);
173 break; 173 break;
@@ -216,7 +216,7 @@ out:
216} 216}
217EXPORT_SYMBOL(default_llseek); 217EXPORT_SYMBOL(default_llseek);
218 218
219loff_t vfs_llseek(struct file *file, loff_t offset, int origin) 219loff_t vfs_llseek(struct file *file, loff_t offset, int whence)
220{ 220{
221 loff_t (*fn)(struct file *, loff_t, int); 221 loff_t (*fn)(struct file *, loff_t, int);
222 222
@@ -225,11 +225,11 @@ loff_t vfs_llseek(struct file *file, loff_t offset, int origin)
225 if (file->f_op && file->f_op->llseek) 225 if (file->f_op && file->f_op->llseek)
226 fn = file->f_op->llseek; 226 fn = file->f_op->llseek;
227 } 227 }
228 return fn(file, offset, origin); 228 return fn(file, offset, whence);
229} 229}
230EXPORT_SYMBOL(vfs_llseek); 230EXPORT_SYMBOL(vfs_llseek);
231 231
232SYSCALL_DEFINE3(lseek, unsigned int, fd, off_t, offset, unsigned int, origin) 232SYSCALL_DEFINE3(lseek, unsigned int, fd, off_t, offset, unsigned int, whence)
233{ 233{
234 off_t retval; 234 off_t retval;
235 struct fd f = fdget(fd); 235 struct fd f = fdget(fd);
@@ -237,8 +237,8 @@ SYSCALL_DEFINE3(lseek, unsigned int, fd, off_t, offset, unsigned int, origin)
237 return -EBADF; 237 return -EBADF;
238 238
239 retval = -EINVAL; 239 retval = -EINVAL;
240 if (origin <= SEEK_MAX) { 240 if (whence <= SEEK_MAX) {
241 loff_t res = vfs_llseek(f.file, offset, origin); 241 loff_t res = vfs_llseek(f.file, offset, whence);
242 retval = res; 242 retval = res;
243 if (res != (loff_t)retval) 243 if (res != (loff_t)retval)
244 retval = -EOVERFLOW; /* LFS: should only happen on 32 bit platforms */ 244 retval = -EOVERFLOW; /* LFS: should only happen on 32 bit platforms */
@@ -250,7 +250,7 @@ SYSCALL_DEFINE3(lseek, unsigned int, fd, off_t, offset, unsigned int, origin)
250#ifdef __ARCH_WANT_SYS_LLSEEK 250#ifdef __ARCH_WANT_SYS_LLSEEK
251SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high, 251SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high,
252 unsigned long, offset_low, loff_t __user *, result, 252 unsigned long, offset_low, loff_t __user *, result,
253 unsigned int, origin) 253 unsigned int, whence)
254{ 254{
255 int retval; 255 int retval;
256 struct fd f = fdget(fd); 256 struct fd f = fdget(fd);
@@ -260,11 +260,11 @@ SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high,
260 return -EBADF; 260 return -EBADF;
261 261
262 retval = -EINVAL; 262 retval = -EINVAL;
263 if (origin > SEEK_MAX) 263 if (whence > SEEK_MAX)
264 goto out_putf; 264 goto out_putf;
265 265
266 offset = vfs_llseek(f.file, ((loff_t) offset_high << 32) | offset_low, 266 offset = vfs_llseek(f.file, ((loff_t) offset_high << 32) | offset_low,
267 origin); 267 whence);
268 268
269 retval = (int)offset; 269 retval = (int)offset;
270 if (offset >= 0) { 270 if (offset >= 0) {
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 99dffab4c4e4..9d863fb501f9 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -300,14 +300,14 @@ EXPORT_SYMBOL(seq_read);
300 * 300 *
301 * Ready-made ->f_op->llseek() 301 * Ready-made ->f_op->llseek()
302 */ 302 */
303loff_t seq_lseek(struct file *file, loff_t offset, int origin) 303loff_t seq_lseek(struct file *file, loff_t offset, int whence)
304{ 304{
305 struct seq_file *m = file->private_data; 305 struct seq_file *m = file->private_data;
306 loff_t retval = -EINVAL; 306 loff_t retval = -EINVAL;
307 307
308 mutex_lock(&m->lock); 308 mutex_lock(&m->lock);
309 m->version = file->f_version; 309 m->version = file->f_version;
310 switch (origin) { 310 switch (whence) {
311 case 1: 311 case 1:
312 offset += file->f_pos; 312 offset += file->f_pos;
313 case 0: 313 case 0:
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
index e271fba1651b..8a574776a493 100644
--- a/fs/ubifs/dir.c
+++ b/fs/ubifs/dir.c
@@ -453,11 +453,11 @@ out:
453} 453}
454 454
455/* If a directory is seeked, we have to free saved readdir() state */ 455/* If a directory is seeked, we have to free saved readdir() state */
456static loff_t ubifs_dir_llseek(struct file *file, loff_t offset, int origin) 456static loff_t ubifs_dir_llseek(struct file *file, loff_t offset, int whence)
457{ 457{
458 kfree(file->private_data); 458 kfree(file->private_data);
459 file->private_data = NULL; 459 file->private_data = NULL;
460 return generic_file_llseek(file, offset, origin); 460 return generic_file_llseek(file, offset, whence);
461} 461}
462 462
463/* Free saved readdir() state when the directory is closed */ 463/* Free saved readdir() state when the directory is closed */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 408fb1e77a0a..029552ff774c 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2286,9 +2286,9 @@ extern ino_t find_inode_number(struct dentry *, struct qstr *);
2286#include <linux/err.h> 2286#include <linux/err.h>
2287 2287
2288/* needed for stackable file system support */ 2288/* needed for stackable file system support */
2289extern loff_t default_llseek(struct file *file, loff_t offset, int origin); 2289extern loff_t default_llseek(struct file *file, loff_t offset, int whence);
2290 2290
2291extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); 2291extern loff_t vfs_llseek(struct file *file, loff_t offset, int whence);
2292 2292
2293extern int inode_init_always(struct super_block *, struct inode *); 2293extern int inode_init_always(struct super_block *, struct inode *);
2294extern void inode_init_once(struct inode *); 2294extern void inode_init_once(struct inode *);
@@ -2396,11 +2396,11 @@ extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
2396 2396
2397extern void 2397extern void
2398file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); 2398file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
2399extern loff_t noop_llseek(struct file *file, loff_t offset, int origin); 2399extern loff_t noop_llseek(struct file *file, loff_t offset, int whence);
2400extern loff_t no_llseek(struct file *file, loff_t offset, int origin); 2400extern loff_t no_llseek(struct file *file, loff_t offset, int whence);
2401extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); 2401extern loff_t generic_file_llseek(struct file *file, loff_t offset, int whence);
2402extern loff_t generic_file_llseek_size(struct file *file, loff_t offset, 2402extern loff_t generic_file_llseek_size(struct file *file, loff_t offset,
2403 int origin, loff_t maxsize, loff_t eof); 2403 int whence, loff_t maxsize, loff_t eof);
2404extern int generic_file_open(struct inode * inode, struct file * filp); 2404extern int generic_file_open(struct inode * inode, struct file * filp);
2405extern int nonseekable_open(struct inode * inode, struct file * filp); 2405extern int nonseekable_open(struct inode * inode, struct file * filp);
2406 2406
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index a52f2f4fe030..92691d85c320 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -394,7 +394,7 @@ ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf,
394 size_t cnt, loff_t *ppos); 394 size_t cnt, loff_t *ppos);
395ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, 395ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf,
396 size_t cnt, loff_t *ppos); 396 size_t cnt, loff_t *ppos);
397loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int origin); 397loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int whence);
398int ftrace_regex_release(struct inode *inode, struct file *file); 398int ftrace_regex_release(struct inode *inode, struct file *file);
399 399
400void __init 400void __init
@@ -559,7 +559,7 @@ static inline ssize_t ftrace_filter_write(struct file *file, const char __user *
559 size_t cnt, loff_t *ppos) { return -ENODEV; } 559 size_t cnt, loff_t *ppos) { return -ENODEV; }
560static inline ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, 560static inline ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf,
561 size_t cnt, loff_t *ppos) { return -ENODEV; } 561 size_t cnt, loff_t *ppos) { return -ENODEV; }
562static inline loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int origin) 562static inline loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int whence)
563{ 563{
564 return -ENODEV; 564 return -ENODEV;
565} 565}
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 91835e7f364d..36c3b07c5119 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -560,10 +560,10 @@ asmlinkage long sys_utime(char __user *filename,
560asmlinkage long sys_utimes(char __user *filename, 560asmlinkage long sys_utimes(char __user *filename,
561 struct timeval __user *utimes); 561 struct timeval __user *utimes);
562asmlinkage long sys_lseek(unsigned int fd, off_t offset, 562asmlinkage long sys_lseek(unsigned int fd, off_t offset,
563 unsigned int origin); 563 unsigned int whence);
564asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high, 564asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high,
565 unsigned long offset_low, loff_t __user *result, 565 unsigned long offset_low, loff_t __user *result,
566 unsigned int origin); 566 unsigned int whence);
567asmlinkage long sys_read(unsigned int fd, char __user *buf, size_t count); 567asmlinkage long sys_read(unsigned int fd, char __user *buf, size_t count);
568asmlinkage long sys_readahead(int fd, loff_t offset, size_t count); 568asmlinkage long sys_readahead(int fd, loff_t offset, size_t count);
569asmlinkage long sys_readv(unsigned long fd, 569asmlinkage long sys_readv(unsigned long fd,
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index afd092de45b7..3ffe4c5ad3f3 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2675,12 +2675,12 @@ ftrace_notrace_open(struct inode *inode, struct file *file)
2675} 2675}
2676 2676
2677loff_t 2677loff_t
2678ftrace_regex_lseek(struct file *file, loff_t offset, int origin) 2678ftrace_regex_lseek(struct file *file, loff_t offset, int whence)
2679{ 2679{
2680 loff_t ret; 2680 loff_t ret;
2681 2681
2682 if (file->f_mode & FMODE_READ) 2682 if (file->f_mode & FMODE_READ)
2683 ret = seq_lseek(file, offset, origin); 2683 ret = seq_lseek(file, offset, whence);
2684 else 2684 else
2685 file->f_pos = ret = 1; 2685 file->f_pos = ret = 1;
2686 2686
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;