Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * linux/net/sunrpc/sunrpc_syms.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * Symbols exported by the sunrpc module.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * Copyright (C) 1997 Olaf Kirch <okir@monad.swb.de>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/uio.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/unistd.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <linux/sunrpc/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) #include <linux/sunrpc/clnt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include <linux/sunrpc/svc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) #include <linux/sunrpc/svcsock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #include <linux/sunrpc/auth.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) #include <linux/workqueue.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #include <linux/sunrpc/rpc_pipe_fs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #include <linux/sunrpc/xprtsock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) #include "sunrpc.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #include "netns.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) unsigned int sunrpc_net_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) EXPORT_SYMBOL_GPL(sunrpc_net_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) static __net_init int sunrpc_init_net(struct net *net)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	int err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	err = rpc_proc_init(net);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 		goto err_proc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	err = ip_map_cache_create(net);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 		goto err_ipmap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	err = unix_gid_cache_create(net);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 		goto err_unixgid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	err = rpc_pipefs_init_net(net);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 		goto err_pipefs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	INIT_LIST_HEAD(&sn->all_clients);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	spin_lock_init(&sn->rpc_client_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	spin_lock_init(&sn->rpcb_clnt_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) err_pipefs:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	unix_gid_cache_destroy(net);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) err_unixgid:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	ip_map_cache_destroy(net);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) err_ipmap:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	rpc_proc_exit(net);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) err_proc:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	return err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) static __net_exit void sunrpc_exit_net(struct net *net)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	rpc_pipefs_exit_net(net);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	unix_gid_cache_destroy(net);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	ip_map_cache_destroy(net);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	rpc_proc_exit(net);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	WARN_ON_ONCE(!list_empty(&sn->all_clients));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) static struct pernet_operations sunrpc_net_ops = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	.init = sunrpc_init_net,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	.exit = sunrpc_exit_net,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	.id = &sunrpc_net_id,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	.size = sizeof(struct sunrpc_net),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) static int __init
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) init_sunrpc(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	int err = rpc_init_mempool();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 		goto out;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	err = rpcauth_init_module();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 		goto out2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	cache_initialize();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	err = register_pernet_subsys(&sunrpc_net_ops);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 		goto out3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	err = register_rpc_pipefs();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	if (err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 		goto out4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	sunrpc_debugfs_init();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	rpc_register_sysctl();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	svc_init_xprt_sock();	/* svc sock transport */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	init_socket_xprt();	/* clnt sock transport */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) out4:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	unregister_pernet_subsys(&sunrpc_net_ops);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) out3:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	rpcauth_remove_module();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) out2:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	rpc_destroy_mempool();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) out:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	return err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) static void __exit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) cleanup_sunrpc(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	rpc_cleanup_clids();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	rpcauth_remove_module();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	cleanup_socket_xprt();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	svc_cleanup_xprt_sock();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	sunrpc_debugfs_exit();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	unregister_rpc_pipefs();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 	rpc_destroy_mempool();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	unregister_pernet_subsys(&sunrpc_net_ops);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 	auth_domain_cleanup();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	rpc_unregister_sysctl();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	rcu_barrier(); /* Wait for completion of call_rcu()'s */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) MODULE_LICENSE("GPL");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) fs_initcall(init_sunrpc); /* Ensure we're initialised before nfs */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) module_exit(cleanup_sunrpc);