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