@@ -53,16 +53,15 @@ struct pr_transport_id_holder {
53
53
struct list_head dest_list ;
54
54
};
55
55
56
- int core_pr_dump_initiator_port (
56
+ void core_pr_dump_initiator_port (
57
57
struct t10_pr_registration * pr_reg ,
58
58
char * buf ,
59
59
u32 size )
60
60
{
61
61
if (!pr_reg -> isid_present_at_reg )
62
- return 0 ;
62
+ buf [ 0 ] = '\0' ;
63
63
64
- snprintf (buf , size , ",i,0x%s" , & pr_reg -> pr_reg_isid [0 ]);
65
- return 1 ;
64
+ snprintf (buf , size , ",i,0x%s" , pr_reg -> pr_reg_isid );
66
65
}
67
66
68
67
enum register_type {
@@ -859,11 +858,9 @@ static void core_scsi3_aptpl_reserve(
859
858
struct t10_pr_registration * pr_reg )
860
859
{
861
860
char i_buf [PR_REG_ISID_ID_LEN ];
862
- int prf_isid ;
863
861
864
862
memset (i_buf , 0 , PR_REG_ISID_ID_LEN );
865
- prf_isid = core_pr_dump_initiator_port (pr_reg , & i_buf [0 ],
866
- PR_REG_ISID_ID_LEN );
863
+ core_pr_dump_initiator_port (pr_reg , i_buf , PR_REG_ISID_ID_LEN );
867
864
868
865
spin_lock (& dev -> dev_reservation_lock );
869
866
dev -> dev_pr_res_holder = pr_reg ;
@@ -876,7 +873,7 @@ static void core_scsi3_aptpl_reserve(
876
873
(pr_reg -> pr_reg_all_tg_pt ) ? 1 : 0 );
877
874
pr_debug ("SPC-3 PR [%s] RESERVE Node: %s%s\n" ,
878
875
tpg -> se_tpg_tfo -> get_fabric_name (), node_acl -> initiatorname ,
879
- ( prf_isid ) ? & i_buf [ 0 ] : "" );
876
+ i_buf );
880
877
}
881
878
882
879
static void __core_scsi3_add_registration (struct se_device * , struct se_node_acl * ,
@@ -977,17 +974,15 @@ static void __core_scsi3_dump_registration(
977
974
{
978
975
struct se_portal_group * se_tpg = nacl -> se_tpg ;
979
976
char i_buf [PR_REG_ISID_ID_LEN ];
980
- int prf_isid ;
981
977
982
978
memset (& i_buf [0 ], 0 , PR_REG_ISID_ID_LEN );
983
- prf_isid = core_pr_dump_initiator_port (pr_reg , & i_buf [0 ],
984
- PR_REG_ISID_ID_LEN );
979
+ core_pr_dump_initiator_port (pr_reg , i_buf , PR_REG_ISID_ID_LEN );
985
980
986
981
pr_debug ("SPC-3 PR [%s] Service Action: REGISTER%s Initiator"
987
982
" Node: %s%s\n" , tfo -> get_fabric_name (), (register_type == REGISTER_AND_MOVE ) ?
988
983
"_AND_MOVE" : (register_type == REGISTER_AND_IGNORE_EXISTING_KEY ) ?
989
984
"_AND_IGNORE_EXISTING_KEY" : "" , nacl -> initiatorname ,
990
- ( prf_isid ) ? i_buf : "" );
985
+ i_buf );
991
986
pr_debug ("SPC-3 PR [%s] registration on Target Port: %s,0x%04x\n" ,
992
987
tfo -> get_fabric_name (), tfo -> tpg_get_wwn (se_tpg ),
993
988
tfo -> tpg_get_tag (se_tpg ));
@@ -1236,11 +1231,9 @@ static void __core_scsi3_free_registration(
1236
1231
pr_reg -> pr_reg_nacl -> se_tpg -> se_tpg_tfo ;
1237
1232
struct t10_reservation * pr_tmpl = & dev -> t10_pr ;
1238
1233
char i_buf [PR_REG_ISID_ID_LEN ];
1239
- int prf_isid ;
1240
1234
1241
1235
memset (i_buf , 0 , PR_REG_ISID_ID_LEN );
1242
- prf_isid = core_pr_dump_initiator_port (pr_reg , & i_buf [0 ],
1243
- PR_REG_ISID_ID_LEN );
1236
+ core_pr_dump_initiator_port (pr_reg , i_buf , PR_REG_ISID_ID_LEN );
1244
1237
1245
1238
pr_reg -> pr_reg_deve -> def_pr_registered = 0 ;
1246
1239
pr_reg -> pr_reg_deve -> pr_res_key = 0 ;
@@ -1268,7 +1261,7 @@ static void __core_scsi3_free_registration(
1268
1261
pr_debug ("SPC-3 PR [%s] Service Action: UNREGISTER Initiator"
1269
1262
" Node: %s%s\n" , tfo -> get_fabric_name (),
1270
1263
pr_reg -> pr_reg_nacl -> initiatorname ,
1271
- ( prf_isid ) ? & i_buf [ 0 ] : "" );
1264
+ i_buf );
1272
1265
pr_debug ("SPC-3 PR [%s] for %s TCM Subsystem %s Object Target"
1273
1266
" Port(s)\n" , tfo -> get_fabric_name (),
1274
1267
(pr_reg -> pr_reg_all_tg_pt ) ? "ALL" : "SINGLE" ,
@@ -1464,7 +1457,7 @@ core_scsi3_decode_spec_i_port(
1464
1457
char * iport_ptr = NULL , dest_iport [64 ], i_buf [PR_REG_ISID_ID_LEN ];
1465
1458
sense_reason_t ret ;
1466
1459
u32 tpdl , tid_len = 0 ;
1467
- int dest_local_nexus , prf_isid ;
1460
+ int dest_local_nexus ;
1468
1461
u32 dest_rtpi = 0 ;
1469
1462
1470
1463
memset (dest_iport , 0 , 64 );
@@ -1775,17 +1768,15 @@ core_scsi3_decode_spec_i_port(
1775
1768
kfree (tidh );
1776
1769
1777
1770
memset (i_buf , 0 , PR_REG_ISID_ID_LEN );
1778
- prf_isid = core_pr_dump_initiator_port (dest_pr_reg , & i_buf [0 ],
1779
- PR_REG_ISID_ID_LEN );
1771
+ core_pr_dump_initiator_port (dest_pr_reg , i_buf , PR_REG_ISID_ID_LEN );
1780
1772
1781
1773
__core_scsi3_add_registration (cmd -> se_dev , dest_node_acl ,
1782
1774
dest_pr_reg , 0 , 0 );
1783
1775
1784
1776
pr_debug ("SPC-3 PR [%s] SPEC_I_PT: Successfully"
1785
1777
" registered Transport ID for Node: %s%s Mapped LUN:"
1786
1778
" %u\n" , dest_tpg -> se_tpg_tfo -> get_fabric_name (),
1787
- dest_node_acl -> initiatorname , (prf_isid ) ?
1788
- & i_buf [0 ] : "" , dest_se_deve -> mapped_lun );
1779
+ dest_node_acl -> initiatorname , i_buf , dest_se_deve -> mapped_lun );
1789
1780
1790
1781
if (dest_local_nexus )
1791
1782
continue ;
@@ -2351,7 +2342,6 @@ core_scsi3_pro_reserve(struct se_cmd *cmd, int type, int scope, u64 res_key)
2351
2342
struct t10_reservation * pr_tmpl = & dev -> t10_pr ;
2352
2343
char i_buf [PR_REG_ISID_ID_LEN ];
2353
2344
sense_reason_t ret ;
2354
- int prf_isid ;
2355
2345
2356
2346
memset (i_buf , 0 , PR_REG_ISID_ID_LEN );
2357
2347
@@ -2477,8 +2467,7 @@ core_scsi3_pro_reserve(struct se_cmd *cmd, int type, int scope, u64 res_key)
2477
2467
pr_reg -> pr_res_type = type ;
2478
2468
pr_reg -> pr_res_holder = 1 ;
2479
2469
dev -> dev_pr_res_holder = pr_reg ;
2480
- prf_isid = core_pr_dump_initiator_port (pr_reg , & i_buf [0 ],
2481
- PR_REG_ISID_ID_LEN );
2470
+ core_pr_dump_initiator_port (pr_reg , i_buf , PR_REG_ISID_ID_LEN );
2482
2471
2483
2472
pr_debug ("SPC-3 PR [%s] Service Action: RESERVE created new"
2484
2473
" reservation holder TYPE: %s ALL_TG_PT: %d\n" ,
@@ -2487,7 +2476,7 @@ core_scsi3_pro_reserve(struct se_cmd *cmd, int type, int scope, u64 res_key)
2487
2476
pr_debug ("SPC-3 PR [%s] RESERVE Node: %s%s\n" ,
2488
2477
cmd -> se_tfo -> get_fabric_name (),
2489
2478
se_sess -> se_node_acl -> initiatorname ,
2490
- ( prf_isid ) ? & i_buf [ 0 ] : "" );
2479
+ i_buf );
2491
2480
spin_unlock (& dev -> dev_reservation_lock );
2492
2481
2493
2482
if (pr_tmpl -> pr_aptpl_active ) {
@@ -2535,11 +2524,9 @@ static void __core_scsi3_complete_pro_release(
2535
2524
{
2536
2525
struct target_core_fabric_ops * tfo = se_nacl -> se_tpg -> se_tpg_tfo ;
2537
2526
char i_buf [PR_REG_ISID_ID_LEN ];
2538
- int prf_isid ;
2539
2527
2540
2528
memset (i_buf , 0 , PR_REG_ISID_ID_LEN );
2541
- prf_isid = core_pr_dump_initiator_port (pr_reg , & i_buf [0 ],
2542
- PR_REG_ISID_ID_LEN );
2529
+ core_pr_dump_initiator_port (pr_reg , i_buf , PR_REG_ISID_ID_LEN );
2543
2530
/*
2544
2531
* Go ahead and release the current PR reservation holder.
2545
2532
*/
@@ -2552,7 +2539,7 @@ static void __core_scsi3_complete_pro_release(
2552
2539
(pr_reg -> pr_reg_all_tg_pt ) ? 1 : 0 );
2553
2540
pr_debug ("SPC-3 PR [%s] RELEASE Node: %s%s\n" ,
2554
2541
tfo -> get_fabric_name (), se_nacl -> initiatorname ,
2555
- ( prf_isid ) ? & i_buf [ 0 ] : "" );
2542
+ i_buf );
2556
2543
/*
2557
2544
* Clear TYPE and SCOPE for the next PROUT Service Action: RESERVE
2558
2545
*/
@@ -2826,11 +2813,9 @@ static void __core_scsi3_complete_pro_preempt(
2826
2813
struct se_node_acl * nacl = pr_reg -> pr_reg_nacl ;
2827
2814
struct target_core_fabric_ops * tfo = nacl -> se_tpg -> se_tpg_tfo ;
2828
2815
char i_buf [PR_REG_ISID_ID_LEN ];
2829
- int prf_isid ;
2830
2816
2831
2817
memset (i_buf , 0 , PR_REG_ISID_ID_LEN );
2832
- prf_isid = core_pr_dump_initiator_port (pr_reg , & i_buf [0 ],
2833
- PR_REG_ISID_ID_LEN );
2818
+ core_pr_dump_initiator_port (pr_reg , i_buf , PR_REG_ISID_ID_LEN );
2834
2819
/*
2835
2820
* Do an implict RELEASE of the existing reservation.
2836
2821
*/
@@ -2850,7 +2835,7 @@ static void __core_scsi3_complete_pro_preempt(
2850
2835
(pr_reg -> pr_reg_all_tg_pt ) ? 1 : 0 );
2851
2836
pr_debug ("SPC-3 PR [%s] PREEMPT%s from Node: %s%s\n" ,
2852
2837
tfo -> get_fabric_name (), (preempt_type == PREEMPT_AND_ABORT ) ? "_AND_ABORT" : "" ,
2853
- nacl -> initiatorname , ( prf_isid ) ? & i_buf [ 0 ] : "" );
2838
+ nacl -> initiatorname , i_buf );
2854
2839
/*
2855
2840
* For PREEMPT_AND_ABORT, add the preempting reservation's
2856
2841
* struct t10_pr_registration to the list that will be compared
@@ -3231,7 +3216,7 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key,
3231
3216
unsigned char * initiator_str ;
3232
3217
char * iport_ptr = NULL , dest_iport [64 ], i_buf [PR_REG_ISID_ID_LEN ];
3233
3218
u32 tid_len , tmp_tid_len ;
3234
- int new_reg = 0 , type , scope , matching_iname , prf_isid ;
3219
+ int new_reg = 0 , type , scope , matching_iname ;
3235
3220
sense_reason_t ret ;
3236
3221
unsigned short rtpi ;
3237
3222
unsigned char proto_ident ;
@@ -3575,8 +3560,7 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key,
3575
3560
dest_pr_reg -> pr_res_holder = 1 ;
3576
3561
dest_pr_reg -> pr_res_type = type ;
3577
3562
pr_reg -> pr_res_scope = scope ;
3578
- prf_isid = core_pr_dump_initiator_port (pr_reg , & i_buf [0 ],
3579
- PR_REG_ISID_ID_LEN );
3563
+ core_pr_dump_initiator_port (pr_reg , i_buf , PR_REG_ISID_ID_LEN );
3580
3564
/*
3581
3565
* Increment PRGeneration for existing registrations..
3582
3566
*/
@@ -3592,7 +3576,7 @@ core_scsi3_emulate_pro_register_and_move(struct se_cmd *cmd, u64 res_key,
3592
3576
pr_debug ("SPC-3 PR Successfully moved reservation from"
3593
3577
" %s Fabric Node: %s%s -> %s Fabric Node: %s %s\n" ,
3594
3578
tf_ops -> get_fabric_name (), pr_reg_nacl -> initiatorname ,
3595
- ( prf_isid ) ? & i_buf [ 0 ] : "" , dest_tf_ops -> get_fabric_name (),
3579
+ i_buf , dest_tf_ops -> get_fabric_name (),
3596
3580
dest_node_acl -> initiatorname , (iport_ptr != NULL ) ?
3597
3581
iport_ptr : "" );
3598
3582
/*
0 commit comments