]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - include/linux/lockd/bind.h
NLM: Introduce external nlm_host set-up and tear-down functions
[mirror_ubuntu-zesty-kernel.git] / include / linux / lockd / bind.h
1 /*
2 * linux/include/linux/lockd/bind.h
3 *
4 * This is the part of lockd visible to nfsd and the nfs client.
5 *
6 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
7 */
8
9 #ifndef LINUX_LOCKD_BIND_H
10 #define LINUX_LOCKD_BIND_H
11
12 #include <linux/lockd/nlm.h>
13 /* need xdr-encoded error codes too, so... */
14 #include <linux/lockd/xdr.h>
15 #ifdef CONFIG_LOCKD_V4
16 #include <linux/lockd/xdr4.h>
17 #endif
18
19 /* Dummy declarations */
20 struct svc_rqst;
21
22 /*
23 * This is the set of functions for lockd->nfsd communication
24 */
25 struct nlmsvc_binding {
26 __be32 (*fopen)(struct svc_rqst *,
27 struct nfs_fh *,
28 struct file **);
29 void (*fclose)(struct file *);
30 unsigned long (*get_grace_period)(void);
31 };
32
33 extern struct nlmsvc_binding * nlmsvc_ops;
34
35 /*
36 * Functions exported by the lockd module
37 */
38 extern struct nlm_host *nlmclnt_init(const char *server_name,
39 const struct sockaddr *server_address,
40 size_t server_addrlen,
41 unsigned short protocol,
42 u32 nfs_version);
43 extern void nlmclnt_done(struct nlm_host *host);
44
45 extern int nlmclnt_proc(struct inode *, int, struct file_lock *);
46 extern int lockd_up(int proto);
47 extern void lockd_down(void);
48
49 unsigned long get_nfs_grace_period(void);
50
51 #ifdef CONFIG_NFSD_V4
52 unsigned long get_nfs4_grace_period(void);
53 #else
54 static inline unsigned long get_nfs4_grace_period(void) {return 0;}
55 #endif
56
57 #endif /* LINUX_LOCKD_BIND_H */