Merge tag 'regmap-fix-v5.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux/fpc-iii.git] / fs / nfs_common / nfs_ssc.c
blobf43bbb3739134bee39e0209d23c41e1b61b80747
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * fs/nfs_common/nfs_ssc_comm.c
5 * Helper for knfsd's SSC to access ops in NFS client modules
7 * Author: Dai Ngo <dai.ngo@oracle.com>
9 * Copyright (c) 2020, Oracle and/or its affiliates.
12 #include <linux/module.h>
13 #include <linux/fs.h>
14 #include <linux/nfs_ssc.h>
15 #include "../nfs/nfs4_fs.h"
17 MODULE_LICENSE("GPL");
19 struct nfs_ssc_client_ops_tbl nfs_ssc_client_tbl;
20 EXPORT_SYMBOL_GPL(nfs_ssc_client_tbl);
22 #ifdef CONFIG_NFS_V4_2
23 /**
24 * nfs42_ssc_register - install the NFS_V4 client ops in the nfs_ssc_client_tbl
25 * @ops: NFS_V4 ops to be installed
27 * Return values:
28 * None
30 void nfs42_ssc_register(const struct nfs4_ssc_client_ops *ops)
32 nfs_ssc_client_tbl.ssc_nfs4_ops = ops;
34 EXPORT_SYMBOL_GPL(nfs42_ssc_register);
36 /**
37 * nfs42_ssc_unregister - uninstall the NFS_V4 client ops from
38 * the nfs_ssc_client_tbl
39 * @ops: ops to be uninstalled
41 * Return values:
42 * None
44 void nfs42_ssc_unregister(const struct nfs4_ssc_client_ops *ops)
46 if (nfs_ssc_client_tbl.ssc_nfs4_ops != ops)
47 return;
49 nfs_ssc_client_tbl.ssc_nfs4_ops = NULL;
51 EXPORT_SYMBOL_GPL(nfs42_ssc_unregister);
52 #endif /* CONFIG_NFS_V4_2 */
54 #ifdef CONFIG_NFS_V4_2
55 /**
56 * nfs_ssc_register - install the NFS_FS client ops in the nfs_ssc_client_tbl
57 * @ops: NFS_FS ops to be installed
59 * Return values:
60 * None
62 void nfs_ssc_register(const struct nfs_ssc_client_ops *ops)
64 nfs_ssc_client_tbl.ssc_nfs_ops = ops;
66 EXPORT_SYMBOL_GPL(nfs_ssc_register);
68 /**
69 * nfs_ssc_unregister - uninstall the NFS_FS client ops from
70 * the nfs_ssc_client_tbl
71 * @ops: ops to be uninstalled
73 * Return values:
74 * None
76 void nfs_ssc_unregister(const struct nfs_ssc_client_ops *ops)
78 if (nfs_ssc_client_tbl.ssc_nfs_ops != ops)
79 return;
80 nfs_ssc_client_tbl.ssc_nfs_ops = NULL;
82 EXPORT_SYMBOL_GPL(nfs_ssc_unregister);
84 #else
85 void nfs_ssc_register(const struct nfs_ssc_client_ops *ops)
88 EXPORT_SYMBOL_GPL(nfs_ssc_register);
90 void nfs_ssc_unregister(const struct nfs_ssc_client_ops *ops)
93 EXPORT_SYMBOL_GPL(nfs_ssc_unregister);
94 #endif /* CONFIG_NFS_V4_2 */