@@ -168,7 +168,6 @@ cifs_dump_iface(struct seq_file *m, struct cifs_server_iface *iface)
168168
169169static int cifs_debug_files_proc_show (struct seq_file * m , void * v )
170170{
171- struct list_head * tmp , * tmp1 , * tmp2 ;
172171 struct TCP_Server_Info * server ;
173172 struct cifs_ses * ses ;
174173 struct cifs_tcon * tcon ;
@@ -184,14 +183,10 @@ static int cifs_debug_files_proc_show(struct seq_file *m, void *v)
184183#endif /* CIFS_DEBUG2 */
185184 spin_lock (& cifs_tcp_ses_lock );
186185 list_for_each_entry (server , & cifs_tcp_ses_list , tcp_ses_list ) {
187- list_for_each (tmp , & server -> smb_ses_list ) {
188- ses = list_entry (tmp , struct cifs_ses , smb_ses_list );
189- list_for_each (tmp1 , & ses -> tcon_list ) {
190- tcon = list_entry (tmp1 , struct cifs_tcon , tcon_list );
186+ list_for_each_entry (ses , & server -> smb_ses_list , smb_ses_list ) {
187+ list_for_each_entry (tcon , & ses -> tcon_list , tcon_list ) {
191188 spin_lock (& tcon -> open_file_lock );
192- list_for_each (tmp2 , & tcon -> openFileList ) {
193- cfile = list_entry (tmp2 , struct cifsFileInfo ,
194- tlist );
189+ list_for_each_entry (cfile , & tcon -> openFileList , tlist ) {
195190 seq_printf (m ,
196191 "0x%x 0x%llx 0x%x %d %d %d %pd" ,
197192 tcon -> tid ,
@@ -218,7 +213,6 @@ static int cifs_debug_files_proc_show(struct seq_file *m, void *v)
218213
219214static int cifs_debug_data_proc_show (struct seq_file * m , void * v )
220215{
221- struct list_head * tmp2 , * tmp3 ;
222216 struct mid_q_entry * mid_entry ;
223217 struct TCP_Server_Info * server ;
224218 struct cifs_ses * ses ;
@@ -381,9 +375,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
381375
382376 seq_printf (m , "\n\n\tSessions: " );
383377 i = 0 ;
384- list_for_each (tmp2 , & server -> smb_ses_list ) {
385- ses = list_entry (tmp2 , struct cifs_ses ,
386- smb_ses_list );
378+ list_for_each_entry (ses , & server -> smb_ses_list , smb_ses_list ) {
387379 i ++ ;
388380 if ((ses -> serverDomain == NULL ) ||
389381 (ses -> serverOS == NULL ) ||
@@ -447,9 +439,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
447439 else
448440 seq_puts (m , "none\n" );
449441
450- list_for_each (tmp3 , & ses -> tcon_list ) {
451- tcon = list_entry (tmp3 , struct cifs_tcon ,
452- tcon_list );
442+ list_for_each_entry (tcon , & ses -> tcon_list , tcon_list ) {
453443 ++ j ;
454444 seq_printf (m , "\n\t%d) " , j );
455445 cifs_debug_tcon (m , tcon );
@@ -474,9 +464,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
474464
475465 seq_puts (m , "\n\n\tMIDs: " );
476466 spin_lock (& GlobalMid_Lock );
477- list_for_each (tmp3 , & server -> pending_mid_q ) {
478- mid_entry = list_entry (tmp3 , struct mid_q_entry ,
479- qhead );
467+ list_for_each_entry (mid_entry , & server -> pending_mid_q , qhead ) {
480468 seq_printf (m , "\n\tState: %d com: %d pid:"
481469 " %d cbdata: %p mid %llu\n" ,
482470 mid_entry -> mid_state ,
@@ -504,7 +492,6 @@ static ssize_t cifs_stats_proc_write(struct file *file,
504492{
505493 bool bv ;
506494 int rc ;
507- struct list_head * tmp1 , * tmp2 , * tmp3 ;
508495 struct TCP_Server_Info * server ;
509496 struct cifs_ses * ses ;
510497 struct cifs_tcon * tcon ;
@@ -525,9 +512,7 @@ static ssize_t cifs_stats_proc_write(struct file *file,
525512 GlobalCurrentXid = 0 ;
526513 spin_unlock (& GlobalMid_Lock );
527514 spin_lock (& cifs_tcp_ses_lock );
528- list_for_each (tmp1 , & cifs_tcp_ses_list ) {
529- server = list_entry (tmp1 , struct TCP_Server_Info ,
530- tcp_ses_list );
515+ list_for_each_entry (server , & cifs_tcp_ses_list , tcp_ses_list ) {
531516 server -> max_in_flight = 0 ;
532517#ifdef CONFIG_CIFS_STATS2
533518 for (i = 0 ; i < NUMBER_OF_SMB2_COMMANDS ; i ++ ) {
@@ -538,13 +523,8 @@ static ssize_t cifs_stats_proc_write(struct file *file,
538523 server -> fastest_cmd [0 ] = 0 ;
539524 }
540525#endif /* CONFIG_CIFS_STATS2 */
541- list_for_each (tmp2 , & server -> smb_ses_list ) {
542- ses = list_entry (tmp2 , struct cifs_ses ,
543- smb_ses_list );
544- list_for_each (tmp3 , & ses -> tcon_list ) {
545- tcon = list_entry (tmp3 ,
546- struct cifs_tcon ,
547- tcon_list );
526+ list_for_each_entry (ses , & server -> smb_ses_list , smb_ses_list ) {
527+ list_for_each_entry (tcon , & ses -> tcon_list , tcon_list ) {
548528 atomic_set (& tcon -> num_smbs_sent , 0 );
549529 spin_lock (& tcon -> stat_lock );
550530 tcon -> bytes_read = 0 ;
@@ -569,7 +549,6 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
569549#ifdef CONFIG_CIFS_STATS2
570550 int j ;
571551#endif /* STATS2 */
572- struct list_head * tmp2 , * tmp3 ;
573552 struct TCP_Server_Info * server ;
574553 struct cifs_ses * ses ;
575554 struct cifs_tcon * tcon ;
@@ -619,13 +598,8 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
619598 atomic_read (& server -> smb2slowcmd [j ]),
620599 server -> hostname , j );
621600#endif /* STATS2 */
622- list_for_each (tmp2 , & server -> smb_ses_list ) {
623- ses = list_entry (tmp2 , struct cifs_ses ,
624- smb_ses_list );
625- list_for_each (tmp3 , & ses -> tcon_list ) {
626- tcon = list_entry (tmp3 ,
627- struct cifs_tcon ,
628- tcon_list );
601+ list_for_each_entry (ses , & server -> smb_ses_list , smb_ses_list ) {
602+ list_for_each_entry (tcon , & ses -> tcon_list , tcon_list ) {
629603 i ++ ;
630604 seq_printf (m , "\n%d) %s" , i , tcon -> treeName );
631605 if (tcon -> need_reconnect )
0 commit comments