@@ -1549,74 +1549,6 @@ static void refresh_mounts(struct cifs_ses **sessions)
1549
1549
}
1550
1550
}
1551
1551
1552
- static void refresh_cache (struct cifs_ses * * sessions )
1553
- {
1554
- int i ;
1555
- struct cifs_ses * ses ;
1556
- unsigned int xid ;
1557
- char * ref_paths [CACHE_MAX_ENTRIES ];
1558
- int count = 0 ;
1559
- struct cache_entry * ce ;
1560
-
1561
- /*
1562
- * Refresh all cached entries. Get all new referrals outside critical section to avoid
1563
- * starvation while performing SMB2 IOCTL on broken or slow connections.
1564
-
1565
- * The cache entries may cover more paths than the active mounts
1566
- * (e.g. domain-based DFS referrals or multi tier DFS setups).
1567
- */
1568
- down_read (& htable_rw_lock );
1569
- for (i = 0 ; i < CACHE_HTABLE_SIZE ; i ++ ) {
1570
- struct hlist_head * l = & cache_htable [i ];
1571
-
1572
- hlist_for_each_entry (ce , l , hlist ) {
1573
- if (count == ARRAY_SIZE (ref_paths ))
1574
- goto out_unlock ;
1575
- if (hlist_unhashed (& ce -> hlist ) || !cache_entry_expired (ce ) ||
1576
- IS_ERR (find_ipc_from_server_path (sessions , ce -> path )))
1577
- continue ;
1578
- ref_paths [count ++ ] = kstrdup (ce -> path , GFP_ATOMIC );
1579
- }
1580
- }
1581
-
1582
- out_unlock :
1583
- up_read (& htable_rw_lock );
1584
-
1585
- for (i = 0 ; i < count ; i ++ ) {
1586
- char * path = ref_paths [i ];
1587
- struct dfs_info3_param * refs = NULL ;
1588
- int numrefs = 0 ;
1589
- int rc = 0 ;
1590
-
1591
- if (!path )
1592
- continue ;
1593
-
1594
- ses = find_ipc_from_server_path (sessions , path );
1595
- if (IS_ERR (ses ))
1596
- goto next_referral ;
1597
-
1598
- xid = get_xid ();
1599
- rc = get_dfs_referral (xid , ses , path , & refs , & numrefs );
1600
- free_xid (xid );
1601
-
1602
- if (!rc ) {
1603
- down_write (& htable_rw_lock );
1604
- ce = lookup_cache_entry (path );
1605
- /*
1606
- * We need to re-check it because other tasks might have it deleted or
1607
- * updated.
1608
- */
1609
- if (!IS_ERR (ce ) && cache_entry_expired (ce ))
1610
- update_cache_entry_locked (ce , refs , numrefs );
1611
- up_write (& htable_rw_lock );
1612
- }
1613
-
1614
- next_referral :
1615
- kfree (path );
1616
- free_dfs_info_array (refs , numrefs );
1617
- }
1618
- }
1619
-
1620
1552
/*
1621
1553
* Worker that will refresh DFS cache and active mounts based on lowest TTL value from a DFS
1622
1554
* referral.
@@ -1654,11 +1586,8 @@ static void refresh_cache_worker(struct work_struct *work)
1654
1586
i += count ;
1655
1587
}
1656
1588
1657
- if (sessions [0 ]) {
1658
- /* Refresh all active mounts and cached entries */
1589
+ if (sessions [0 ])
1659
1590
refresh_mounts (sessions );
1660
- refresh_cache (sessions );
1661
- }
1662
1591
1663
1592
list_for_each_entry_safe (mg , tmp_mg , & mglist , refresh_list ) {
1664
1593
list_del_init (& mg -> refresh_list );
0 commit comments