Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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> |
NeilBrown | d343fce | 2006-10-17 00:10:18 -0700 | [diff] [blame] | 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 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 { |
Al Viro | e8c5c04 | 2006-12-13 00:35:03 -0800 | [diff] [blame] | 26 | __be32 (*fopen)(struct svc_rqst *, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | struct nfs_fh *, |
| 28 | struct file **); |
| 29 | void (*fclose)(struct file *); |
| 30 | }; |
| 31 | |
| 32 | extern struct nlmsvc_binding * nlmsvc_ops; |
| 33 | |
| 34 | /* |
Chuck Lever | 883bb16 | 2008-01-15 16:04:20 -0500 | [diff] [blame] | 35 | * Similar to nfs_client_initdata, but without the NFS-specific |
| 36 | * rpc_ops field. |
| 37 | */ |
| 38 | struct nlmclnt_initdata { |
| 39 | const char *hostname; |
| 40 | const struct sockaddr *address; |
| 41 | size_t addrlen; |
| 42 | unsigned short protocol; |
| 43 | u32 nfs_version; |
Chuck Lever | 0cb2659 | 2008-12-23 15:21:38 -0500 | [diff] [blame] | 44 | int noresvport; |
Stanislav Kinsbursky | 66697bf | 2012-01-31 15:08:13 +0400 | [diff] [blame] | 45 | struct net *net; |
Chuck Lever | 883bb16 | 2008-01-15 16:04:20 -0500 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | * Functions exported by the lockd module |
| 50 | */ |
Chuck Lever | 883bb16 | 2008-01-15 16:04:20 -0500 | [diff] [blame] | 51 | |
| 52 | extern struct nlm_host *nlmclnt_init(const struct nlmclnt_initdata *nlm_init); |
Chuck Lever | 52c4044 | 2008-01-11 17:09:44 -0500 | [diff] [blame] | 53 | extern void nlmclnt_done(struct nlm_host *host); |
| 54 | |
Chuck Lever | 1093a60 | 2008-01-11 17:09:59 -0500 | [diff] [blame] | 55 | extern int nlmclnt_proc(struct nlm_host *host, int cmd, |
| 56 | struct file_lock *fl); |
Chuck Lever | 26a4140 | 2008-10-03 17:15:30 -0400 | [diff] [blame] | 57 | extern int lockd_up(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | extern void lockd_down(void); |
| 59 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | #endif /* LINUX_LOCKD_BIND_H */ |