@@ -75,27 +75,6 @@ static struct cache_head *sunrpc_cache_find_rcu(struct cache_detail *detail,
75
75
return NULL ;
76
76
}
77
77
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
-
99
78
static struct cache_head * sunrpc_cache_add_entry (struct cache_detail * detail ,
100
79
struct cache_head * key ,
101
80
int hash )
@@ -154,20 +133,6 @@ struct cache_head *sunrpc_cache_lookup_rcu(struct cache_detail *detail,
154
133
}
155
134
EXPORT_SYMBOL_GPL (sunrpc_cache_lookup_rcu );
156
135
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
-
171
136
static void cache_dequeue (struct cache_detail * detail , struct cache_head * ch );
172
137
173
138
static 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)
1369
1334
struct cache_head , cache_list );
1370
1335
}
1371
1336
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 )
1383
1338
{
1384
1339
struct cache_head * ch = p ;
1385
1340
int hash = (* pos >> 32 );
@@ -1411,14 +1366,6 @@ void *cache_seq_next(struct seq_file *m, void *p, loff_t *pos)
1411
1366
}
1412
1367
EXPORT_SYMBOL_GPL (cache_seq_next );
1413
1368
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
-
1422
1369
void * cache_seq_start_rcu (struct seq_file * m , loff_t * pos )
1423
1370
__acquires (RCU )
1424
1371
{
@@ -1466,9 +1413,9 @@ static int c_show(struct seq_file *m, void *p)
1466
1413
}
1467
1414
1468
1415
static 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 ,
1472
1419
.show = c_show ,
1473
1420
};
1474
1421
0 commit comments