1
2
3
4
5
6
7
8
9
10#ifndef LOCKD_XDR_H
11#define LOCKD_XDR_H
12
13#include <linux/fs.h>
14#include <linux/nfs.h>
15#include <linux/sunrpc/xdr.h>
16
17#define SM_MAXSTRLEN 1024
18#define SM_PRIV_SIZE 16
19
20struct nsm_private {
21 unsigned char data[SM_PRIV_SIZE];
22};
23
24struct svc_rqst;
25
26#define NLM_MAXCOOKIELEN 32
27#define NLM_MAXSTRLEN 1024
28
29#define nlm_granted cpu_to_be32(NLM_LCK_GRANTED)
30#define nlm_lck_denied cpu_to_be32(NLM_LCK_DENIED)
31#define nlm_lck_denied_nolocks cpu_to_be32(NLM_LCK_DENIED_NOLOCKS)
32#define nlm_lck_blocked cpu_to_be32(NLM_LCK_BLOCKED)
33#define nlm_lck_denied_grace_period cpu_to_be32(NLM_LCK_DENIED_GRACE_PERIOD)
34
35#define nlm_drop_reply cpu_to_be32(30000)
36
37
38struct nlm_lock {
39 char * caller;
40 unsigned int len;
41 struct nfs_fh fh;
42 struct xdr_netobj oh;
43 u32 svid;
44 struct file_lock fl;
45};
46
47
48
49
50
51
52
53struct nlm_cookie
54{
55 unsigned char data[NLM_MAXCOOKIELEN];
56 unsigned int len;
57};
58
59
60
61
62struct nlm_args {
63 struct nlm_cookie cookie;
64 struct nlm_lock lock;
65 u32 block;
66 u32 reclaim;
67 u32 state;
68 u32 monitor;
69 u32 fsm_access;
70 u32 fsm_mode;
71};
72
73typedef struct nlm_args nlm_args;
74
75
76
77
78struct nlm_res {
79 struct nlm_cookie cookie;
80 __be32 status;
81 struct nlm_lock lock;
82};
83
84
85
86
87struct nlm_reboot {
88 char *mon;
89 unsigned int len;
90 u32 state;
91 struct nsm_private priv;
92};
93
94
95
96
97#define NLMSVC_XDRSIZE sizeof(struct nlm_args)
98
99int nlmsvc_decode_testargs(struct svc_rqst *, __be32 *);
100int nlmsvc_encode_testres(struct svc_rqst *, __be32 *);
101int nlmsvc_decode_lockargs(struct svc_rqst *, __be32 *);
102int nlmsvc_decode_cancargs(struct svc_rqst *, __be32 *);
103int nlmsvc_decode_unlockargs(struct svc_rqst *, __be32 *);
104int nlmsvc_encode_res(struct svc_rqst *, __be32 *);
105int nlmsvc_decode_res(struct svc_rqst *, __be32 *);
106int nlmsvc_encode_void(struct svc_rqst *, __be32 *);
107int nlmsvc_decode_void(struct svc_rqst *, __be32 *);
108int nlmsvc_decode_shareargs(struct svc_rqst *, __be32 *);
109int nlmsvc_encode_shareres(struct svc_rqst *, __be32 *);
110int nlmsvc_decode_notify(struct svc_rqst *, __be32 *);
111int nlmsvc_decode_reboot(struct svc_rqst *, __be32 *);
112
113
114
115
116
117
118
119#endif
120