From eb5881d37fe2c8c43c92bb7f2c87fba90a2103f2 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 17 Jun 2013 17:44:23 +0400 Subject: fnic: switch to fixed_size_llseek() Signed-off-by: Al Viro --- drivers/scsi/fnic/fnic_debugfs.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'drivers/scsi') diff --git a/drivers/scsi/fnic/fnic_debugfs.c b/drivers/scsi/fnic/fnic_debugfs.c index 85e1ffd0e5c..cbcb0121c84 100644 --- a/drivers/scsi/fnic/fnic_debugfs.c +++ b/drivers/scsi/fnic/fnic_debugfs.c @@ -164,20 +164,8 @@ static loff_t fnic_trace_debugfs_lseek(struct file *file, int howto) { fnic_dbgfs_t *fnic_dbg_prt = file->private_data; - loff_t pos = -1; - - switch (howto) { - case 0: - pos = offset; - break; - case 1: - pos = file->f_pos + offset; - break; - case 2: - pos = fnic_dbg_prt->buffer_len + offset; - } - return (pos < 0 || pos > fnic_dbg_prt->buffer_len) ? - -EINVAL : (file->f_pos = pos); + return fixed_size_llseek(file, offset, howto, + fnic_dbg_prt->buffer_len); } /* -- cgit v1.2.3-70-g09d2 From c04eba722f9b17cf07dd0e40bf497d5756cd8fe6 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 17 Jun 2013 17:45:46 +0400 Subject: bfa: switch to fixed_size_llseek() Signed-off-by: Al Viro --- drivers/scsi/bfa/bfad_debugfs.c | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) (limited to 'drivers/scsi') diff --git a/drivers/scsi/bfa/bfad_debugfs.c b/drivers/scsi/bfa/bfad_debugfs.c index b63d534192e..8e83d0474fe 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 -- cgit v1.2.3-70-g09d2 From 7233c774080820b611f85a0a057ff4b43e9276f2 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 23 Jun 2013 12:08:05 +0400 Subject: lpfc: switch to fixed_size_llseek() Signed-off-by: Al Viro --- drivers/scsi/lpfc/lpfc_debugfs.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'drivers/scsi') diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c index f525ecb7a9c..60084e6ad2f 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c @@ -1165,22 +1165,8 @@ out: static loff_t lpfc_debugfs_lseek(struct file *file, loff_t off, int whence) { - struct lpfc_debug *debug; - loff_t pos = -1; - - debug = file->private_data; - - switch (whence) { - case 0: - pos = off; - break; - case 1: - pos = file->f_pos + off; - break; - case 2: - pos = debug->len + off; - } - return (pos < 0 || pos > debug->len) ? -EINVAL : (file->f_pos = pos); + struct lpfc_debug *debug = file->private_data; + return fixed_size_llseek(file, off, whence, debug->len); } /** -- cgit v1.2.3-70-g09d2