~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/lockd/xdr.h

Version: ~ [ linux-5.15-rc1 ] ~ [ linux-5.14.5 ] ~ [ linux-5.13.18 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.66 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.147 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.206 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.246 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.282 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.283 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * linux/include/linux/lockd/xdr.h
  3  *
  4  * XDR types for the NLM protocol
  5  *
  6  * Copyright (C) 1996 Olaf Kirch <okir@monad.swb.de>
  7  */
  8 
  9 #ifndef LOCKD_XDR_H
 10 #define LOCKD_XDR_H
 11 
 12 #include <linux/fs.h>
 13 #include <linux/nfs.h>
 14 #include <linux/sunrpc/xdr.h>
 15 
 16 #define SM_MAXSTRLEN            1024
 17 #define SM_PRIV_SIZE            16
 18 
 19 struct nsm_private {
 20         unsigned char           data[SM_PRIV_SIZE];
 21 };
 22 
 23 struct svc_rqst;
 24 
 25 #define NLM_MAXCOOKIELEN        32
 26 #define NLM_MAXSTRLEN           1024
 27 
 28 #define nlm_granted             cpu_to_be32(NLM_LCK_GRANTED)
 29 #define nlm_lck_denied          cpu_to_be32(NLM_LCK_DENIED)
 30 #define nlm_lck_denied_nolocks  cpu_to_be32(NLM_LCK_DENIED_NOLOCKS)
 31 #define nlm_lck_blocked         cpu_to_be32(NLM_LCK_BLOCKED)
 32 #define nlm_lck_denied_grace_period     cpu_to_be32(NLM_LCK_DENIED_GRACE_PERIOD)
 33 
 34 #define nlm_drop_reply          cpu_to_be32(30000)
 35 
 36 /* Lock info passed via NLM */
 37 struct nlm_lock {
 38         char *                  caller;
 39         unsigned int            len;    /* length of "caller" */
 40         struct nfs_fh           fh;
 41         struct xdr_netobj       oh;
 42         u32                     svid;
 43         struct file_lock        fl;
 44 };
 45 
 46 /*
 47  *      NLM cookies. Technically they can be 1K, but Linux only uses 8 bytes.
 48  *      FreeBSD uses 16, Apple Mac OS X 10.3 uses 20. Therefore we set it to
 49  *      32 bytes.
 50  */
 51  
 52 struct nlm_cookie
 53 {
 54         unsigned char data[NLM_MAXCOOKIELEN];
 55         unsigned int len;
 56 };
 57 
 58 /*
 59  * Generic lockd arguments for all but sm_notify
 60  */
 61 struct nlm_args {
 62         struct nlm_cookie       cookie;
 63         struct nlm_lock         lock;
 64         u32                     block;
 65         u32                     reclaim;
 66         u32                     state;
 67         u32                     monitor;
 68         u32                     fsm_access;
 69         u32                     fsm_mode;
 70 };
 71 
 72 typedef struct nlm_args nlm_args;
 73 
 74 /*
 75  * Generic lockd result
 76  */
 77 struct nlm_res {
 78         struct nlm_cookie       cookie;
 79         __be32                  status;
 80         struct nlm_lock         lock;
 81 };
 82 
 83 /*
 84  * statd callback when client has rebooted
 85  */
 86 struct nlm_reboot {
 87         char                    *mon;
 88         unsigned int            len;
 89         u32                     state;
 90         struct nsm_private      priv;
 91 };
 92 
 93 /*
 94  * Contents of statd callback when monitored host rebooted
 95  */
 96 #define NLMSVC_XDRSIZE          sizeof(struct nlm_args)
 97 
 98 int     nlmsvc_decode_testargs(struct svc_rqst *, __be32 *, struct nlm_args *);
 99 int     nlmsvc_encode_testres(struct svc_rqst *, __be32 *, struct nlm_res *);
100 int     nlmsvc_decode_lockargs(struct svc_rqst *, __be32 *, struct nlm_args *);
101 int     nlmsvc_decode_cancargs(struct svc_rqst *, __be32 *, struct nlm_args *);
102 int     nlmsvc_decode_unlockargs(struct svc_rqst *, __be32 *, struct nlm_args *);
103 int     nlmsvc_encode_res(struct svc_rqst *, __be32 *, struct nlm_res *);
104 int     nlmsvc_decode_res(struct svc_rqst *, __be32 *, struct nlm_res *);
105 int     nlmsvc_encode_void(struct svc_rqst *, __be32 *, void *);
106 int     nlmsvc_decode_void(struct svc_rqst *, __be32 *, void *);
107 int     nlmsvc_decode_shareargs(struct svc_rqst *, __be32 *, struct nlm_args *);
108 int     nlmsvc_encode_shareres(struct svc_rqst *, __be32 *, struct nlm_res *);
109 int     nlmsvc_decode_notify(struct svc_rqst *, __be32 *, struct nlm_args *);
110 int     nlmsvc_decode_reboot(struct svc_rqst *, __be32 *, struct nlm_reboot *);
111 /*
112 int     nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *);
113 int     nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
114 int     nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *);
115 int     nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
116  */
117 
118 #endif /* LOCKD_XDR_H */
119 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp