Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 965c8e59 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds
Browse files

lseek: the "whence" argument is called "whence"



But the kernel decided to call it "origin" instead.  Fix most of the
sites.

Acked-by: default avatarHugh Dickins <hughd@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c0f04160
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}
+2 −2
Original line number Diff line number Diff line
@@ -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;
+8 −8
Original line number Diff line number Diff line
@@ -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;
+2 −2
Original line number Diff line number Diff line
@@ -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;
+3 −3
Original line number Diff line number Diff line
@@ -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;
Loading