]> Git Repo - linux.git/blobdiff - net/sunrpc/auth.c
Merge tag 'mm-stable-2023-11-01-14-33' of git://git.kernel.org/pub/scm/linux/kernel...
[linux.git] / net / sunrpc / auth.c
index 814b0169f972304e105e1a63dfcf6ce59f3428cd..7bfe7d9a32aa601d352038b105dbcfe3604a0534 100644 (file)
@@ -866,11 +866,7 @@ rpcauth_uptodatecred(struct rpc_task *task)
                test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) != 0;
 }
 
-static struct shrinker rpc_cred_shrinker = {
-       .count_objects = rpcauth_cache_shrink_count,
-       .scan_objects = rpcauth_cache_shrink_scan,
-       .seeks = DEFAULT_SEEKS,
-};
+static struct shrinker *rpc_cred_shrinker;
 
 int __init rpcauth_init_module(void)
 {
@@ -879,9 +875,17 @@ int __init rpcauth_init_module(void)
        err = rpc_init_authunix();
        if (err < 0)
                goto out1;
-       err = register_shrinker(&rpc_cred_shrinker, "sunrpc_cred");
-       if (err < 0)
+       rpc_cred_shrinker = shrinker_alloc(0, "sunrpc_cred");
+       if (!rpc_cred_shrinker) {
+               err = -ENOMEM;
                goto out2;
+       }
+
+       rpc_cred_shrinker->count_objects = rpcauth_cache_shrink_count;
+       rpc_cred_shrinker->scan_objects = rpcauth_cache_shrink_scan;
+
+       shrinker_register(rpc_cred_shrinker);
+
        return 0;
 out2:
        rpc_destroy_authunix();
@@ -892,5 +896,5 @@ out1:
 void rpcauth_remove_module(void)
 {
        rpc_destroy_authunix();
-       unregister_shrinker(&rpc_cred_shrinker);
+       shrinker_free(rpc_cred_shrinker);
 }
This page took 0.033926 seconds and 4 git commands to generate.