]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
lseek: the "whence" argument is called "whence"
authorAndrew Morton <akpm@linux-foundation.org>
Mon, 17 Dec 2012 23:59:39 +0000 (15:59 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 18 Dec 2012 01:15:12 +0000 (17:15 -0800)
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>
26 files changed:
fs/bad_inode.c
fs/block_dev.c
fs/btrfs/file.c
fs/ceph/dir.c
fs/ceph/file.c
fs/cifs/cifsfs.c
fs/configfs/dir.c
fs/ext3/dir.c
fs/ext4/dir.c
fs/ext4/file.c
fs/fuse/file.c
fs/gfs2/file.c
fs/libfs.c
fs/nfs/dir.c
fs/nfs/file.c
fs/ocfs2/extent_map.c
fs/ocfs2/file.c
fs/pstore/inode.c
fs/read_write.c
fs/seq_file.c
fs/ubifs/dir.c
include/linux/fs.h
include/linux/ftrace.h
include/linux/syscalls.h
kernel/trace/ftrace.c
mm/shmem.c

index b1342ffb3cf6e595125252ac82d5bd54ebbe9544..922ad460bff9857e39b6719001508e02e9b2b434 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/poll.h>
 
 
-static loff_t bad_file_llseek(struct file *file, loff_t offset, int origin)
+static loff_t bad_file_llseek(struct file *file, loff_t offset, int whence)
 {
        return -EIO;
 }
index ab3a456f66506a5a134f5280739e82c572b15f55..172f8491a2bd6905fda9d21afb8957c16a97c5f6 100644 (file)
@@ -321,7 +321,7 @@ static int blkdev_write_end(struct file *file, struct address_space *mapping,
  * for a block special file file->f_path.dentry->d_inode->i_size is zero
  * so we compute the size by hand (just as in block_read/write above)
  */
-static loff_t block_llseek(struct file *file, loff_t offset, int origin)
+static loff_t block_llseek(struct file *file, loff_t offset, int whence)
 {
        struct inode *bd_inode = file->f_mapping->host;
        loff_t size;
@@ -331,7 +331,7 @@ static loff_t block_llseek(struct file *file, loff_t offset, int origin)
        size = i_size_read(bd_inode);
 
        retval = -EINVAL;
-       switch (origin) {
+       switch (whence) {
                case SEEK_END:
                        offset += size;
                        break;
index a8ee75cb96eeab848677daeea7130297bbd22e43..9c6673a9231fad34c6387f08822aaada78fe5665 100644 (file)
@@ -2120,7 +2120,7 @@ out:
        return ret;
 }
 
-static int find_desired_extent(struct inode *inode, loff_t *offset, int origin)
+static int find_desired_extent(struct inode *inode, loff_t *offset, int whence)
 {
        struct btrfs_root *root = BTRFS_I(inode)->root;
        struct extent_map *em;
@@ -2154,7 +2154,7 @@ static int find_desired_extent(struct inode *inode, loff_t *offset, int origin)
         * before the position we want in case there is outstanding delalloc
         * going on here.
         */
-       if (origin == SEEK_HOLE && start != 0) {
+       if (whence == SEEK_HOLE && start != 0) {
                if (start <= root->sectorsize)
                        em = btrfs_get_extent_fiemap(inode, NULL, 0, 0,
                                                     root->sectorsize, 0);
@@ -2188,13 +2188,13 @@ static int find_desired_extent(struct inode *inode, loff_t *offset, int origin)
                                }
                        }
 
-                       if (origin == SEEK_HOLE) {
+                       if (whence == SEEK_HOLE) {
                                *offset = start;
                                free_extent_map(em);
                                break;
                        }
                } else {
-                       if (origin == SEEK_DATA) {
+                       if (whence == SEEK_DATA) {
                                if (em->block_start == EXTENT_MAP_DELALLOC) {
                                        if (start >= inode->i_size) {
                                                free_extent_map(em);
@@ -2231,16 +2231,16 @@ out:
        return ret;
 }
 
-static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int origin)
+static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int whence)
 {
        struct inode *inode = file->f_mapping->host;
        int ret;
 
        mutex_lock(&inode->i_mutex);
-       switch (origin) {
+       switch (whence) {
        case SEEK_END:
        case SEEK_CUR:
-               offset = generic_file_llseek(file, offset, origin);
+               offset = generic_file_llseek(file, offset, whence);
                goto out;
        case SEEK_DATA:
        case SEEK_HOLE:
@@ -2249,7 +2249,7 @@ static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int origin)
                        return -ENXIO;
                }
 
-               ret = find_desired_extent(inode, &offset, origin);
+               ret = find_desired_extent(inode, &offset, whence);
                if (ret) {
                        mutex_unlock(&inode->i_mutex);
                        return ret;
index e5b77319c97b7fe1a537bfd292e859467389167a..8c1aabe93b6779e2c2a39333c73f26222c7f4c28 100644 (file)
@@ -454,7 +454,7 @@ static void reset_readdir(struct ceph_file_info *fi)
        fi->flags &= ~CEPH_F_ATEND;
 }
 
-static loff_t ceph_dir_llseek(struct file *file, loff_t offset, int origin)
+static loff_t ceph_dir_llseek(struct file *file, loff_t offset, int whence)
 {
        struct ceph_file_info *fi = file->private_data;
        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)
 
        mutex_lock(&inode->i_mutex);
        retval = -EINVAL;
-       switch (origin) {
+       switch (whence) {
        case SEEK_END:
                offset += inode->i_size + 2;   /* FIXME */
                break;
index 5840d2aaed15f76788e41fcee9d71bf81e2c0322..d4dfdcf76d7fdfbff4c318e1e4f5d9a2487d0088 100644 (file)
@@ -797,7 +797,7 @@ out:
 /*
  * llseek.  be sure to verify file size on SEEK_END.
  */
-static loff_t ceph_llseek(struct file *file, loff_t offset, int origin)
+static loff_t ceph_llseek(struct file *file, loff_t offset, int whence)
 {
        struct inode *inode = file->f_mapping->host;
        int ret;
@@ -805,7 +805,7 @@ static loff_t ceph_llseek(struct file *file, loff_t offset, int origin)
        mutex_lock(&inode->i_mutex);
        __ceph_do_pending_vmtruncate(inode);
 
-       if (origin == SEEK_END || origin == SEEK_DATA || origin == SEEK_HOLE) {
+       if (whence == SEEK_END || whence == SEEK_DATA || whence == SEEK_HOLE) {
                ret = ceph_do_getattr(inode, CEPH_STAT_CAP_SIZE);
                if (ret < 0) {
                        offset = ret;
@@ -813,7 +813,7 @@ static loff_t ceph_llseek(struct file *file, loff_t offset, int origin)
                }
        }
 
-       switch (origin) {
+       switch (whence) {
        case SEEK_END:
                offset += inode->i_size;
                break;
index 210f0af83fc449f8667f6482558dda9d5a060654..ce9f3c5421bf61d3d3bf828cc40820047c9b010c 100644 (file)
@@ -695,13 +695,13 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
        return written;
 }
 
-static loff_t cifs_llseek(struct file *file, loff_t offset, int origin)
+static loff_t cifs_llseek(struct file *file, loff_t offset, int whence)
 {
        /*
-        * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate
+        * whence == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate
         * the cached file length
         */
-       if (origin != SEEK_SET && origin != SEEK_CUR) {
+       if (whence != SEEK_SET && whence != SEEK_CUR) {
                int rc;
                struct inode *inode = file->f_path.dentry->d_inode;
 
@@ -728,7 +728,7 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int origin)
                if (rc < 0)
                        return (loff_t)rc;
        }
-       return generic_file_llseek(file, offset, origin);
+       return generic_file_llseek(file, offset, whence);
 }
 
 static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
index 7414ae24a79b4690ed5fb7ed72245d941791a82f..712b10f64c709ff8a27d423aa7a5186f80aec04f 100644 (file)
@@ -1613,12 +1613,12 @@ static int configfs_readdir(struct file * filp, void * dirent, filldir_t filldir
        return 0;
 }
 
-static loff_t configfs_dir_lseek(struct file * file, loff_t offset, int origin)
+static loff_t configfs_dir_lseek(struct file *file, loff_t offset, int whence)
 {
        struct dentry * dentry = file->f_path.dentry;
 
        mutex_lock(&dentry->d_inode->i_mutex);
-       switch (origin) {
+       switch (whence) {
                case 1:
                        offset += file->f_pos;
                case 0:
index c8fff930790d4eba76a0810c6e75fd7a85edce85..dd91264ba94fd72a5e8607ad0ef9d3cd41bd5fb6 100644 (file)
@@ -296,17 +296,17 @@ static inline loff_t ext3_get_htree_eof(struct file *filp)
  * NOTE: offsets obtained *before* ext3_set_inode_flag(dir, EXT3_INODE_INDEX)
  *       will be invalid once the directory was converted into a dx directory
  */
-loff_t ext3_dir_llseek(struct file *file, loff_t offset, int origin)
+loff_t ext3_dir_llseek(struct file *file, loff_t offset, int whence)
 {
        struct inode *inode = file->f_mapping->host;
        int dx_dir = is_dx_dir(inode);
        loff_t htree_max = ext3_get_htree_eof(file);
 
        if (likely(dx_dir))
-               return generic_file_llseek_size(file, offset, origin,
+               return generic_file_llseek_size(file, offset, whence,
                                                htree_max, htree_max);
        else
-               return generic_file_llseek(file, offset, origin);
+               return generic_file_llseek(file, offset, whence);
 }
 
 /*
index b8d877f6c1fa52991cb16d8bf76652e41e9dd72c..80a28b29727981a4b710c7873c4860a30d41fdc7 100644 (file)
@@ -333,17 +333,17 @@ static inline loff_t ext4_get_htree_eof(struct file *filp)
  *
  * For non-htree, ext4_llseek already chooses the proper max offset.
  */
-loff_t ext4_dir_llseek(struct file *file, loff_t offset, int origin)
+loff_t ext4_dir_llseek(struct file *file, loff_t offset, int whence)
 {
        struct inode *inode = file->f_mapping->host;
        int dx_dir = is_dx_dir(inode);
        loff_t htree_max = ext4_get_htree_eof(file);
 
        if (likely(dx_dir))
-               return generic_file_llseek_size(file, offset, origin,
+               return generic_file_llseek_size(file, offset, whence,
                                                    htree_max, htree_max);
        else
-               return ext4_llseek(file, offset, origin);
+               return ext4_llseek(file, offset, whence);
 }
 
 /*
index b64a60bf105a0c884c104b251ba59a6e0ef93d1b..d07c27ca594a4578887ed898e71c9b60684730df 100644 (file)
@@ -303,7 +303,7 @@ static int ext4_file_open(struct inode * inode, struct file * filp)
  * page cache has data or not.
  */
 static int ext4_find_unwritten_pgoff(struct inode *inode,
-                                    int origin,
+                                    int whence,
                                     struct ext4_map_blocks *map,
                                     loff_t *offset)
 {
@@ -333,10 +333,10 @@ static int ext4_find_unwritten_pgoff(struct inode *inode,
                nr_pages = pagevec_lookup(&pvec, inode->i_mapping, index,
                                          (pgoff_t)num);
                if (nr_pages == 0) {
-                       if (origin == SEEK_DATA)
+                       if (whence == SEEK_DATA)
                                break;
 
-                       BUG_ON(origin != SEEK_HOLE);
+                       BUG_ON(whence != SEEK_HOLE);
                        /*
                         * If this is the first time to go into the loop and
                         * offset is not beyond the end offset, it will be a
@@ -352,7 +352,7 @@ static int ext4_find_unwritten_pgoff(struct inode *inode,
                 * offset is smaller than the first page offset, it will be a
                 * hole at this offset.
                 */
-               if (lastoff == startoff && origin == SEEK_HOLE &&
+               if (lastoff == startoff && whence == SEEK_HOLE &&
                    lastoff < page_offset(pvec.pages[0])) {
                        found = 1;
                        break;
@@ -366,7 +366,7 @@ static int ext4_find_unwritten_pgoff(struct inode *inode,
                         * If the current offset is not beyond the end of given
                         * range, it will be a hole.
                         */
-                       if (lastoff < endoff && origin == SEEK_HOLE &&
+                       if (lastoff < endoff && whence == SEEK_HOLE &&
                            page->index > end) {
                                found = 1;
                                *offset = lastoff;
@@ -391,10 +391,10 @@ static int ext4_find_unwritten_pgoff(struct inode *inode,
                                do {
                                        if (buffer_uptodate(bh) ||
                                            buffer_unwritten(bh)) {
-                                               if (origin == SEEK_DATA)
+                                               if (whence == SEEK_DATA)
                                                        found = 1;
                                        } else {
-                                               if (origin == SEEK_HOLE)
+                                               if (whence == SEEK_HOLE)
                                                        found = 1;
                                        }
                                        if (found) {
@@ -416,7 +416,7 @@ static int ext4_find_unwritten_pgoff(struct inode *inode,
                 * The no. of pages is less than our desired, that would be a
                 * hole in there.
                 */
-               if (nr_pages < num && origin == SEEK_HOLE) {
+               if (nr_pages < num && whence == SEEK_HOLE) {
                        found = 1;
                        *offset = lastoff;
                        break;
@@ -609,7 +609,7 @@ static loff_t ext4_seek_hole(struct file *file, loff_t offset, loff_t maxsize)
  * by calling generic_file_llseek_size() with the appropriate maxbytes
  * value for each.
  */
-loff_t ext4_llseek(struct file *file, loff_t offset, int origin)
+loff_t ext4_llseek(struct file *file, loff_t offset, int whence)
 {
        struct inode *inode = file->f_mapping->host;
        loff_t maxbytes;
@@ -619,11 +619,11 @@ loff_t ext4_llseek(struct file *file, loff_t offset, int origin)
        else
                maxbytes = inode->i_sb->s_maxbytes;
 
-       switch (origin) {
+       switch (whence) {
        case SEEK_SET:
        case SEEK_CUR:
        case SEEK_END:
-               return generic_file_llseek_size(file, offset, origin,
+               return generic_file_llseek_size(file, offset, whence,
                                                maxbytes, i_size_read(inode));
        case SEEK_DATA:
                return ext4_seek_data(file, offset, maxbytes);
index 78d2837bc940292aa757aba68f84fa18fb4057da..e21d4d8f87e36e45daf71f044712710f12b23322 100644 (file)
@@ -1599,19 +1599,19 @@ static sector_t fuse_bmap(struct address_space *mapping, sector_t block)
        return err ? 0 : outarg.block;
 }
 
-static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin)
+static loff_t fuse_file_llseek(struct file *file, loff_t offset, int whence)
 {
        loff_t retval;
        struct inode *inode = file->f_path.dentry->d_inode;
 
        /* No i_mutex protection necessary for SEEK_CUR and SEEK_SET */
-       if (origin == SEEK_CUR || origin == SEEK_SET)
-               return generic_file_llseek(file, offset, origin);
+       if (whence == SEEK_CUR || whence == SEEK_SET)
+               return generic_file_llseek(file, offset, whence);
 
        mutex_lock(&inode->i_mutex);
        retval = fuse_update_attributes(inode, NULL, file, NULL);
        if (!retval)
-               retval = generic_file_llseek(file, offset, origin);
+               retval = generic_file_llseek(file, offset, whence);
        mutex_unlock(&inode->i_mutex);
 
        return retval;
index dfe2d8cb9b2c0a57717fb3a3b7175b30eacffe76..991ab2d484dd888e9432dd66ecee92247e16fac9 100644 (file)
@@ -44,7 +44,7 @@
  * gfs2_llseek - seek to a location in a file
  * @file: the file
  * @offset: the offset
- * @origin: Where to seek from (SEEK_SET, SEEK_CUR, or SEEK_END)
+ * @whence: Where to seek from (SEEK_SET, SEEK_CUR, or SEEK_END)
  *
  * SEEK_END requires the glock for the file because it references the
  * file's size.
  * Returns: The new offset, or errno
  */
 
-static loff_t gfs2_llseek(struct file *file, loff_t offset, int origin)
+static loff_t gfs2_llseek(struct file *file, loff_t offset, int whence)
 {
        struct gfs2_inode *ip = GFS2_I(file->f_mapping->host);
        struct gfs2_holder i_gh;
        loff_t error;
 
-       switch (origin) {
+       switch (whence) {
        case SEEK_END: /* These reference inode->i_size */
        case SEEK_DATA:
        case SEEK_HOLE:
                error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY,
                                           &i_gh);
                if (!error) {
-                       error = generic_file_llseek(file, offset, origin);
+                       error = generic_file_llseek(file, offset, whence);
                        gfs2_glock_dq_uninit(&i_gh);
                }
                break;
        case SEEK_CUR:
        case SEEK_SET:
-               error = generic_file_llseek(file, offset, origin);
+               error = generic_file_llseek(file, offset, whence);
                break;
        default:
                error = -EINVAL;
index 7cc37ca19cd81e4f844058ad11e5bba947ba86a1..35fc6e74cd886954aab26d223c603573dfe26786 100644 (file)
@@ -81,11 +81,11 @@ int dcache_dir_close(struct inode *inode, struct file *file)
        return 0;
 }
 
-loff_t dcache_dir_lseek(struct file *file, loff_t offset, int origin)
+loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence)
 {
        struct dentry *dentry = file->f_path.dentry;
        mutex_lock(&dentry->d_inode->i_mutex);
-       switch (origin) {
+       switch (whence) {
                case 1:
                        offset += file->f_pos;
                case 0:
index b9e66b7e0c1495ba05c1fb6a4b2f1557ca6a9b24..1cc71f60b491e7ab7abcabeee22ae1ab54e77ab7 100644 (file)
@@ -871,7 +871,7 @@ out:
        return res;
 }
 
-static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin)
+static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence)
 {
        struct dentry *dentry = filp->f_path.dentry;
        struct inode *inode = dentry->d_inode;
@@ -880,10 +880,10 @@ static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin)
        dfprintk(FILE, "NFS: llseek dir(%s/%s, %lld, %d)\n",
                        dentry->d_parent->d_name.name,
                        dentry->d_name.name,
-                       offset, origin);
+                       offset, whence);
 
        mutex_lock(&inode->i_mutex);
-       switch (origin) {
+       switch (whence) {
                case 1:
                        offset += filp->f_pos;
                case 0:
index 582bb8866131d27a8d53d069c8bd7714caa7af4d..3c2b893665ba85997ddbce799c8e37049b070ee7 100644 (file)
@@ -119,18 +119,18 @@ force_reval:
        return __nfs_revalidate_inode(server, inode);
 }
 
-loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin)
+loff_t nfs_file_llseek(struct file *filp, loff_t offset, int whence)
 {
        dprintk("NFS: llseek file(%s/%s, %lld, %d)\n",
                        filp->f_path.dentry->d_parent->d_name.name,
                        filp->f_path.dentry->d_name.name,
-                       offset, origin);
+                       offset, whence);
 
        /*
-        * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate
+        * whence == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate
         * the cached file length
         */
-       if (origin != SEEK_SET && origin != SEEK_CUR) {
+       if (whence != SEEK_SET && whence != SEEK_CUR) {
                struct inode *inode = filp->f_mapping->host;
 
                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)
                        return (loff_t)retval;
        }
 
-       return generic_file_llseek(filp, offset, origin);
+       return generic_file_llseek(filp, offset, whence);
 }
 EXPORT_SYMBOL_GPL(nfs_file_llseek);
 
index 70b5863a2d64e05cde6474bd387112f3b470b5e7..f487aa3434428d889fdcc3e7c8df0a54879c6b8b 100644 (file)
@@ -832,7 +832,7 @@ out:
        return ret;
 }
 
-int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int origin)
+int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int whence)
 {
        struct inode *inode = file->f_mapping->host;
        int ret;
@@ -843,7 +843,7 @@ int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int origin)
        struct buffer_head *di_bh = NULL;
        struct ocfs2_extent_rec rec;
 
-       BUG_ON(origin != SEEK_DATA && origin != SEEK_HOLE);
+       BUG_ON(whence != SEEK_DATA && whence != SEEK_HOLE);
 
        ret = ocfs2_inode_lock(inode, &di_bh, 0);
        if (ret) {
@@ -859,7 +859,7 @@ int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int origin)
        }
 
        if (OCFS2_I(inode)->ip_dyn_features & OCFS2_INLINE_DATA_FL) {
-               if (origin == SEEK_HOLE)
+               if (whence == SEEK_HOLE)
                        *offset = inode->i_size;
                goto out_unlock;
        }
@@ -888,8 +888,8 @@ int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int origin)
                        is_data = (rec.e_flags & OCFS2_EXT_UNWRITTEN) ?  0 : 1;
                }
 
-               if ((!is_data && origin == SEEK_HOLE) ||
-                   (is_data && origin == SEEK_DATA)) {
+               if ((!is_data && whence == SEEK_HOLE) ||
+                   (is_data && whence == SEEK_DATA)) {
                        if (extoff > *offset)
                                *offset = extoff;
                        goto out_unlock;
@@ -899,7 +899,7 @@ int ocfs2_seek_data_hole_offset(struct file *file, loff_t *offset, int origin)
                        cpos += clen;
        }
 
-       if (origin == SEEK_HOLE) {
+       if (whence == SEEK_HOLE) {
                extoff = cpos;
                extoff <<= cs_bits;
                extlen = clen;
index dda08980494259bbd9107157b64f8de995ddcfbe..fe492e1a3cfcaa7189ccdd61075d890673231ceb 100644 (file)
@@ -2637,14 +2637,14 @@ bail:
 }
 
 /* Refer generic_file_llseek_unlocked() */
-static loff_t ocfs2_file_llseek(struct file *file, loff_t offset, int origin)
+static loff_t ocfs2_file_llseek(struct file *file, loff_t offset, int whence)
 {
        struct inode *inode = file->f_mapping->host;
        int ret = 0;
 
        mutex_lock(&inode->i_mutex);
 
-       switch (origin) {
+       switch (whence) {
        case SEEK_SET:
                break;
        case SEEK_END:
@@ -2659,7 +2659,7 @@ static loff_t ocfs2_file_llseek(struct file *file, loff_t offset, int origin)
                break;
        case SEEK_DATA:
        case SEEK_HOLE:
-               ret = ocfs2_seek_data_hole_offset(file, &offset, origin);
+               ret = ocfs2_seek_data_hole_offset(file, &offset, whence);
                if (ret)
                        goto out;
                break;
index ed1d8c7212da6cdb8911d1fbd6784d499a450b90..67de74ca85f4a992d94f5ef3450aa5767be231ee 100644 (file)
@@ -151,13 +151,13 @@ static int pstore_file_open(struct inode *inode, struct file *file)
        return 0;
 }
 
-static loff_t pstore_file_llseek(struct file *file, loff_t off, int origin)
+static loff_t pstore_file_llseek(struct file *file, loff_t off, int whence)
 {
        struct seq_file *sf = file->private_data;
 
        if (sf->op)
-               return seq_lseek(file, off, origin);
-       return default_llseek(file, off, origin);
+               return seq_lseek(file, off, whence);
+       return default_llseek(file, off, whence);
 }
 
 static const struct file_operations pstore_file_operations = {
index d06534857e9ed1e83563085f2ffdcfff4dc4ac7e..1edaf099ddd7f28d6dbeb41298269252773ecfa9 100644 (file)
@@ -54,7 +54,7 @@ static loff_t lseek_execute(struct file *file, struct inode *inode,
  * generic_file_llseek_size - generic llseek implementation for regular files
  * @file:      file structure to seek on
  * @offset:    file offset to seek to
- * @origin:    type of seek
+ * @whence:    type of seek
  * @size:      max size of this file in file system
  * @eof:       offset used for SEEK_END position
  *
@@ -67,12 +67,12 @@ static loff_t lseek_execute(struct file *file, struct inode *inode,
  * read/writes behave like SEEK_SET against seeks.
  */
 loff_t
-generic_file_llseek_size(struct file *file, loff_t offset, int origin,
+generic_file_llseek_size(struct file *file, loff_t offset, int whence,
                loff_t maxsize, loff_t eof)
 {
        struct inode *inode = file->f_mapping->host;
 
-       switch (origin) {
+       switch (whence) {
        case SEEK_END:
                offset += eof;
                break;
@@ -122,17 +122,17 @@ EXPORT_SYMBOL(generic_file_llseek_size);
  * generic_file_llseek - generic llseek implementation for regular files
  * @file:      file structure to seek on
  * @offset:    file offset to seek to
- * @origin:    type of seek
+ * @whence:    type of seek
  *
  * This is a generic implemenation of ->llseek useable for all normal local
  * filesystems.  It just updates the file offset to the value specified by
- * @offset and @origin under i_mutex.
+ * @offset and @whence under i_mutex.
  */
-loff_t generic_file_llseek(struct file *file, loff_t offset, int origin)
+loff_t generic_file_llseek(struct file *file, loff_t offset, int whence)
 {
        struct inode *inode = file->f_mapping->host;
 
-       return generic_file_llseek_size(file, offset, origin,
+       return generic_file_llseek_size(file, offset, whence,
                                        inode->i_sb->s_maxbytes,
                                        i_size_read(inode));
 }
@@ -142,32 +142,32 @@ EXPORT_SYMBOL(generic_file_llseek);
  * noop_llseek - No Operation Performed llseek implementation
  * @file:      file structure to seek on
  * @offset:    file offset to seek to
- * @origin:    type of seek
+ * @whence:    type of seek
  *
  * This is an implementation of ->llseek useable for the rare special case when
  * userspace expects the seek to succeed but the (device) file is actually not
  * able to perform the seek. In this case you use noop_llseek() instead of
  * falling back to the default implementation of ->llseek.
  */
-loff_t noop_llseek(struct file *file, loff_t offset, int origin)
+loff_t noop_llseek(struct file *file, loff_t offset, int whence)
 {
        return file->f_pos;
 }
 EXPORT_SYMBOL(noop_llseek);
 
-loff_t no_llseek(struct file *file, loff_t offset, int origin)
+loff_t no_llseek(struct file *file, loff_t offset, int whence)
 {
        return -ESPIPE;
 }
 EXPORT_SYMBOL(no_llseek);
 
-loff_t default_llseek(struct file *file, loff_t offset, int origin)
+loff_t default_llseek(struct file *file, loff_t offset, int whence)
 {
        struct inode *inode = file->f_path.dentry->d_inode;
        loff_t retval;
 
        mutex_lock(&inode->i_mutex);
-       switch (origin) {
+       switch (whence) {
                case SEEK_END:
                        offset += i_size_read(inode);
                        break;
@@ -216,7 +216,7 @@ out:
 }
 EXPORT_SYMBOL(default_llseek);
 
-loff_t vfs_llseek(struct file *file, loff_t offset, int origin)
+loff_t vfs_llseek(struct file *file, loff_t offset, int whence)
 {
        loff_t (*fn)(struct file *, loff_t, int);
 
@@ -225,11 +225,11 @@ loff_t vfs_llseek(struct file *file, loff_t offset, int origin)
                if (file->f_op && file->f_op->llseek)
                        fn = file->f_op->llseek;
        }
-       return fn(file, offset, origin);
+       return fn(file, offset, whence);
 }
 EXPORT_SYMBOL(vfs_llseek);
 
-SYSCALL_DEFINE3(lseek, unsigned int, fd, off_t, offset, unsigned int, origin)
+SYSCALL_DEFINE3(lseek, unsigned int, fd, off_t, offset, unsigned int, whence)
 {
        off_t retval;
        struct fd f = fdget(fd);
@@ -237,8 +237,8 @@ SYSCALL_DEFINE3(lseek, unsigned int, fd, off_t, offset, unsigned int, origin)
                return -EBADF;
 
        retval = -EINVAL;
-       if (origin <= SEEK_MAX) {
-               loff_t res = vfs_llseek(f.file, offset, origin);
+       if (whence <= SEEK_MAX) {
+               loff_t res = vfs_llseek(f.file, offset, whence);
                retval = res;
                if (res != (loff_t)retval)
                        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)
 #ifdef __ARCH_WANT_SYS_LLSEEK
 SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high,
                unsigned long, offset_low, loff_t __user *, result,
-               unsigned int, origin)
+               unsigned int, whence)
 {
        int retval;
        struct fd f = fdget(fd);
@@ -260,11 +260,11 @@ SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned long, offset_high,
                return -EBADF;
 
        retval = -EINVAL;
-       if (origin > SEEK_MAX)
+       if (whence > SEEK_MAX)
                goto out_putf;
 
        offset = vfs_llseek(f.file, ((loff_t) offset_high << 32) | offset_low,
-                       origin);
+                       whence);
 
        retval = (int)offset;
        if (offset >= 0) {
index 99dffab4c4e43a900121f7b8c1b8cb3e7ac147c5..9d863fb501f92ab9a9207fcce7d8b2087c637c0e 100644 (file)
@@ -300,14 +300,14 @@ EXPORT_SYMBOL(seq_read);
  *
  *     Ready-made ->f_op->llseek()
  */
-loff_t seq_lseek(struct file *file, loff_t offset, int origin)
+loff_t seq_lseek(struct file *file, loff_t offset, int whence)
 {
        struct seq_file *m = file->private_data;
        loff_t retval = -EINVAL;
 
        mutex_lock(&m->lock);
        m->version = file->f_version;
-       switch (origin) {
+       switch (whence) {
                case 1:
                        offset += file->f_pos;
                case 0:
index e271fba1651baf645e00f62659cc80825625ca71..8a574776a493199a90d1534574fc77d5c1a360d2 100644 (file)
@@ -453,11 +453,11 @@ out:
 }
 
 /* If a directory is seeked, we have to free saved readdir() state */
-static loff_t ubifs_dir_llseek(struct file *file, loff_t offset, int origin)
+static loff_t ubifs_dir_llseek(struct file *file, loff_t offset, int whence)
 {
        kfree(file->private_data);
        file->private_data = NULL;
-       return generic_file_llseek(file, offset, origin);
+       return generic_file_llseek(file, offset, whence);
 }
 
 /* Free saved readdir() state when the directory is closed */
index 408fb1e77a0a36804363d49d804e3ea3d3a802ab..029552ff774c0a7a29edbd7d108497e2ec70e4c0 100644 (file)
@@ -2286,9 +2286,9 @@ extern ino_t find_inode_number(struct dentry *, struct qstr *);
 #include <linux/err.h>
 
 /* needed for stackable file system support */
-extern loff_t default_llseek(struct file *file, loff_t offset, int origin);
+extern loff_t default_llseek(struct file *file, loff_t offset, int whence);
 
-extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin);
+extern loff_t vfs_llseek(struct file *file, loff_t offset, int whence);
 
 extern int inode_init_always(struct super_block *, struct inode *);
 extern void inode_init_once(struct inode *);
@@ -2396,11 +2396,11 @@ extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
 
 extern void
 file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
-extern loff_t noop_llseek(struct file *file, loff_t offset, int origin);
-extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
-extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
+extern loff_t noop_llseek(struct file *file, loff_t offset, int whence);
+extern loff_t no_llseek(struct file *file, loff_t offset, int whence);
+extern loff_t generic_file_llseek(struct file *file, loff_t offset, int whence);
 extern loff_t generic_file_llseek_size(struct file *file, loff_t offset,
-               int origin, loff_t maxsize, loff_t eof);
+               int whence, loff_t maxsize, loff_t eof);
 extern int generic_file_open(struct inode * inode, struct file * filp);
 extern int nonseekable_open(struct inode * inode, struct file * filp);
 
index a52f2f4fe0301d6fcb38c886fb912a1cdc65a79b..92691d85c32061f4d0acbe45ecccfcd78267240d 100644 (file)
@@ -394,7 +394,7 @@ ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf,
                            size_t cnt, loff_t *ppos);
 ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf,
                             size_t cnt, loff_t *ppos);
-loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int origin);
+loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int whence);
 int ftrace_regex_release(struct inode *inode, struct file *file);
 
 void __init
@@ -559,7 +559,7 @@ static inline ssize_t ftrace_filter_write(struct file *file, const char __user *
                            size_t cnt, loff_t *ppos) { return -ENODEV; }
 static inline ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf,
                             size_t cnt, loff_t *ppos) { return -ENODEV; }
-static inline loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int origin)
+static inline loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int whence)
 {
        return -ENODEV;
 }
index 91835e7f364d5523919735e2901492e634e85f7d..36c3b07c51191831457bf8602bf464d1473cc40f 100644 (file)
@@ -560,10 +560,10 @@ asmlinkage long sys_utime(char __user *filename,
 asmlinkage long sys_utimes(char __user *filename,
                                struct timeval __user *utimes);
 asmlinkage long sys_lseek(unsigned int fd, off_t offset,
-                         unsigned int origin);
+                         unsigned int whence);
 asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high,
                        unsigned long offset_low, loff_t __user *result,
-                       unsigned int origin);
+                       unsigned int whence);
 asmlinkage long sys_read(unsigned int fd, char __user *buf, size_t count);
 asmlinkage long sys_readahead(int fd, loff_t offset, size_t count);
 asmlinkage long sys_readv(unsigned long fd,
index afd092de45b71c45a9b3be6b70ed8dc0db085a0a..3ffe4c5ad3f37353d45d828407fb484ab811e441 100644 (file)
@@ -2675,12 +2675,12 @@ ftrace_notrace_open(struct inode *inode, struct file *file)
 }
 
 loff_t
-ftrace_regex_lseek(struct file *file, loff_t offset, int origin)
+ftrace_regex_lseek(struct file *file, loff_t offset, int whence)
 {
        loff_t ret;
 
        if (file->f_mode & FMODE_READ)
-               ret = seq_lseek(file, offset, origin);
+               ret = seq_lseek(file, offset, whence);
        else
                file->f_pos = ret = 1;
 
index 03f9ba8fb8e543d96d2fad317a2a19126cf99222..5c90d84c2b028ae6478b78cacdf52494bab2c233 100644 (file)
@@ -1719,7 +1719,7 @@ static ssize_t shmem_file_splice_read(struct file *in, loff_t *ppos,
  * llseek SEEK_DATA or SEEK_HOLE through the radix_tree.
  */
 static pgoff_t shmem_seek_hole_data(struct address_space *mapping,
-                                   pgoff_t index, pgoff_t end, int origin)
+                                   pgoff_t index, pgoff_t end, int whence)
 {
        struct page *page;
        struct pagevec pvec;
@@ -1733,13 +1733,13 @@ static pgoff_t shmem_seek_hole_data(struct address_space *mapping,
                pvec.nr = shmem_find_get_pages_and_swap(mapping, index,
                                        pvec.nr, pvec.pages, indices);
                if (!pvec.nr) {
-                       if (origin == SEEK_DATA)
+                       if (whence == SEEK_DATA)
                                index = end;
                        break;
                }
                for (i = 0; i < pvec.nr; i++, index++) {
                        if (index < indices[i]) {
-                               if (origin == SEEK_HOLE) {
+                               if (whence == SEEK_HOLE) {
                                        done = true;
                                        break;
                                }
@@ -1751,8 +1751,8 @@ static pgoff_t shmem_seek_hole_data(struct address_space *mapping,
                                        page = NULL;
                        }
                        if (index >= end ||
-                           (page && origin == SEEK_DATA) ||
-                           (!page && origin == SEEK_HOLE)) {
+                           (page && whence == SEEK_DATA) ||
+                           (!page && whence == SEEK_HOLE)) {
                                done = true;
                                break;
                        }
@@ -1765,15 +1765,15 @@ static pgoff_t shmem_seek_hole_data(struct address_space *mapping,
        return index;
 }
 
-static loff_t shmem_file_llseek(struct file *file, loff_t offset, int origin)
+static loff_t shmem_file_llseek(struct file *file, loff_t offset, int whence)
 {
        struct address_space *mapping = file->f_mapping;
        struct inode *inode = mapping->host;
        pgoff_t start, end;
        loff_t new_offset;
 
-       if (origin != SEEK_DATA && origin != SEEK_HOLE)
-               return generic_file_llseek_size(file, offset, origin,
+       if (whence != SEEK_DATA && whence != SEEK_HOLE)
+               return generic_file_llseek_size(file, offset, whence,
                                        MAX_LFS_FILESIZE, i_size_read(inode));
        mutex_lock(&inode->i_mutex);
        /* 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)
        else {
                start = offset >> PAGE_CACHE_SHIFT;
                end = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
-               new_offset = shmem_seek_hole_data(mapping, start, end, origin);
+               new_offset = shmem_seek_hole_data(mapping, start, end, whence);
                new_offset <<= PAGE_CACHE_SHIFT;
                if (new_offset > offset) {
                        if (new_offset < inode->i_size)
                                offset = new_offset;
-                       else if (origin == SEEK_DATA)
+                       else if (whence == SEEK_DATA)
                                offset = -ENXIO;
                        else
                                offset = inode->i_size;