1 // SPDX-License-Identifier: GPL-2.0-only
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>
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
24 * nfs42_ssc_register - install the NFS_V4 client ops in the nfs_ssc_client_tbl
25 * @ops: NFS_V4 ops to be installed
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
);
37 * nfs42_ssc_unregister - uninstall the NFS_V4 client ops from
38 * the nfs_ssc_client_tbl
39 * @ops: ops to be uninstalled
44 void nfs42_ssc_unregister(const struct nfs4_ssc_client_ops
*ops
)
46 if (nfs_ssc_client_tbl
.ssc_nfs4_ops
!= ops
)
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
56 * nfs_ssc_register - install the NFS_FS client ops in the nfs_ssc_client_tbl
57 * @ops: NFS_FS ops to be installed
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
);
69 * nfs_ssc_unregister - uninstall the NFS_FS client ops from
70 * the nfs_ssc_client_tbl
71 * @ops: ops to be uninstalled
76 void nfs_ssc_unregister(const struct nfs_ssc_client_ops
*ops
)
78 if (nfs_ssc_client_tbl
.ssc_nfs_ops
!= ops
)
80 nfs_ssc_client_tbl
.ssc_nfs_ops
= NULL
;
82 EXPORT_SYMBOL_GPL(nfs_ssc_unregister
);
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 */