|
40 | 40 | #define EXPKEY_HASHMAX (1 << EXPKEY_HASHBITS)
|
41 | 41 | #define EXPKEY_HASHMASK (EXPKEY_HASHMAX -1)
|
42 | 42 |
|
43 |
| -static void expkey_put_work(struct work_struct *work) |
| 43 | +static void expkey_put(struct kref *ref) |
44 | 44 | {
|
45 |
| - struct svc_expkey *key = |
46 |
| - container_of(to_rcu_work(work), struct svc_expkey, ek_rcu_work); |
| 45 | + struct svc_expkey *key = container_of(ref, struct svc_expkey, h.ref); |
47 | 46 |
|
48 | 47 | if (test_bit(CACHE_VALID, &key->h.flags) &&
|
49 | 48 | !test_bit(CACHE_NEGATIVE, &key->h.flags))
|
50 | 49 | path_put(&key->ek_path);
|
51 | 50 | auth_domain_put(key->ek_client);
|
52 |
| - kfree(key); |
53 |
| -} |
54 |
| - |
55 |
| -static void expkey_put(struct kref *ref) |
56 |
| -{ |
57 |
| - struct svc_expkey *key = container_of(ref, struct svc_expkey, h.ref); |
58 |
| - |
59 |
| - INIT_RCU_WORK(&key->ek_rcu_work, expkey_put_work); |
60 |
| - queue_rcu_work(system_wq, &key->ek_rcu_work); |
| 51 | + kfree_rcu(key, ek_rcu); |
61 | 52 | }
|
62 | 53 |
|
63 | 54 | static int expkey_upcall(struct cache_detail *cd, struct cache_head *h)
|
@@ -364,26 +355,16 @@ static void export_stats_destroy(struct export_stats *stats)
|
364 | 355 | EXP_STATS_COUNTERS_NUM);
|
365 | 356 | }
|
366 | 357 |
|
367 |
| -static void svc_export_put_work(struct work_struct *work) |
| 358 | +static void svc_export_put(struct kref *ref) |
368 | 359 | {
|
369 |
| - struct svc_export *exp = |
370 |
| - container_of(to_rcu_work(work), struct svc_export, ex_rcu_work); |
371 |
| - |
| 360 | + struct svc_export *exp = container_of(ref, struct svc_export, h.ref); |
372 | 361 | path_put(&exp->ex_path);
|
373 | 362 | auth_domain_put(exp->ex_client);
|
374 | 363 | nfsd4_fslocs_free(&exp->ex_fslocs);
|
375 | 364 | export_stats_destroy(exp->ex_stats);
|
376 | 365 | kfree(exp->ex_stats);
|
377 | 366 | kfree(exp->ex_uuid);
|
378 |
| - kfree(exp); |
379 |
| -} |
380 |
| - |
381 |
| -static void svc_export_put(struct kref *ref) |
382 |
| -{ |
383 |
| - struct svc_export *exp = container_of(ref, struct svc_export, h.ref); |
384 |
| - |
385 |
| - INIT_RCU_WORK(&exp->ex_rcu_work, svc_export_put_work); |
386 |
| - queue_rcu_work(system_wq, &exp->ex_rcu_work); |
| 367 | + kfree_rcu(exp, ex_rcu); |
387 | 368 | }
|
388 | 369 |
|
389 | 370 | static int svc_export_upcall(struct cache_detail *cd, struct cache_head *h)
|
|
0 commit comments