1 /* SPDX-License-Identifier: GPL-2.0 */
3 * linux/include/linux/lockd/bind.h
5 * This is the part of lockd visible to nfsd and the nfs client.
7 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
10 #ifndef LINUX_LOCKD_BIND_H
11 #define LINUX_LOCKD_BIND_H
13 #include <linux/lockd/nlm.h>
14 /* need xdr-encoded error codes too, so... */
15 #include <linux/lockd/xdr.h>
16 #ifdef CONFIG_LOCKD_V4
17 #include <linux/lockd/xdr4.h>
20 /* Dummy declarations */
25 * This is the set of functions for lockd->nfsd communication
27 struct nlmsvc_binding
{
28 __be32 (*fopen
)(struct svc_rqst
*,
31 void (*fclose
)(struct file
*);
34 extern const struct nlmsvc_binding
*nlmsvc_ops
;
37 * Similar to nfs_client_initdata, but without the NFS-specific
40 struct nlmclnt_initdata
{
42 const struct sockaddr
*address
;
44 unsigned short protocol
;
48 const struct nlmclnt_operations
*nlmclnt_ops
;
52 * Functions exported by the lockd module
55 extern struct nlm_host
*nlmclnt_init(const struct nlmclnt_initdata
*nlm_init
);
56 extern void nlmclnt_done(struct nlm_host
*host
);
59 * NLM client operations provide a means to modify RPC processing of NLM
60 * requests. Callbacks receive a pointer to data passed into the call to
63 struct nlmclnt_operations
{
64 /* Called on successful allocation of nlm_rqst, use for allocation or
65 * reference counting. */
66 void (*nlmclnt_alloc_call
)(void *);
68 /* Called in rpc_task_prepare for unlock. A return value of true
69 * indicates the callback has put the task to sleep on a waitqueue
70 * and NLM should not call rpc_call_start(). */
71 bool (*nlmclnt_unlock_prepare
)(struct rpc_task
*, void *);
73 /* Called when the nlm_rqst is freed, callbacks should clean up here */
74 void (*nlmclnt_release_call
)(void *);
77 extern int nlmclnt_proc(struct nlm_host
*host
, int cmd
, struct file_lock
*fl
, void *data
);
78 extern int lockd_up(struct net
*net
);
79 extern void lockd_down(struct net
*net
);
81 #endif /* LINUX_LOCKD_BIND_H */