drm/panthor: Don't declare a queue blocked if deferred operations are pending
[drm/drm-misc.git] / fs / nfs_common / nfs_ssc.c
blob832246b22c5175255ed6ccd8e89a0f8734e721ef
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
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.
8 */
10 #include <linux/module.h>
11 #include <linux/fs.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
20 /**
21 * nfs42_ssc_register - install the NFS_V4 client ops in the nfs_ssc_client_tbl
22 * @ops: NFS_V4 ops to be installed
24 * Return values:
25 * None
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);
33 /**
34 * nfs42_ssc_unregister - uninstall the NFS_V4 client ops from
35 * the nfs_ssc_client_tbl
36 * @ops: ops to be uninstalled
38 * Return values:
39 * None
41 void nfs42_ssc_unregister(const struct nfs4_ssc_client_ops *ops)
43 if (nfs_ssc_client_tbl.ssc_nfs4_ops != ops)
44 return;
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
52 /**
53 * nfs_ssc_register - install the NFS_FS client ops in the nfs_ssc_client_tbl
54 * @ops: NFS_FS ops to be installed
56 * Return values:
57 * None
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);
65 /**
66 * nfs_ssc_unregister - uninstall the NFS_FS client ops from
67 * the nfs_ssc_client_tbl
68 * @ops: ops to be uninstalled
70 * Return values:
71 * None
73 void nfs_ssc_unregister(const struct nfs_ssc_client_ops *ops)
75 if (nfs_ssc_client_tbl.ssc_nfs_ops != ops)
76 return;
77 nfs_ssc_client_tbl.ssc_nfs_ops = NULL;
79 EXPORT_SYMBOL_GPL(nfs_ssc_unregister);
81 #else
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 */