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"
16 struct nfs_ssc_client_ops_tbl nfs_ssc_client_tbl
;
17 EXPORT_SYMBOL_GPL(nfs_ssc_client_tbl
);
19 #ifdef CONFIG_NFS_V4_2
21 * nfs42_ssc_register - install the NFS_V4 client ops in the nfs_ssc_client_tbl
22 * @ops: NFS_V4 ops to be installed
27 void nfs42_ssc_register(const struct nfs4_ssc_client_ops
*ops
)
29 nfs_ssc_client_tbl
.ssc_nfs4_ops
= ops
;
31 EXPORT_SYMBOL_GPL(nfs42_ssc_register
);
34 * nfs42_ssc_unregister - uninstall the NFS_V4 client ops from
35 * the nfs_ssc_client_tbl
36 * @ops: ops to be uninstalled
41 void nfs42_ssc_unregister(const struct nfs4_ssc_client_ops
*ops
)
43 if (nfs_ssc_client_tbl
.ssc_nfs4_ops
!= ops
)
46 nfs_ssc_client_tbl
.ssc_nfs4_ops
= NULL
;
48 EXPORT_SYMBOL_GPL(nfs42_ssc_unregister
);
49 #endif /* CONFIG_NFS_V4_2 */
51 #ifdef CONFIG_NFS_V4_2
53 * nfs_ssc_register - install the NFS_FS client ops in the nfs_ssc_client_tbl
54 * @ops: NFS_FS ops to be installed
59 void nfs_ssc_register(const struct nfs_ssc_client_ops
*ops
)
61 nfs_ssc_client_tbl
.ssc_nfs_ops
= ops
;
63 EXPORT_SYMBOL_GPL(nfs_ssc_register
);
66 * nfs_ssc_unregister - uninstall the NFS_FS client ops from
67 * the nfs_ssc_client_tbl
68 * @ops: ops to be uninstalled
73 void nfs_ssc_unregister(const struct nfs_ssc_client_ops
*ops
)
75 if (nfs_ssc_client_tbl
.ssc_nfs_ops
!= ops
)
77 nfs_ssc_client_tbl
.ssc_nfs_ops
= NULL
;
79 EXPORT_SYMBOL_GPL(nfs_ssc_unregister
);
82 void nfs_ssc_register(const struct nfs_ssc_client_ops
*ops
)
85 EXPORT_SYMBOL_GPL(nfs_ssc_register
);
87 void nfs_ssc_unregister(const struct nfs_ssc_client_ops
*ops
)
90 EXPORT_SYMBOL_GPL(nfs_ssc_unregister
);
91 #endif /* CONFIG_NFS_V4_2 */