@@ -168,7 +168,6 @@ cifs_dump_iface(struct seq_file *m, struct cifs_server_iface *iface)
168
168
169
169
static int cifs_debug_files_proc_show (struct seq_file * m , void * v )
170
170
{
171
- struct list_head * tmp , * tmp1 , * tmp2 ;
172
171
struct TCP_Server_Info * server ;
173
172
struct cifs_ses * ses ;
174
173
struct cifs_tcon * tcon ;
@@ -184,14 +183,10 @@ static int cifs_debug_files_proc_show(struct seq_file *m, void *v)
184
183
#endif /* CIFS_DEBUG2 */
185
184
spin_lock (& cifs_tcp_ses_lock );
186
185
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 ) {
191
188
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 ) {
195
190
seq_printf (m ,
196
191
"0x%x 0x%llx 0x%x %d %d %d %pd" ,
197
192
tcon -> tid ,
@@ -218,7 +213,6 @@ static int cifs_debug_files_proc_show(struct seq_file *m, void *v)
218
213
219
214
static int cifs_debug_data_proc_show (struct seq_file * m , void * v )
220
215
{
221
- struct list_head * tmp2 , * tmp3 ;
222
216
struct mid_q_entry * mid_entry ;
223
217
struct TCP_Server_Info * server ;
224
218
struct cifs_ses * ses ;
@@ -381,9 +375,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
381
375
382
376
seq_printf (m , "\n\n\tSessions: " );
383
377
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 ) {
387
379
i ++ ;
388
380
if ((ses -> serverDomain == NULL ) ||
389
381
(ses -> serverOS == NULL ) ||
@@ -447,9 +439,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
447
439
else
448
440
seq_puts (m , "none\n" );
449
441
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 ) {
453
443
++ j ;
454
444
seq_printf (m , "\n\t%d) " , j );
455
445
cifs_debug_tcon (m , tcon );
@@ -474,9 +464,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
474
464
475
465
seq_puts (m , "\n\n\tMIDs: " );
476
466
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 ) {
480
468
seq_printf (m , "\n\tState: %d com: %d pid:"
481
469
" %d cbdata: %p mid %llu\n" ,
482
470
mid_entry -> mid_state ,
@@ -504,7 +492,6 @@ static ssize_t cifs_stats_proc_write(struct file *file,
504
492
{
505
493
bool bv ;
506
494
int rc ;
507
- struct list_head * tmp1 , * tmp2 , * tmp3 ;
508
495
struct TCP_Server_Info * server ;
509
496
struct cifs_ses * ses ;
510
497
struct cifs_tcon * tcon ;
@@ -525,9 +512,7 @@ static ssize_t cifs_stats_proc_write(struct file *file,
525
512
GlobalCurrentXid = 0 ;
526
513
spin_unlock (& GlobalMid_Lock );
527
514
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 ) {
531
516
server -> max_in_flight = 0 ;
532
517
#ifdef CONFIG_CIFS_STATS2
533
518
for (i = 0 ; i < NUMBER_OF_SMB2_COMMANDS ; i ++ ) {
@@ -538,13 +523,8 @@ static ssize_t cifs_stats_proc_write(struct file *file,
538
523
server -> fastest_cmd [0 ] = 0 ;
539
524
}
540
525
#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 ) {
548
528
atomic_set (& tcon -> num_smbs_sent , 0 );
549
529
spin_lock (& tcon -> stat_lock );
550
530
tcon -> bytes_read = 0 ;
@@ -569,7 +549,6 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
569
549
#ifdef CONFIG_CIFS_STATS2
570
550
int j ;
571
551
#endif /* STATS2 */
572
- struct list_head * tmp2 , * tmp3 ;
573
552
struct TCP_Server_Info * server ;
574
553
struct cifs_ses * ses ;
575
554
struct cifs_tcon * tcon ;
@@ -619,13 +598,8 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
619
598
atomic_read (& server -> smb2slowcmd [j ]),
620
599
server -> hostname , j );
621
600
#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 ) {
629
603
i ++ ;
630
604
seq_printf (m , "\n%d) %s" , i , tcon -> treeName );
631
605
if (tcon -> need_reconnect )
0 commit comments