/* private llseek: 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)
/* private llseek: 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)
{
	struct inode *bd_inode = file->f_mapping->host;
	loff_t size;
	loff_t retval;
	mutex_lock(&bd_inode->i_mutex);
	size = i_size_read(bd_inode);
	switch (origin) {
		case 2:
			offset += size;
			break;
		case 1:
			offset += file->f_pos;
	}
	retval = -EINVAL;
	if (offset >= 0 && offset <= size) {
		if (offset != file->f_pos) {
			file->f_pos = offset;
		}
		retval = offset;
	}
	mutex_unlock(&bd_inode->i_mutex);
	return retval;
}