summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-06-17 15:45:46 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2013-06-29 10:57:32 +0200
commitc04eba722f9b17cf07dd0e40bf497d5756cd8fe6 (patch)
tree47b2c794d7e965a22eb5c691fe47d3417fd1e4f4
parentfnic: switch to fixed_size_llseek() (diff)
downloadlinux-c04eba722f9b17cf07dd0e40bf497d5756cd8fe6.tar.xz
linux-c04eba722f9b17cf07dd0e40bf497d5756cd8fe6.zip
bfa: switch to fixed_size_llseek()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--drivers/scsi/bfa/bfad_debugfs.c28
1 files changed, 3 insertions, 25 deletions
diff --git a/drivers/scsi/bfa/bfad_debugfs.c b/drivers/scsi/bfa/bfad_debugfs.c
index b63d534192e3..8e83d0474fe7 100644
--- a/drivers/scsi/bfa/bfad_debugfs.c
+++ b/drivers/scsi/bfa/bfad_debugfs.c
@@ -173,31 +173,9 @@ bfad_debugfs_open_reg(struct inode *inode, struct file *file)
static loff_t
bfad_debugfs_lseek(struct file *file, loff_t offset, int orig)
{
- struct bfad_debug_info *debug;
- loff_t pos = file->f_pos;
-
- 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;
+ struct bfad_debug_info *debug = file->private_data;
+ return fixed_size_llseek(file, offset, orig,
+ debug->buffer_len);
}
static ssize_t