]> rtime.felk.cvut.cz Git - linux-imx.git/blobdiff - fs/btrfs/file.c
vfs: export lseek_execute() to modules
[linux-imx.git] / fs / btrfs / file.c
index 4205ba752d40ccbadfb0fa0b1f053b1022c553c0..89da56a58b635c9bf80197c0cf32e2dc3f698442 100644 (file)
@@ -2425,20 +2425,7 @@ static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int whence)
                }
        }
 
-       if (offset < 0 && !(file->f_mode & FMODE_UNSIGNED_OFFSET)) {
-               offset = -EINVAL;
-               goto out;
-       }
-       if (offset > inode->i_sb->s_maxbytes) {
-               offset = -EINVAL;
-               goto out;
-       }
-
-       /* Special lock needed here? */
-       if (offset != file->f_pos) {
-               file->f_pos = offset;
-               file->f_version = 0;
-       }
+       offset = vfs_setpos(file, offset, inode->i_sb->s_maxbytes);
 out:
        mutex_unlock(&inode->i_mutex);
        return offset;