mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
bna: switch to fixed_size_llseek()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
3be1f2b81f
commit
c0caa07b6a
1 changed files with 1 additions and 21 deletions
|
@ -230,32 +230,12 @@ bnad_debugfs_open_drvinfo(struct inode *inode, struct file *file)
|
||||||
static loff_t
|
static loff_t
|
||||||
bnad_debugfs_lseek(struct file *file, loff_t offset, int orig)
|
bnad_debugfs_lseek(struct file *file, loff_t offset, int orig)
|
||||||
{
|
{
|
||||||
loff_t pos = file->f_pos;
|
|
||||||
struct bnad_debug_info *debug = file->private_data;
|
struct bnad_debug_info *debug = file->private_data;
|
||||||
|
|
||||||
if (!debug)
|
if (!debug)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
switch (orig) {
|
return fixed_size_llseek(file, offset, orig, debug->buffer_len);
|
||||||
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
|
||||||
|
|
Loading…
Add table
Reference in a new issue