1 // SPDX-License-Identifier: GPL-2.0-only
3 * Helper for knfsd's SSC to access ops in NFS client modules
5 * Author: Dai Ngo <dai.ngo@oracle.com>
7 * Copyright (c) 2020, Oracle and/or its affiliates.
10 #include <linux/module.h>
12 #include <linux/nfs_ssc.h>
13 #include "../nfs/nfs4_fs.h"
15 MODULE_LICENSE("GPL");
17 struct nfs_ssc_client_ops_tbl nfs_ssc_client_tbl;
18 EXPORT_SYMBOL_GPL(nfs_ssc_client_tbl);
20 #ifdef CONFIG_NFS_V4_2
22 * nfs42_ssc_register - install the NFS_V4 client ops in the nfs_ssc_client_tbl
23 * @ops: NFS_V4 ops to be installed
28 void nfs42_ssc_register(const struct nfs4_ssc_client_ops *ops)
30 nfs_ssc_client_tbl.ssc_nfs4_ops = ops;
32 EXPORT_SYMBOL_GPL(nfs42_ssc_register);
35 * nfs42_ssc_unregister - uninstall the NFS_V4 client ops from
36 * the nfs_ssc_client_tbl
37 * @ops: ops to be uninstalled
42 void nfs42_ssc_unregister(const struct nfs4_ssc_client_ops *ops)
44 if (nfs_ssc_client_tbl.ssc_nfs4_ops != ops)
47 nfs_ssc_client_tbl.ssc_nfs4_ops = NULL;
49 EXPORT_SYMBOL_GPL(nfs42_ssc_unregister);
50 #endif /* CONFIG_NFS_V4_2 */
52 #ifdef CONFIG_NFS_V4_2
54 * nfs_ssc_register - install the NFS_FS client ops in the nfs_ssc_client_tbl
55 * @ops: NFS_FS ops to be installed
60 void nfs_ssc_register(const struct nfs_ssc_client_ops *ops)
62 nfs_ssc_client_tbl.ssc_nfs_ops = ops;
64 EXPORT_SYMBOL_GPL(nfs_ssc_register);
67 * nfs_ssc_unregister - uninstall the NFS_FS client ops from
68 * the nfs_ssc_client_tbl
69 * @ops: ops to be uninstalled
74 void nfs_ssc_unregister(const struct nfs_ssc_client_ops *ops)
76 if (nfs_ssc_client_tbl.ssc_nfs_ops != ops)
78 nfs_ssc_client_tbl.ssc_nfs_ops = NULL;
80 EXPORT_SYMBOL_GPL(nfs_ssc_unregister);
83 void nfs_ssc_register(const struct nfs_ssc_client_ops *ops)
86 EXPORT_SYMBOL_GPL(nfs_ssc_register);
88 void nfs_ssc_unregister(const struct nfs_ssc_client_ops *ops)
91 EXPORT_SYMBOL_GPL(nfs_ssc_unregister);
92 #endif /* CONFIG_NFS_V4_2 */