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

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

Version: ~ [ linux-5.18-rc6 ] ~ [ linux-5.17.6 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.38 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.114 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.192 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.241 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.277 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.312 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.302 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ 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.9 ] ~ [ 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 NLM_MAXSTRLEN           1024
 17 
 18 #define QUADLEN(len)            (((len) + 3) >> 2)
 19 
 20 #define nlm_granted             __constant_htonl(NLM_LCK_GRANTED)
 21 #define nlm_lck_denied          __constant_htonl(NLM_LCK_DENIED)
 22 #define nlm_lck_denied_nolocks  __constant_htonl(NLM_LCK_DENIED_NOLOCKS)
 23 #define nlm_lck_blocked         __constant_htonl(NLM_LCK_BLOCKED)
 24 #define nlm_lck_denied_grace_period     __constant_htonl(NLM_LCK_DENIED_GRACE_PERIOD)
 25 
 26 /* Lock info passed via NLM */
 27 struct nlm_lock {
 28         char *                  caller;
 29         int                     len;    /* length of "caller" */
 30         struct nfs_fh           fh;
 31         struct xdr_netobj       oh;
 32         struct file_lock        fl;
 33 };
 34 
 35 /*
 36  *      NLM cookies. Technically they can be 1K, Few people use over 8 bytes,
 37  *      FreeBSD uses 16, Apple Mac OS-X 10.3 uses 20.
 38  */
 39  
 40 struct nlm_cookie
 41 {
 42         unsigned int len;
 43 #define NLM_MAXCOOKIELEN        32
 44         unsigned char data[NLM_MAXCOOKIELEN];
 45 };
 46 
 47 /*
 48  * Generic lockd arguments for all but sm_notify
 49  */
 50 struct nlm_args {
 51         struct nlm_cookie       cookie;
 52         struct nlm_lock         lock;
 53         u32                     block;
 54         u32                     reclaim;
 55         u32                     state;
 56         u32                     monitor;
 57         u32                     fsm_access;
 58         u32                     fsm_mode;
 59 };
 60 
 61 typedef struct nlm_args nlm_args;
 62 
 63 /*
 64  * Generic lockd result
 65  */
 66 struct nlm_res {
 67         struct nlm_cookie       cookie;
 68         u32                     status;
 69         struct nlm_lock         lock;
 70 };
 71 
 72 /*
 73  * statd callback when client has rebooted
 74  */
 75 struct nlm_reboot {
 76         char *          mon;
 77         int             len;
 78         u32             state;
 79         u32             addr;
 80 };
 81 
 82 /*
 83  * Contents of statd callback when monitored host rebooted
 84  */
 85 #define NLMSVC_XDRSIZE          sizeof(struct nlm_args)
 86 
 87 int     nlmsvc_decode_testargs(struct svc_rqst *, u32 *, struct nlm_args *);
 88 int     nlmsvc_encode_testres(struct svc_rqst *, u32 *, struct nlm_res *);
 89 int     nlmsvc_decode_lockargs(struct svc_rqst *, u32 *, struct nlm_args *);
 90 int     nlmsvc_decode_cancargs(struct svc_rqst *, u32 *, struct nlm_args *);
 91 int     nlmsvc_decode_unlockargs(struct svc_rqst *, u32 *, struct nlm_args *);
 92 int     nlmsvc_encode_res(struct svc_rqst *, u32 *, struct nlm_res *);
 93 int     nlmsvc_decode_res(struct svc_rqst *, u32 *, struct nlm_res *);
 94 int     nlmsvc_encode_void(struct svc_rqst *, u32 *, void *);
 95 int     nlmsvc_decode_void(struct svc_rqst *, u32 *, void *);
 96 int     nlmsvc_decode_shareargs(struct svc_rqst *, u32 *, struct nlm_args *);
 97 int     nlmsvc_encode_shareres(struct svc_rqst *, u32 *, struct nlm_res *);
 98 int     nlmsvc_decode_notify(struct svc_rqst *, u32 *, struct nlm_args *);
 99 int     nlmsvc_decode_reboot(struct svc_rqst *, u32 *, struct nlm_reboot *);
100 /*
101 int     nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *);
102 int     nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
103 int     nlmclt_encode_cancargs(struct rpc_rqst *, u32 *, struct nlm_args *);
104 int     nlmclt_encode_unlockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
105  */
106 
107 #endif /* LOCKD_XDR_H */
108 

~ [ 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