blob: 73368075af032ba8c0c21d7b3d7e3b776f4f7866 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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>
NeilBrownd343fce2006-10-17 00:10:18 -070013/* 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 Torvalds1da177e2005-04-16 15:20:36 -070018
19/* Dummy declarations */
20struct svc_rqst;
21
22/*
23 * This is the set of functions for lockd->nfsd communication
24 */
25struct nlmsvc_binding {
Al Viroe8c5c042006-12-13 00:35:03 -080026 __be32 (*fopen)(struct svc_rqst *,
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 struct nfs_fh *,
28 struct file **);
29 void (*fclose)(struct file *);
Marc Eshel9a8db972007-07-17 04:04:35 -070030 unsigned long (*get_grace_period)(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070031};
32
33extern struct nlmsvc_binding * nlmsvc_ops;
34
35/*
36 * Functions exported by the lockd module
37 */
Chuck Lever52c40442008-01-11 17:09:44 -050038extern 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);
43extern void nlmclnt_done(struct nlm_host *host);
44
Chuck Lever1093a602008-01-11 17:09:59 -050045extern int nlmclnt_proc(struct nlm_host *host, int cmd,
46 struct file_lock *fl);
NeilBrown24e36662006-10-02 02:17:45 -070047extern int lockd_up(int proto);
Linus Torvalds1da177e2005-04-16 15:20:36 -070048extern void lockd_down(void);
49
Marc Eshel9a8db972007-07-17 04:04:35 -070050unsigned long get_nfs_grace_period(void);
51
52#ifdef CONFIG_NFSD_V4
53unsigned long get_nfs4_grace_period(void);
54#else
55static inline unsigned long get_nfs4_grace_period(void) {return 0;}
56#endif
57
Linus Torvalds1da177e2005-04-16 15:20:36 -070058#endif /* LINUX_LOCKD_BIND_H */