#include <linux/nfs4.h>
#include <linux/sunrpc/clnt.h>
#include <linux/sunrpc/xprt.h>
#include <linux/sunrpc/svc_xprt.h>
#include <linux/slab.h>
#include "nfsd.h"
#include "state.h"
#include "netns.h"
#include "trace.h"
#include "xdr4cb.h"
#include "xdr4.h"
#define NFSDDBG_FACILITY …
static void nfsd4_mark_cb_fault(struct nfs4_client *clp);
#define NFSPROC4_CB_NULL …
#define NFSPROC4_CB_COMPOUND …
struct nfs4_cb_compound_hdr { … };
static __be32 *xdr_encode_empty_array(__be32 *p)
{ … }
static void encode_uint32(struct xdr_stream *xdr, u32 n)
{ … }
static void encode_bitmap4(struct xdr_stream *xdr, const __u32 *bitmap,
size_t len)
{ … }
static int decode_cb_fattr4(struct xdr_stream *xdr, uint32_t *bitmap,
struct nfs4_cb_fattr *fattr)
{ … }
static void encode_nfs_cb_opnum4(struct xdr_stream *xdr, enum nfs_cb_opnum4 op)
{ … }
static void encode_nfs_fh4(struct xdr_stream *xdr, const struct knfsd_fh *fh)
{ … }
static void encode_stateid4(struct xdr_stream *xdr, const stateid_t *sid)
{ … }
static void encode_sessionid4(struct xdr_stream *xdr,
const struct nfsd4_session *session)
{ … }
static const struct { … } nfs_cb_errtbl[] = …;
static int nfs_cb_stat_to_errno(int status)
{ … }
static int decode_cb_op_status(struct xdr_stream *xdr,
enum nfs_cb_opnum4 expected, int *status)
{ … }
static void encode_cb_compound4args(struct xdr_stream *xdr,
struct nfs4_cb_compound_hdr *hdr)
{ … }
static void encode_cb_nops(struct nfs4_cb_compound_hdr *hdr)
{ … }
static int decode_cb_compound4res(struct xdr_stream *xdr,
struct nfs4_cb_compound_hdr *hdr)
{ … }
static void encode_cb_recall4args(struct xdr_stream *xdr,
const struct nfs4_delegation *dp,
struct nfs4_cb_compound_hdr *hdr)
{ … }
static void
encode_cb_recallany4args(struct xdr_stream *xdr,
struct nfs4_cb_compound_hdr *hdr, struct nfsd4_cb_recall_any *ra)
{ … }
static void
encode_cb_getattr4args(struct xdr_stream *xdr, struct nfs4_cb_compound_hdr *hdr,
struct nfs4_cb_fattr *fattr)
{ … }
static void encode_cb_sequence4args(struct xdr_stream *xdr,
const struct nfsd4_callback *cb,
struct nfs4_cb_compound_hdr *hdr)
{ … }
static int decode_cb_sequence4resok(struct xdr_stream *xdr,
struct nfsd4_callback *cb)
{ … }
static int decode_cb_sequence4res(struct xdr_stream *xdr,
struct nfsd4_callback *cb)
{ … }
static void nfs4_xdr_enc_cb_null(struct rpc_rqst *req, struct xdr_stream *xdr,
const void *__unused)
{ … }
static void nfs4_xdr_enc_cb_getattr(struct rpc_rqst *req,
struct xdr_stream *xdr, const void *data)
{ … }
static void nfs4_xdr_enc_cb_recall(struct rpc_rqst *req, struct xdr_stream *xdr,
const void *data)
{ … }
static void
nfs4_xdr_enc_cb_recall_any(struct rpc_rqst *req,
struct xdr_stream *xdr, const void *data)
{ … }
static int nfs4_xdr_dec_cb_null(struct rpc_rqst *req, struct xdr_stream *xdr,
void *__unused)
{ … }
static int nfs4_xdr_dec_cb_getattr(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
void *data)
{ … }
static int nfs4_xdr_dec_cb_recall(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
void *data)
{ … }
static int
nfs4_xdr_dec_cb_recall_any(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
void *data)
{ … }
#ifdef CONFIG_NFSD_PNFS
static void encode_cb_layout4args(struct xdr_stream *xdr,
const struct nfs4_layout_stateid *ls,
struct nfs4_cb_compound_hdr *hdr)
{ … }
static void nfs4_xdr_enc_cb_layout(struct rpc_rqst *req,
struct xdr_stream *xdr,
const void *data)
{ … }
static int nfs4_xdr_dec_cb_layout(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
void *data)
{ … }
#endif
static void encode_stateowner(struct xdr_stream *xdr, struct nfs4_stateowner *so)
{ … }
static void nfs4_xdr_enc_cb_notify_lock(struct rpc_rqst *req,
struct xdr_stream *xdr,
const void *data)
{ … }
static int nfs4_xdr_dec_cb_notify_lock(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
void *data)
{ … }
static void encode_offload_info4(struct xdr_stream *xdr,
const struct nfsd4_cb_offload *cbo)
{ … }
static void encode_cb_offload4args(struct xdr_stream *xdr,
const struct nfsd4_cb_offload *cbo,
struct nfs4_cb_compound_hdr *hdr)
{ … }
static void nfs4_xdr_enc_cb_offload(struct rpc_rqst *req,
struct xdr_stream *xdr,
const void *data)
{ … }
static int nfs4_xdr_dec_cb_offload(struct rpc_rqst *rqstp,
struct xdr_stream *xdr,
void *data)
{ … }
#define PROC(proc, call, argtype, restype) …
static const struct rpc_procinfo nfs4_cb_procedures[] = …;
static unsigned int nfs4_cb_counts[ARRAY_SIZE(nfs4_cb_procedures)];
static const struct rpc_version nfs_cb_version4 = …;
static const struct rpc_version *nfs_cb_version[2] = …;
static const struct rpc_program cb_program;
static struct rpc_stat cb_stats = …;
#define NFS4_CALLBACK …
static const struct rpc_program cb_program = …;
static int max_cb_time(struct net *net)
{ … }
static bool nfsd4_queue_cb(struct nfsd4_callback *cb)
{ … }
static void nfsd41_cb_inflight_begin(struct nfs4_client *clp)
{ … }
static void nfsd41_cb_inflight_end(struct nfs4_client *clp)
{ … }
static void nfsd41_cb_inflight_wait_complete(struct nfs4_client *clp)
{ … }
static const struct cred *get_backchannel_cred(struct nfs4_client *clp, struct rpc_clnt *client, struct nfsd4_session *ses)
{ … }
static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn, struct nfsd4_session *ses)
{ … }
static void nfsd4_mark_cb_state(struct nfs4_client *clp, int newstate)
{ … }
static void nfsd4_mark_cb_down(struct nfs4_client *clp)
{ … }
static void nfsd4_mark_cb_fault(struct nfs4_client *clp)
{ … }
static void nfsd4_cb_probe_done(struct rpc_task *task, void *calldata)
{ … }
static void nfsd4_cb_probe_release(void *calldata)
{ … }
static const struct rpc_call_ops nfsd4_cb_probe_ops = …;
void nfsd4_probe_callback(struct nfs4_client *clp)
{ … }
void nfsd4_probe_callback_sync(struct nfs4_client *clp)
{ … }
void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *conn)
{ … }
static bool nfsd41_cb_get_slot(struct nfsd4_callback *cb, struct rpc_task *task)
{ … }
static void nfsd41_cb_release_slot(struct nfsd4_callback *cb)
{ … }
static void nfsd41_destroy_cb(struct nfsd4_callback *cb)
{ … }
static void nfsd4_cb_prepare(struct rpc_task *task, void *calldata)
{ … }
static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback *cb)
{ … }
static void nfsd4_cb_done(struct rpc_task *task, void *calldata)
{ … }
static void nfsd4_cb_release(void *calldata)
{ … }
static const struct rpc_call_ops nfsd4_cb_ops = …;
void nfsd4_shutdown_callback(struct nfs4_client *clp)
{ … }
static struct nfsd4_conn * __nfsd4_find_backchannel(struct nfs4_client *clp)
{ … }
static void nfsd4_process_cb_update(struct nfsd4_callback *cb)
{ … }
static void
nfsd4_run_cb_work(struct work_struct *work)
{ … }
void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp,
const struct nfsd4_callback_ops *ops, enum nfsd4_cb_op op)
{ … }
bool nfsd4_run_cb(struct nfsd4_callback *cb)
{ … }