diff options
Diffstat (limited to 'drivers/target/target_core_pr.c')
-rw-r--r-- | drivers/target/target_core_pr.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index 68c71cd7a88e..b7c779389eea 100644 --- a/drivers/target/target_core_pr.c +++ b/drivers/target/target_core_pr.c | |||
@@ -1535,7 +1535,7 @@ static int core_scsi3_decode_spec_i_port( | |||
1535 | tidh_new->dest_local_nexus = 1; | 1535 | tidh_new->dest_local_nexus = 1; |
1536 | list_add_tail(&tidh_new->dest_list, &tid_dest_list); | 1536 | list_add_tail(&tidh_new->dest_list, &tid_dest_list); |
1537 | 1537 | ||
1538 | buf = transport_kmap_first_data_page(cmd); | 1538 | buf = transport_kmap_data_sg(cmd); |
1539 | /* | 1539 | /* |
1540 | * For a PERSISTENT RESERVE OUT specify initiator ports payload, | 1540 | * For a PERSISTENT RESERVE OUT specify initiator ports payload, |
1541 | * first extract TransportID Parameter Data Length, and make sure | 1541 | * first extract TransportID Parameter Data Length, and make sure |
@@ -1786,7 +1786,7 @@ static int core_scsi3_decode_spec_i_port( | |||
1786 | 1786 | ||
1787 | } | 1787 | } |
1788 | 1788 | ||
1789 | transport_kunmap_first_data_page(cmd); | 1789 | transport_kunmap_data_sg(cmd); |
1790 | 1790 | ||
1791 | /* | 1791 | /* |
1792 | * Go ahead and create a registrations from tid_dest_list for the | 1792 | * Go ahead and create a registrations from tid_dest_list for the |
@@ -1834,7 +1834,7 @@ static int core_scsi3_decode_spec_i_port( | |||
1834 | 1834 | ||
1835 | return 0; | 1835 | return 0; |
1836 | out: | 1836 | out: |
1837 | transport_kunmap_first_data_page(cmd); | 1837 | transport_kunmap_data_sg(cmd); |
1838 | /* | 1838 | /* |
1839 | * For the failure case, release everything from tid_dest_list | 1839 | * For the failure case, release everything from tid_dest_list |
1840 | * including *dest_pr_reg and the configfs dependances.. | 1840 | * including *dest_pr_reg and the configfs dependances.. |
@@ -3411,14 +3411,14 @@ static int core_scsi3_emulate_pro_register_and_move( | |||
3411 | * will be moved to for the TransportID containing SCSI initiator WWN | 3411 | * will be moved to for the TransportID containing SCSI initiator WWN |
3412 | * information. | 3412 | * information. |
3413 | */ | 3413 | */ |
3414 | buf = transport_kmap_first_data_page(cmd); | 3414 | buf = transport_kmap_data_sg(cmd); |
3415 | rtpi = (buf[18] & 0xff) << 8; | 3415 | rtpi = (buf[18] & 0xff) << 8; |
3416 | rtpi |= buf[19] & 0xff; | 3416 | rtpi |= buf[19] & 0xff; |
3417 | tid_len = (buf[20] & 0xff) << 24; | 3417 | tid_len = (buf[20] & 0xff) << 24; |
3418 | tid_len |= (buf[21] & 0xff) << 16; | 3418 | tid_len |= (buf[21] & 0xff) << 16; |
3419 | tid_len |= (buf[22] & 0xff) << 8; | 3419 | tid_len |= (buf[22] & 0xff) << 8; |
3420 | tid_len |= buf[23] & 0xff; | 3420 | tid_len |= buf[23] & 0xff; |
3421 | transport_kunmap_first_data_page(cmd); | 3421 | transport_kunmap_data_sg(cmd); |
3422 | buf = NULL; | 3422 | buf = NULL; |
3423 | 3423 | ||
3424 | if ((tid_len + 24) != cmd->data_length) { | 3424 | if ((tid_len + 24) != cmd->data_length) { |
@@ -3470,7 +3470,7 @@ static int core_scsi3_emulate_pro_register_and_move( | |||
3470 | return -EINVAL; | 3470 | return -EINVAL; |
3471 | } | 3471 | } |
3472 | 3472 | ||
3473 | buf = transport_kmap_first_data_page(cmd); | 3473 | buf = transport_kmap_data_sg(cmd); |
3474 | proto_ident = (buf[24] & 0x0f); | 3474 | proto_ident = (buf[24] & 0x0f); |
3475 | #if 0 | 3475 | #if 0 |
3476 | pr_debug("SPC-3 PR REGISTER_AND_MOVE: Extracted Protocol Identifier:" | 3476 | pr_debug("SPC-3 PR REGISTER_AND_MOVE: Extracted Protocol Identifier:" |
@@ -3504,7 +3504,7 @@ static int core_scsi3_emulate_pro_register_and_move( | |||
3504 | goto out; | 3504 | goto out; |
3505 | } | 3505 | } |
3506 | 3506 | ||
3507 | transport_kunmap_first_data_page(cmd); | 3507 | transport_kunmap_data_sg(cmd); |
3508 | buf = NULL; | 3508 | buf = NULL; |
3509 | 3509 | ||
3510 | pr_debug("SPC-3 PR [%s] Extracted initiator %s identifier: %s" | 3510 | pr_debug("SPC-3 PR [%s] Extracted initiator %s identifier: %s" |
@@ -3769,13 +3769,13 @@ after_iport_check: | |||
3769 | " REGISTER_AND_MOVE\n"); | 3769 | " REGISTER_AND_MOVE\n"); |
3770 | } | 3770 | } |
3771 | 3771 | ||
3772 | transport_kunmap_first_data_page(cmd); | 3772 | transport_kunmap_data_sg(cmd); |
3773 | 3773 | ||
3774 | core_scsi3_put_pr_reg(dest_pr_reg); | 3774 | core_scsi3_put_pr_reg(dest_pr_reg); |
3775 | return 0; | 3775 | return 0; |
3776 | out: | 3776 | out: |
3777 | if (buf) | 3777 | if (buf) |
3778 | transport_kunmap_first_data_page(cmd); | 3778 | transport_kunmap_data_sg(cmd); |
3779 | if (dest_se_deve) | 3779 | if (dest_se_deve) |
3780 | core_scsi3_lunacl_undepend_item(dest_se_deve); | 3780 | core_scsi3_lunacl_undepend_item(dest_se_deve); |
3781 | if (dest_node_acl) | 3781 | if (dest_node_acl) |
@@ -3849,7 +3849,7 @@ int target_scsi3_emulate_pr_out(struct se_task *task) | |||
3849 | scope = (cdb[2] & 0xf0); | 3849 | scope = (cdb[2] & 0xf0); |
3850 | type = (cdb[2] & 0x0f); | 3850 | type = (cdb[2] & 0x0f); |
3851 | 3851 | ||
3852 | buf = transport_kmap_first_data_page(cmd); | 3852 | buf = transport_kmap_data_sg(cmd); |
3853 | /* | 3853 | /* |
3854 | * From PERSISTENT_RESERVE_OUT parameter list (payload) | 3854 | * From PERSISTENT_RESERVE_OUT parameter list (payload) |
3855 | */ | 3855 | */ |
@@ -3867,7 +3867,7 @@ int target_scsi3_emulate_pr_out(struct se_task *task) | |||
3867 | aptpl = (buf[17] & 0x01); | 3867 | aptpl = (buf[17] & 0x01); |
3868 | unreg = (buf[17] & 0x02); | 3868 | unreg = (buf[17] & 0x02); |
3869 | } | 3869 | } |
3870 | transport_kunmap_first_data_page(cmd); | 3870 | transport_kunmap_data_sg(cmd); |
3871 | buf = NULL; | 3871 | buf = NULL; |
3872 | 3872 | ||
3873 | /* | 3873 | /* |
@@ -3967,7 +3967,7 @@ static int core_scsi3_pri_read_keys(struct se_cmd *cmd) | |||
3967 | return -EINVAL; | 3967 | return -EINVAL; |
3968 | } | 3968 | } |
3969 | 3969 | ||
3970 | buf = transport_kmap_first_data_page(cmd); | 3970 | buf = transport_kmap_data_sg(cmd); |
3971 | buf[0] = ((su_dev->t10_pr.pr_generation >> 24) & 0xff); | 3971 | buf[0] = ((su_dev->t10_pr.pr_generation >> 24) & 0xff); |
3972 | buf[1] = ((su_dev->t10_pr.pr_generation >> 16) & 0xff); | 3972 | buf[1] = ((su_dev->t10_pr.pr_generation >> 16) & 0xff); |
3973 | buf[2] = ((su_dev->t10_pr.pr_generation >> 8) & 0xff); | 3973 | buf[2] = ((su_dev->t10_pr.pr_generation >> 8) & 0xff); |
@@ -4001,7 +4001,7 @@ static int core_scsi3_pri_read_keys(struct se_cmd *cmd) | |||
4001 | buf[6] = ((add_len >> 8) & 0xff); | 4001 | buf[6] = ((add_len >> 8) & 0xff); |
4002 | buf[7] = (add_len & 0xff); | 4002 | buf[7] = (add_len & 0xff); |
4003 | 4003 | ||
4004 | transport_kunmap_first_data_page(cmd); | 4004 | transport_kunmap_data_sg(cmd); |
4005 | 4005 | ||
4006 | return 0; | 4006 | return 0; |
4007 | } | 4007 | } |
@@ -4027,7 +4027,7 @@ static int core_scsi3_pri_read_reservation(struct se_cmd *cmd) | |||
4027 | return -EINVAL; | 4027 | return -EINVAL; |
4028 | } | 4028 | } |
4029 | 4029 | ||
4030 | buf = transport_kmap_first_data_page(cmd); | 4030 | buf = transport_kmap_data_sg(cmd); |
4031 | buf[0] = ((su_dev->t10_pr.pr_generation >> 24) & 0xff); | 4031 | buf[0] = ((su_dev->t10_pr.pr_generation >> 24) & 0xff); |
4032 | buf[1] = ((su_dev->t10_pr.pr_generation >> 16) & 0xff); | 4032 | buf[1] = ((su_dev->t10_pr.pr_generation >> 16) & 0xff); |
4033 | buf[2] = ((su_dev->t10_pr.pr_generation >> 8) & 0xff); | 4033 | buf[2] = ((su_dev->t10_pr.pr_generation >> 8) & 0xff); |
@@ -4086,7 +4086,7 @@ static int core_scsi3_pri_read_reservation(struct se_cmd *cmd) | |||
4086 | 4086 | ||
4087 | err: | 4087 | err: |
4088 | spin_unlock(&se_dev->dev_reservation_lock); | 4088 | spin_unlock(&se_dev->dev_reservation_lock); |
4089 | transport_kunmap_first_data_page(cmd); | 4089 | transport_kunmap_data_sg(cmd); |
4090 | 4090 | ||
4091 | return 0; | 4091 | return 0; |
4092 | } | 4092 | } |
@@ -4110,7 +4110,7 @@ static int core_scsi3_pri_report_capabilities(struct se_cmd *cmd) | |||
4110 | return -EINVAL; | 4110 | return -EINVAL; |
4111 | } | 4111 | } |
4112 | 4112 | ||
4113 | buf = transport_kmap_first_data_page(cmd); | 4113 | buf = transport_kmap_data_sg(cmd); |
4114 | 4114 | ||
4115 | buf[0] = ((add_len << 8) & 0xff); | 4115 | buf[0] = ((add_len << 8) & 0xff); |
4116 | buf[1] = (add_len & 0xff); | 4116 | buf[1] = (add_len & 0xff); |
@@ -4142,7 +4142,7 @@ static int core_scsi3_pri_report_capabilities(struct se_cmd *cmd) | |||
4142 | buf[4] |= 0x02; /* PR_TYPE_WRITE_EXCLUSIVE */ | 4142 | buf[4] |= 0x02; /* PR_TYPE_WRITE_EXCLUSIVE */ |
4143 | buf[5] |= 0x01; /* PR_TYPE_EXCLUSIVE_ACCESS_ALLREG */ | 4143 | buf[5] |= 0x01; /* PR_TYPE_EXCLUSIVE_ACCESS_ALLREG */ |
4144 | 4144 | ||
4145 | transport_kunmap_first_data_page(cmd); | 4145 | transport_kunmap_data_sg(cmd); |
4146 | 4146 | ||
4147 | return 0; | 4147 | return 0; |
4148 | } | 4148 | } |
@@ -4172,7 +4172,7 @@ static int core_scsi3_pri_read_full_status(struct se_cmd *cmd) | |||
4172 | return -EINVAL; | 4172 | return -EINVAL; |
4173 | } | 4173 | } |
4174 | 4174 | ||
4175 | buf = transport_kmap_first_data_page(cmd); | 4175 | buf = transport_kmap_data_sg(cmd); |
4176 | 4176 | ||
4177 | buf[0] = ((su_dev->t10_pr.pr_generation >> 24) & 0xff); | 4177 | buf[0] = ((su_dev->t10_pr.pr_generation >> 24) & 0xff); |
4178 | buf[1] = ((su_dev->t10_pr.pr_generation >> 16) & 0xff); | 4178 | buf[1] = ((su_dev->t10_pr.pr_generation >> 16) & 0xff); |
@@ -4293,7 +4293,7 @@ static int core_scsi3_pri_read_full_status(struct se_cmd *cmd) | |||
4293 | buf[6] = ((add_len >> 8) & 0xff); | 4293 | buf[6] = ((add_len >> 8) & 0xff); |
4294 | buf[7] = (add_len & 0xff); | 4294 | buf[7] = (add_len & 0xff); |
4295 | 4295 | ||
4296 | transport_kunmap_first_data_page(cmd); | 4296 | transport_kunmap_data_sg(cmd); |
4297 | 4297 | ||
4298 | return 0; | 4298 | return 0; |
4299 | } | 4299 | } |