1 /* SPDX-License-Identifier: GPL-2.0 */
3 * include/linux/nfs_ssc.h
5 * Author: Dai Ngo <dai.ngo@oracle.com>
7 * Copyright (c) 2020, Oracle and/or its affiliates.
10 #include <linux/nfs_fs.h>
12 extern struct nfs_ssc_client_ops_tbl nfs_ssc_client_tbl
;
17 struct nfs4_ssc_client_ops
{
18 struct file
*(*sco_open
)(struct vfsmount
*ss_mnt
,
19 struct nfs_fh
*src_fh
, nfs4_stateid
*stateid
);
20 void (*sco_close
)(struct file
*filep
);
26 struct nfs_ssc_client_ops
{
27 void (*sco_sb_deactive
)(struct super_block
*sb
);
30 struct nfs_ssc_client_ops_tbl
{
31 const struct nfs4_ssc_client_ops
*ssc_nfs4_ops
;
32 const struct nfs_ssc_client_ops
*ssc_nfs_ops
;
35 extern void nfs42_ssc_register_ops(void);
36 extern void nfs42_ssc_unregister_ops(void);
38 extern void nfs42_ssc_register(const struct nfs4_ssc_client_ops
*ops
);
39 extern void nfs42_ssc_unregister(const struct nfs4_ssc_client_ops
*ops
);
41 #ifdef CONFIG_NFSD_V4_2_INTER_SSC
42 static inline struct file
*nfs42_ssc_open(struct vfsmount
*ss_mnt
,
43 struct nfs_fh
*src_fh
, nfs4_stateid
*stateid
)
45 if (nfs_ssc_client_tbl
.ssc_nfs4_ops
)
46 return (*nfs_ssc_client_tbl
.ssc_nfs4_ops
->sco_open
)(ss_mnt
, src_fh
, stateid
);
50 static inline void nfs42_ssc_close(struct file
*filep
)
52 if (nfs_ssc_client_tbl
.ssc_nfs4_ops
)
53 (*nfs_ssc_client_tbl
.ssc_nfs4_ops
->sco_close
)(filep
);
60 extern void nfs_ssc_register(const struct nfs_ssc_client_ops
*ops
);
61 extern void nfs_ssc_unregister(const struct nfs_ssc_client_ops
*ops
);
63 static inline void nfs_do_sb_deactive(struct super_block
*sb
)
65 if (nfs_ssc_client_tbl
.ssc_nfs_ops
)
66 (*nfs_ssc_client_tbl
.ssc_nfs_ops
->sco_sb_deactive
)(sb
);