aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2013-05-16 10:41:00 -0700
committerNicholas Bellinger <nab@linux-iscsi.org>2013-06-14 00:04:50 -0700
commit4dee96fb366ec6b5b324c8d4fe9e04244cb32f5d (patch)
treebe0361f660d94102ee403c4ce45dc5002d533bf3 /drivers/target
parenttarget: Remove t10_reservation.pr_aptpl_buf_len (diff)
downloadlinux-dev-4dee96fb366ec6b5b324c8d4fe9e04244cb32f5d.tar.xz
linux-dev-4dee96fb366ec6b5b324c8d4fe9e04244cb32f5d.zip
target: Remove unneeded param pr_aptpl_buf_len to write_aptpl_to_file()
As mentioned in the comments in update_and_write_aptpl, write_aptpl_to_file() calls strlen() on the buffer, and the length was always being passed as zero. Signed-off-by: Andy Grover <agrover@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_pr.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c
index 157368429a51..26c1f2d8920f 100644
--- a/drivers/target/target_core_pr.c
+++ b/drivers/target/target_core_pr.c
@@ -1932,13 +1932,13 @@ out:
*/
static int __core_scsi3_write_aptpl_to_file(
struct se_device *dev,
- unsigned char *buf,
- u32 pr_aptpl_buf_len)
+ unsigned char *buf)
{
struct t10_wwn *wwn = &dev->t10_wwn;
struct file *file;
int flags = O_RDWR | O_CREAT | O_TRUNC;
char path[512];
+ u32 pr_aptpl_buf_len;
int ret;
memset(path, 0, 512);
@@ -1957,8 +1957,7 @@ static int __core_scsi3_write_aptpl_to_file(
return PTR_ERR(file);
}
- if (!pr_aptpl_buf_len)
- pr_aptpl_buf_len = (strlen(&buf[0]) + 1); /* Add extra for NULL */
+ pr_aptpl_buf_len = (strlen(buf) + 1); /* Add extra for NULL */
ret = kernel_write(file, buf, pr_aptpl_buf_len, 0);
@@ -1993,7 +1992,7 @@ core_scsi3_update_and_write_aptpl(struct se_device *dev, unsigned char *in_buf,
* __core_scsi3_write_aptpl_to_file() will call strlen()
* on the passed buf to determine pr_aptpl_buf_len.
*/
- return __core_scsi3_write_aptpl_to_file(dev, buf, 0);
+ return __core_scsi3_write_aptpl_to_file(dev, buf);
}
static sense_reason_t