]>
Commit | Line | Data |
---|---|---|
1da177e4 | 1 | /* |
f30c2269 | 2 | * linux/include/linux/nfsd/xdr.h |
1da177e4 LT |
3 | * |
4 | * XDR types for nfsd. This is mainly a typing exercise. | |
5 | */ | |
6 | ||
7 | #ifndef LINUX_NFSD_H | |
8 | #define LINUX_NFSD_H | |
9 | ||
1da177e4 | 10 | #include <linux/vfs.h> |
72579ac9 | 11 | #include <linux/nfsd/nfsd.h> |
1da177e4 LT |
12 | |
13 | struct nfsd_fhandle { | |
14 | struct svc_fh fh; | |
15 | }; | |
16 | ||
17 | struct nfsd_sattrargs { | |
18 | struct svc_fh fh; | |
19 | struct iattr attrs; | |
20 | }; | |
21 | ||
22 | struct nfsd_diropargs { | |
23 | struct svc_fh fh; | |
24 | char * name; | |
29d5e555 | 25 | unsigned int len; |
1da177e4 LT |
26 | }; |
27 | ||
28 | struct nfsd_readargs { | |
29 | struct svc_fh fh; | |
30 | __u32 offset; | |
31 | __u32 count; | |
1da177e4 LT |
32 | int vlen; |
33 | }; | |
34 | ||
35 | struct nfsd_writeargs { | |
36 | svc_fh fh; | |
37 | __u32 offset; | |
38 | int len; | |
1da177e4 LT |
39 | int vlen; |
40 | }; | |
41 | ||
42 | struct nfsd_createargs { | |
43 | struct svc_fh fh; | |
44 | char * name; | |
29d5e555 | 45 | unsigned int len; |
1da177e4 LT |
46 | struct iattr attrs; |
47 | }; | |
48 | ||
49 | struct nfsd_renameargs { | |
50 | struct svc_fh ffh; | |
51 | char * fname; | |
29d5e555 | 52 | unsigned int flen; |
1da177e4 LT |
53 | struct svc_fh tfh; |
54 | char * tname; | |
29d5e555 | 55 | unsigned int tlen; |
1da177e4 LT |
56 | }; |
57 | ||
58 | struct nfsd_readlinkargs { | |
59 | struct svc_fh fh; | |
60 | char * buffer; | |
61 | }; | |
62 | ||
63 | struct nfsd_linkargs { | |
64 | struct svc_fh ffh; | |
65 | struct svc_fh tfh; | |
66 | char * tname; | |
29d5e555 | 67 | unsigned int tlen; |
1da177e4 LT |
68 | }; |
69 | ||
70 | struct nfsd_symlinkargs { | |
71 | struct svc_fh ffh; | |
72 | char * fname; | |
29d5e555 | 73 | unsigned int flen; |
1da177e4 | 74 | char * tname; |
48b4ba3f | 75 | unsigned int tlen; |
1da177e4 LT |
76 | struct iattr attrs; |
77 | }; | |
78 | ||
79 | struct nfsd_readdirargs { | |
80 | struct svc_fh fh; | |
81 | __u32 cookie; | |
82 | __u32 count; | |
131a21c2 | 83 | __be32 * buffer; |
1da177e4 LT |
84 | }; |
85 | ||
86 | struct nfsd_attrstat { | |
87 | struct svc_fh fh; | |
a334de28 | 88 | struct kstat stat; |
1da177e4 LT |
89 | }; |
90 | ||
91 | struct nfsd_diropres { | |
92 | struct svc_fh fh; | |
a334de28 | 93 | struct kstat stat; |
1da177e4 LT |
94 | }; |
95 | ||
96 | struct nfsd_readlinkres { | |
97 | int len; | |
98 | }; | |
99 | ||
100 | struct nfsd_readres { | |
101 | struct svc_fh fh; | |
102 | unsigned long count; | |
a334de28 | 103 | struct kstat stat; |
1da177e4 LT |
104 | }; |
105 | ||
106 | struct nfsd_readdirres { | |
107 | int count; | |
108 | ||
109 | struct readdir_cd common; | |
131a21c2 | 110 | __be32 * buffer; |
1da177e4 | 111 | int buflen; |
131a21c2 | 112 | __be32 * offset; |
1da177e4 LT |
113 | }; |
114 | ||
115 | struct nfsd_statfsres { | |
116 | struct kstatfs stats; | |
117 | }; | |
118 | ||
119 | /* | |
120 | * Storage requirements for XDR arguments and results. | |
121 | */ | |
122 | union nfsd_xdrstore { | |
123 | struct nfsd_sattrargs sattr; | |
124 | struct nfsd_diropargs dirop; | |
125 | struct nfsd_readargs read; | |
126 | struct nfsd_writeargs write; | |
127 | struct nfsd_createargs create; | |
128 | struct nfsd_renameargs rename; | |
129 | struct nfsd_linkargs link; | |
130 | struct nfsd_symlinkargs symlink; | |
131 | struct nfsd_readdirargs readdir; | |
132 | }; | |
133 | ||
134 | #define NFS2_SVC_XDRSIZE sizeof(union nfsd_xdrstore) | |
135 | ||
136 | ||
131a21c2 AV |
137 | int nfssvc_decode_void(struct svc_rqst *, __be32 *, void *); |
138 | int nfssvc_decode_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *); | |
139 | int nfssvc_decode_sattrargs(struct svc_rqst *, __be32 *, | |
1da177e4 | 140 | struct nfsd_sattrargs *); |
131a21c2 | 141 | int nfssvc_decode_diropargs(struct svc_rqst *, __be32 *, |
1da177e4 | 142 | struct nfsd_diropargs *); |
131a21c2 | 143 | int nfssvc_decode_readargs(struct svc_rqst *, __be32 *, |
1da177e4 | 144 | struct nfsd_readargs *); |
131a21c2 | 145 | int nfssvc_decode_writeargs(struct svc_rqst *, __be32 *, |
1da177e4 | 146 | struct nfsd_writeargs *); |
131a21c2 | 147 | int nfssvc_decode_createargs(struct svc_rqst *, __be32 *, |
1da177e4 | 148 | struct nfsd_createargs *); |
131a21c2 | 149 | int nfssvc_decode_renameargs(struct svc_rqst *, __be32 *, |
1da177e4 | 150 | struct nfsd_renameargs *); |
131a21c2 | 151 | int nfssvc_decode_readlinkargs(struct svc_rqst *, __be32 *, |
1da177e4 | 152 | struct nfsd_readlinkargs *); |
131a21c2 | 153 | int nfssvc_decode_linkargs(struct svc_rqst *, __be32 *, |
1da177e4 | 154 | struct nfsd_linkargs *); |
131a21c2 | 155 | int nfssvc_decode_symlinkargs(struct svc_rqst *, __be32 *, |
1da177e4 | 156 | struct nfsd_symlinkargs *); |
131a21c2 | 157 | int nfssvc_decode_readdirargs(struct svc_rqst *, __be32 *, |
1da177e4 | 158 | struct nfsd_readdirargs *); |
131a21c2 AV |
159 | int nfssvc_encode_void(struct svc_rqst *, __be32 *, void *); |
160 | int nfssvc_encode_attrstat(struct svc_rqst *, __be32 *, struct nfsd_attrstat *); | |
161 | int nfssvc_encode_diropres(struct svc_rqst *, __be32 *, struct nfsd_diropres *); | |
162 | int nfssvc_encode_readlinkres(struct svc_rqst *, __be32 *, struct nfsd_readlinkres *); | |
163 | int nfssvc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd_readres *); | |
164 | int nfssvc_encode_statfsres(struct svc_rqst *, __be32 *, struct nfsd_statfsres *); | |
165 | int nfssvc_encode_readdirres(struct svc_rqst *, __be32 *, struct nfsd_readdirres *); | |
1da177e4 | 166 | |
a0ad13ef N |
167 | int nfssvc_encode_entry(void *, const char *name, |
168 | int namlen, loff_t offset, u64 ino, unsigned int); | |
1da177e4 | 169 | |
131a21c2 | 170 | int nfssvc_release_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *); |
1da177e4 | 171 | |
a257cdd0 | 172 | /* Helper functions for NFSv2 ACL code */ |
131a21c2 AV |
173 | __be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp); |
174 | __be32 *nfs2svc_decode_fh(__be32 *p, struct svc_fh *fhp); | |
a257cdd0 | 175 | |
1da177e4 | 176 | #endif /* LINUX_NFSD_H */ |