diff options
Diffstat (limited to 'include/linux/lockd')
-rw-r--r-- | include/linux/lockd/debug.h | 1 | ||||
-rw-r--r-- | include/linux/lockd/lockd.h | 7 | ||||
-rw-r--r-- | include/linux/lockd/nlm.h | 19 | ||||
-rw-r--r-- | include/linux/lockd/xdr4.h | 41 |
4 files changed, 63 insertions, 5 deletions
diff --git a/include/linux/lockd/debug.h b/include/linux/lockd/debug.h index 2a2f97a1f..d19f72d36 100644 --- a/include/linux/lockd/debug.h +++ b/include/linux/lockd/debug.h @@ -45,6 +45,7 @@ char * nlm_procname(u32); #define NLMDBG_CLNTSUBS 0x0020 #define NLMDBG_SVCSUBS 0x0040 #define NLMDBG_HOSTCACHE 0x0080 +#define NLMDBG_XDR 0x0100 #define NLMDBG_ALL 0x7fff diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index fbc861f24..cb2c148f1 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h @@ -11,12 +11,16 @@ #ifdef __KERNEL__ +#include <linux/config.h> #include <linux/in.h> #include <linux/fs.h> #include <linux/utsname.h> #include <linux/nfsd/nfsfh.h> #include <linux/lockd/bind.h> #include <linux/lockd/xdr.h> +#ifdef CONFIG_LOCKD_V4 +#include <linux/lockd/xdr4.h> +#endif #include <linux/lockd/debug.h> /* @@ -112,6 +116,9 @@ struct nlm_block { */ extern struct rpc_program nlm_program; extern struct svc_procedure nlmsvc_procedures[]; +#ifdef CONFIG_LOCKD_V4 +extern struct svc_procedure nlmsvc_procedures4[]; +#endif extern unsigned long nlmsvc_grace_period; extern unsigned long nlmsvc_timeout; diff --git a/include/linux/lockd/nlm.h b/include/linux/lockd/nlm.h index ca606fca2..4bc44e7d9 100644 --- a/include/linux/lockd/nlm.h +++ b/include/linux/lockd/nlm.h @@ -9,6 +9,8 @@ #ifndef LINUX_LOCKD_NLM_H #define LINUX_LOCKD_NLM_H +#include <linux/config.h> + /* Maximum file offset in file_lock.fl_end */ #ifdef OFFSET_MAX # define NLM_OFFSET_MAX OFFSET_MAX @@ -18,11 +20,18 @@ /* Return states for NLM */ enum { - NLM_LCK_GRANTED = 0, - NLM_LCK_DENIED, - NLM_LCK_DENIED_NOLOCKS, - NLM_LCK_BLOCKED, - NLM_LCK_DENIED_GRACE_PERIOD, + NLM_LCK_GRANTED = 0, + NLM_LCK_DENIED = 1, + NLM_LCK_DENIED_NOLOCKS = 2, + NLM_LCK_BLOCKED = 3, + NLM_LCK_DENIED_GRACE_PERIOD = 4, +#ifdef CONFIG_LOCKD_V4 + NLM_DEADLCK = 5, + NLM_ROFS = 6, + NLM_STALE_FH = 7, + NLM_FBIG = 8, + NLM_FAILED = 9, +#endif }; #define NLM_PROGRAM 100021 diff --git a/include/linux/lockd/xdr4.h b/include/linux/lockd/xdr4.h new file mode 100644 index 000000000..d9d7e3f75 --- /dev/null +++ b/include/linux/lockd/xdr4.h @@ -0,0 +1,41 @@ +/* + * linux/include/linux/lockd/xdr.h + * + * XDR types for the NLM protocol + * + * Copyright (C) 1996 Olaf Kirch <okir@monad.swb.de> + */ + +#ifndef LOCKD_XDR4_H +#define LOCKD_XDR4_H + +#include <linux/fs.h> +#include <linux/nfs.h> +#include <linux/sunrpc/xdr.h> +#include <linux/lockd/xdr.h> + +/* error codes new to NLMv4 */ +extern u32 nlm4_deadlock, nlm4_rofs, nlm4_stale_fh, nlm4_fbig, nlm4_failed; + + +int nlm4svc_decode_testargs(struct svc_rqst *, u32 *, struct nlm_args *); +int nlm4svc_encode_testres(struct svc_rqst *, u32 *, struct nlm_res *); +int nlm4svc_decode_lockargs(struct svc_rqst *, u32 *, struct nlm_args *); +int nlm4svc_decode_cancargs(struct svc_rqst *, u32 *, struct nlm_args *); +int nlm4svc_decode_unlockargs(struct svc_rqst *, u32 *, struct nlm_args *); +int nlm4svc_encode_res(struct svc_rqst *, u32 *, struct nlm_res *); +int nlm4svc_decode_res(struct svc_rqst *, u32 *, struct nlm_res *); +int nlm4svc_encode_void(struct svc_rqst *, u32 *, void *); +int nlm4svc_decode_void(struct svc_rqst *, u32 *, void *); +int nlm4svc_decode_shareargs(struct svc_rqst *, u32 *, struct nlm_args *); +int nlm4svc_encode_shareres(struct svc_rqst *, u32 *, struct nlm_res *); +int nlm4svc_decode_notify(struct svc_rqst *, u32 *, struct nlm_args *); +int nlm4svc_decode_reboot(struct svc_rqst *, u32 *, struct nlm_reboot *); +/* +int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *); +int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *); +int nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *); +int nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *); + */ + +#endif /* LOCKD_XDR4_H */ |