@@ -75,7 +75,7 @@ transport_lookup_cmd_lun(struct se_cmd *se_cmd)
7575 return TCM_WRITE_PROTECTED ;
7676 }
7777
78- se_lun = rcu_dereference ( deve -> se_lun ) ;
78+ se_lun = deve -> se_lun ;
7979
8080 if (!percpu_ref_tryget_live (& se_lun -> lun_ref )) {
8181 se_lun = NULL ;
@@ -152,7 +152,7 @@ int transport_lookup_tmr_lun(struct se_cmd *se_cmd)
152152 rcu_read_lock ();
153153 deve = target_nacl_find_deve (nacl , se_cmd -> orig_fe_lun );
154154 if (deve ) {
155- se_lun = rcu_dereference ( deve -> se_lun ) ;
155+ se_lun = deve -> se_lun ;
156156
157157 if (!percpu_ref_tryget_live (& se_lun -> lun_ref )) {
158158 se_lun = NULL ;
@@ -216,7 +216,7 @@ struct se_dev_entry *core_get_se_deve_from_rtpi(
216216
217217 rcu_read_lock ();
218218 hlist_for_each_entry_rcu (deve , & nacl -> lun_entry_hlist , link ) {
219- lun = rcu_dereference ( deve -> se_lun ) ;
219+ lun = deve -> se_lun ;
220220 if (!lun ) {
221221 pr_err ("%s device entries device pointer is"
222222 " NULL, but Initiator has access.\n" ,
@@ -243,11 +243,8 @@ void core_free_device_list_for_node(
243243 struct se_dev_entry * deve ;
244244
245245 mutex_lock (& nacl -> lun_entry_mutex );
246- hlist_for_each_entry_rcu (deve , & nacl -> lun_entry_hlist , link ) {
247- struct se_lun * lun = rcu_dereference_check (deve -> se_lun ,
248- lockdep_is_held (& nacl -> lun_entry_mutex ));
249- core_disable_device_list_for_node (lun , deve , nacl , tpg );
250- }
246+ hlist_for_each_entry_rcu (deve , & nacl -> lun_entry_hlist , link )
247+ core_disable_device_list_for_node (deve -> se_lun , deve , nacl , tpg );
251248 mutex_unlock (& nacl -> lun_entry_mutex );
252249}
253250
@@ -334,8 +331,7 @@ int core_enable_device_list_for_node(
334331 mutex_lock (& nacl -> lun_entry_mutex );
335332 orig = target_nacl_find_deve (nacl , mapped_lun );
336333 if (orig && orig -> se_lun ) {
337- struct se_lun * orig_lun = rcu_dereference_check (orig -> se_lun ,
338- lockdep_is_held (& nacl -> lun_entry_mutex ));
334+ struct se_lun * orig_lun = orig -> se_lun ;
339335
340336 if (orig_lun != lun ) {
341337 pr_err ("Existing orig->se_lun doesn't match new lun"
@@ -355,8 +351,8 @@ int core_enable_device_list_for_node(
355351 return - EINVAL ;
356352 }
357353
358- rcu_assign_pointer ( new -> se_lun , lun ) ;
359- rcu_assign_pointer ( new -> se_lun_acl , lun_acl ) ;
354+ new -> se_lun = lun ;
355+ new -> se_lun_acl = lun_acl ;
360356 hlist_del_rcu (& orig -> link );
361357 hlist_add_head_rcu (& new -> link , & nacl -> lun_entry_hlist );
362358 mutex_unlock (& nacl -> lun_entry_mutex );
@@ -374,8 +370,8 @@ int core_enable_device_list_for_node(
374370 return 0 ;
375371 }
376372
377- rcu_assign_pointer ( new -> se_lun , lun ) ;
378- rcu_assign_pointer ( new -> se_lun_acl , lun_acl ) ;
373+ new -> se_lun = lun ;
374+ new -> se_lun_acl = lun_acl ;
379375 hlist_add_head_rcu (& new -> link , & nacl -> lun_entry_hlist );
380376 mutex_unlock (& nacl -> lun_entry_mutex );
381377
@@ -454,10 +450,7 @@ void core_clear_lun_from_tpg(struct se_lun *lun, struct se_portal_group *tpg)
454450
455451 mutex_lock (& nacl -> lun_entry_mutex );
456452 hlist_for_each_entry_rcu (deve , & nacl -> lun_entry_hlist , link ) {
457- struct se_lun * tmp_lun = rcu_dereference_check (deve -> se_lun ,
458- lockdep_is_held (& nacl -> lun_entry_mutex ));
459-
460- if (lun != tmp_lun )
453+ if (lun != deve -> se_lun )
461454 continue ;
462455
463456 core_disable_device_list_for_node (lun , deve , nacl , tpg );
0 commit comments