bfa: switch to fixed_size_llseek()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 17 Jun 2013 13:45:46 +0000 (17:45 +0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 29 Jun 2013 08:57:32 +0000 (12:57 +0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/scsi/bfa/bfad_debugfs.c

index b63d534192e33a8defea70b6c0195293392ea98e..8e83d0474fe7c57560714dd488d4db1fcc1f4d15 100644 (file)
@@ -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