@@ -75,27 +75,6 @@ static struct cache_head *sunrpc_cache_find_rcu(struct cache_detail *detail,
7575 return NULL ;
7676}
7777
78- static struct cache_head * sunrpc_cache_find (struct cache_detail * detail ,
79- struct cache_head * key , int hash )
80- {
81- struct hlist_head * head = & detail -> hash_table [hash ];
82- struct cache_head * tmp ;
83-
84- read_lock (& detail -> hash_lock );
85- hlist_for_each_entry (tmp , head , cache_list ) {
86- if (detail -> match (tmp , key )) {
87- if (cache_is_expired (detail , tmp ))
88- /* This entry is expired, we will discard it. */
89- break ;
90- cache_get (tmp );
91- read_unlock (& detail -> hash_lock );
92- return tmp ;
93- }
94- }
95- read_unlock (& detail -> hash_lock );
96- return NULL ;
97- }
98-
9978static struct cache_head * sunrpc_cache_add_entry (struct cache_detail * detail ,
10079 struct cache_head * key ,
10180 int hash )
@@ -154,20 +133,6 @@ struct cache_head *sunrpc_cache_lookup_rcu(struct cache_detail *detail,
154133}
155134EXPORT_SYMBOL_GPL (sunrpc_cache_lookup_rcu );
156135
157- struct cache_head * sunrpc_cache_lookup (struct cache_detail * detail ,
158- struct cache_head * key , int hash )
159- {
160- struct cache_head * ret ;
161-
162- ret = sunrpc_cache_find (detail , key , hash );
163- if (ret )
164- return ret ;
165- /* Didn't find anything, insert an empty entry */
166- return sunrpc_cache_add_entry (detail , key , hash );
167- }
168- EXPORT_SYMBOL_GPL (sunrpc_cache_lookup );
169-
170-
171136static void cache_dequeue (struct cache_detail * detail , struct cache_head * ch );
172137
173138static void cache_fresh_locked (struct cache_head * head , time_t expiry ,
@@ -1369,17 +1334,7 @@ static void *__cache_seq_start(struct seq_file *m, loff_t *pos)
13691334 struct cache_head , cache_list );
13701335}
13711336
1372- void * cache_seq_start (struct seq_file * m , loff_t * pos )
1373- __acquires (cd - > hash_lock )
1374- {
1375- struct cache_detail * cd = m -> private ;
1376-
1377- read_lock (& cd -> hash_lock );
1378- return __cache_seq_start (m , pos );
1379- }
1380- EXPORT_SYMBOL_GPL (cache_seq_start );
1381-
1382- void * cache_seq_next (struct seq_file * m , void * p , loff_t * pos )
1337+ static void * cache_seq_next (struct seq_file * m , void * p , loff_t * pos )
13831338{
13841339 struct cache_head * ch = p ;
13851340 int hash = (* pos >> 32 );
@@ -1411,14 +1366,6 @@ void *cache_seq_next(struct seq_file *m, void *p, loff_t *pos)
14111366}
14121367EXPORT_SYMBOL_GPL (cache_seq_next );
14131368
1414- void cache_seq_stop (struct seq_file * m , void * p )
1415- __releases (cd - > hash_lock )
1416- {
1417- struct cache_detail * cd = m -> private ;
1418- read_unlock (& cd -> hash_lock );
1419- }
1420- EXPORT_SYMBOL_GPL (cache_seq_stop );
1421-
14221369void * cache_seq_start_rcu (struct seq_file * m , loff_t * pos )
14231370 __acquires (RCU )
14241371{
@@ -1466,9 +1413,9 @@ static int c_show(struct seq_file *m, void *p)
14661413}
14671414
14681415static const struct seq_operations cache_content_op = {
1469- .start = cache_seq_start ,
1470- .next = cache_seq_next ,
1471- .stop = cache_seq_stop ,
1416+ .start = cache_seq_start_rcu ,
1417+ .next = cache_seq_next_rcu ,
1418+ .stop = cache_seq_stop_rcu ,
14721419 .show = c_show ,
14731420};
14741421
0 commit comments