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)  * fs/nfs_common/nfs_ssc_comm.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  * Helper for knfsd's SSC to access ops in NFS client modules
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  * Author: Dai Ngo <dai.ngo@oracle.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9)  * Copyright (c) 2020, Oracle and/or its affiliates.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <linux/fs.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/nfs_ssc.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include "../nfs/nfs4_fs.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) MODULE_LICENSE("GPL");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) struct nfs_ssc_client_ops_tbl nfs_ssc_client_tbl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) EXPORT_SYMBOL_GPL(nfs_ssc_client_tbl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #ifdef CONFIG_NFS_V4_2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)  * nfs42_ssc_register - install the NFS_V4 client ops in the nfs_ssc_client_tbl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)  * @ops: NFS_V4 ops to be installed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)  * Return values:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)  *   None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) void nfs42_ssc_register(const struct nfs4_ssc_client_ops *ops)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 	nfs_ssc_client_tbl.ssc_nfs4_ops = ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) EXPORT_SYMBOL_GPL(nfs42_ssc_register);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)  * nfs42_ssc_unregister - uninstall the NFS_V4 client ops from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)  *				the nfs_ssc_client_tbl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)  * @ops: ops to be uninstalled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)  * Return values:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)  *   None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) void nfs42_ssc_unregister(const struct nfs4_ssc_client_ops *ops)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 	if (nfs_ssc_client_tbl.ssc_nfs4_ops != ops)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 	nfs_ssc_client_tbl.ssc_nfs4_ops = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) EXPORT_SYMBOL_GPL(nfs42_ssc_unregister);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) #endif /* CONFIG_NFS_V4_2 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) #ifdef CONFIG_NFS_V4_2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)  * nfs_ssc_register - install the NFS_FS client ops in the nfs_ssc_client_tbl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)  * @ops: NFS_FS ops to be installed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)  * Return values:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)  *   None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) void nfs_ssc_register(const struct nfs_ssc_client_ops *ops)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) 	nfs_ssc_client_tbl.ssc_nfs_ops = ops;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) EXPORT_SYMBOL_GPL(nfs_ssc_register);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)  * nfs_ssc_unregister - uninstall the NFS_FS client ops from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)  *				the nfs_ssc_client_tbl
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)  * @ops: ops to be uninstalled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)  * Return values:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)  *   None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) void nfs_ssc_unregister(const struct nfs_ssc_client_ops *ops)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) 	if (nfs_ssc_client_tbl.ssc_nfs_ops != ops)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) 	nfs_ssc_client_tbl.ssc_nfs_ops = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) EXPORT_SYMBOL_GPL(nfs_ssc_unregister);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) void nfs_ssc_register(const struct nfs_ssc_client_ops *ops)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) EXPORT_SYMBOL_GPL(nfs_ssc_register);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) void nfs_ssc_unregister(const struct nfs_ssc_client_ops *ops)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) EXPORT_SYMBOL_GPL(nfs_ssc_unregister);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) #endif /* CONFIG_NFS_V4_2 */