提交 c04eba72 编写于 作者: A Al Viro

bfa: switch to fixed_size_llseek()

Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 eb5881d3
...@@ -173,31 +173,9 @@ bfad_debugfs_open_reg(struct inode *inode, struct file *file) ...@@ -173,31 +173,9 @@ bfad_debugfs_open_reg(struct inode *inode, struct file *file)
static loff_t static loff_t
bfad_debugfs_lseek(struct file *file, loff_t offset, int orig) bfad_debugfs_lseek(struct file *file, loff_t offset, int orig)
{ {
struct bfad_debug_info *debug; struct bfad_debug_info *debug = file->private_data;
loff_t pos = file->f_pos; return fixed_size_llseek(file, offset, orig,
debug->buffer_len);
debug = file->private_data;
switch (orig) {
case 0:
file->f_pos = offset;
break;
case 1:
file->f_pos += offset;
break;
case 2:
file->f_pos = debug->buffer_len + offset;
break;
default:
return -EINVAL;
}
if (file->f_pos < 0 || file->f_pos > debug->buffer_len) {
file->f_pos = pos;
return -EINVAL;
}
return file->f_pos;
} }
static ssize_t static ssize_t
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册