/* also note that seeking relative to the "end of file" isn't supported: it has no meaning, so it returns -EINVAL.  */
static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
/* also note that seeking relative to the "end of file" isn't supported: it has no meaning, so it returns -EINVAL.  */
static loff_t memory_lseek(struct file *file, loff_t offset, int orig)
{
	loff_t ret;
	mutex_lock(&file->f_path.dentry->d_inode->i_mutex);
	switch (orig) {
		case 0:
			file->f_pos = offset;
			ret = file->f_pos;
			force_successful_syscall_return();
			break;
		case 1:
			file->f_pos += offset;
			ret = file->f_pos;
			force_successful_syscall_return();
			break;
		default:
			ret = -EINVAL;
	}
	mutex_unlock(&file->f_path.dentry->d_inode->i_mutex);
	return ret;
}