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

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

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * linux/include/linux/lockd/xdr.h
  4  *
  5  * XDR types for the NLM protocol
  6  *
  7  * Copyright (C) 1996 Olaf Kirch <okir@monad.swb.de>
  8  */
  9 
 10 #ifndef LOCKD_XDR_H
 11 #define LOCKD_XDR_H
 12 
 13 #include <linux/fs.h>
 14 #include <linux/filelock.h>
 15 #include <linux/nfs.h>
 16 #include <linux/sunrpc/xdr.h>
 17 
 18 #define SM_MAXSTRLEN            1024
 19 #define SM_PRIV_SIZE            16
 20 
 21 struct nsm_private {
 22         unsigned char           data[SM_PRIV_SIZE];
 23 };
 24 
 25 struct svc_rqst;
 26 
 27 #define NLM_MAXCOOKIELEN        32
 28 #define NLM_MAXSTRLEN           1024
 29 
 30 #define nlm_granted             cpu_to_be32(NLM_LCK_GRANTED)
 31 #define nlm_lck_denied          cpu_to_be32(NLM_LCK_DENIED)
 32 #define nlm_lck_denied_nolocks  cpu_to_be32(NLM_LCK_DENIED_NOLOCKS)
 33 #define nlm_lck_blocked         cpu_to_be32(NLM_LCK_BLOCKED)
 34 #define nlm_lck_denied_grace_period     cpu_to_be32(NLM_LCK_DENIED_GRACE_PERIOD)
 35 
 36 #define nlm_drop_reply          cpu_to_be32(30000)
 37 
 38 /* Lock info passed via NLM */
 39 struct nlm_lock {
 40         char *                  caller;
 41         unsigned int            len;    /* length of "caller" */
 42         struct nfs_fh           fh;
 43         struct xdr_netobj       oh;
 44         u32                     svid;
 45         u64                     lock_start;
 46         u64                     lock_len;
 47         struct file_lock        fl;
 48 };
 49 
 50 /*
 51  *      NLM cookies. Technically they can be 1K, but Linux only uses 8 bytes.
 52  *      FreeBSD uses 16, Apple Mac OS X 10.3 uses 20. Therefore we set it to
 53  *      32 bytes.
 54  */
 55 
 56 struct nlm_cookie
 57 {
 58         unsigned char data[NLM_MAXCOOKIELEN];
 59         unsigned int len;
 60 };
 61 
 62 /*
 63  * Generic lockd arguments for all but sm_notify
 64  */
 65 struct nlm_args {
 66         struct nlm_cookie       cookie;
 67         struct nlm_lock         lock;
 68         u32                     block;
 69         u32                     reclaim;
 70         u32                     state;
 71         u32                     monitor;
 72         u32                     fsm_access;
 73         u32                     fsm_mode;
 74 };
 75 
 76 typedef struct nlm_args nlm_args;
 77 
 78 /*
 79  * Generic lockd result
 80  */
 81 struct nlm_res {
 82         struct nlm_cookie       cookie;
 83         __be32                  status;
 84         struct nlm_lock         lock;
 85 };
 86 
 87 /*
 88  * statd callback when client has rebooted
 89  */
 90 struct nlm_reboot {
 91         char                    *mon;
 92         unsigned int            len;
 93         u32                     state;
 94         struct nsm_private      priv;
 95 };
 96 
 97 /*
 98  * Contents of statd callback when monitored host rebooted
 99  */
100 #define NLMSVC_XDRSIZE          sizeof(struct nlm_args)
101 
102 bool    nlmsvc_decode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr);
103 bool    nlmsvc_decode_testargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
104 bool    nlmsvc_decode_lockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
105 bool    nlmsvc_decode_cancargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
106 bool    nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
107 bool    nlmsvc_decode_res(struct svc_rqst *rqstp, struct xdr_stream *xdr);
108 bool    nlmsvc_decode_reboot(struct svc_rqst *rqstp, struct xdr_stream *xdr);
109 bool    nlmsvc_decode_shareargs(struct svc_rqst *rqstp, struct xdr_stream *xdr);
110 bool    nlmsvc_decode_notify(struct svc_rqst *rqstp, struct xdr_stream *xdr);
111 
112 bool    nlmsvc_encode_testres(struct svc_rqst *rqstp, struct xdr_stream *xdr);
113 bool    nlmsvc_encode_res(struct svc_rqst *rqstp, struct xdr_stream *xdr);
114 bool    nlmsvc_encode_void(struct svc_rqst *rqstp, struct xdr_stream *xdr);
115 bool    nlmsvc_encode_shareres(struct svc_rqst *rqstp, struct xdr_stream *xdr);
116 
117 #endif /* LOCKD_XDR_H */
118 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php