Deleted Added
full compact
nfsm_subs.h (84079) nfsm_subs.h (88091)
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)nfsm_subs.h 8.2 (Berkeley) 3/30/95
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)nfsm_subs.h 8.2 (Berkeley) 3/30/95
37 * $FreeBSD: head/sys/nfsclient/nfsm_subs.h 84079 2001-09-28 04:37:08Z peter $
37 * $FreeBSD: head/sys/nfsclient/nfsm_subs.h 88091 2001-12-18 01:22:09Z iedowse $
38 */
39
40#ifndef _NFSCLIENT_NFSM_SUBS_H_
41#define _NFSCLIENT_NFSM_SUBS_H_
42
43#include <nfs/nfs_common.h>
44
45#define nfsv2tov_type(a) nv2tov_type[fxdr_unsigned(u_int32_t,(a))&0x7]

--- 41 unchanged lines hidden (view full) ---

87 * fairly clean and deals with the mess caused by the xdr discriminating
88 * unions.
89 */
90
91
92/* *********************************** */
93/* Request generation phase macros */
94
38 */
39
40#ifndef _NFSCLIENT_NFSM_SUBS_H_
41#define _NFSCLIENT_NFSM_SUBS_H_
42
43#include <nfs/nfs_common.h>
44
45#define nfsv2tov_type(a) nv2tov_type[fxdr_unsigned(u_int32_t,(a))&0x7]

--- 41 unchanged lines hidden (view full) ---

87 * fairly clean and deals with the mess caused by the xdr discriminating
88 * unions.
89 */
90
91
92/* *********************************** */
93/* Request generation phase macros */
94
95int nfsm_fhtom_xx(struct vnode *v, int v3, u_int32_t **tl,
96 struct mbuf **mb, caddr_t *bpos);
97void nfsm_v3attrbuild_xx(struct vattr *va, int full, u_int32_t **tl,
98 struct mbuf **mb, caddr_t *bpos);
99int nfsm_strtom_xx(const char *a, int s, int m, u_int32_t **tl,
100 struct mbuf **mb, caddr_t *bpos);
95int nfsm_fhtom_xx(struct vnode *v, int v3, struct mbuf **mb,
96 caddr_t *bpos);
97void nfsm_v3attrbuild_xx(struct vattr *va, int full, struct mbuf **mb,
98 caddr_t *bpos);
99int nfsm_strtom_xx(const char *a, int s, int m, struct mbuf **mb,
100 caddr_t *bpos);
101
102#define nfsm_bcheck(t1, mreq) \
103do { \
104 if (t1) { \
105 error = t1; \
106 m_freem(mreq); \
107 goto nfsmout; \
108 } \
109} while (0)
110
111#define nfsm_fhtom(v, v3) \
112do { \
113 int32_t t1; \
101
102#define nfsm_bcheck(t1, mreq) \
103do { \
104 if (t1) { \
105 error = t1; \
106 m_freem(mreq); \
107 goto nfsmout; \
108 } \
109} while (0)
110
111#define nfsm_fhtom(v, v3) \
112do { \
113 int32_t t1; \
114 t1 = nfsm_fhtom_xx((v), (v3), &tl, &mb, &bpos); \
114 t1 = nfsm_fhtom_xx((v), (v3), &mb, &bpos); \
115 nfsm_bcheck(t1, mreq); \
116} while (0)
117
118/* If full is true, set all fields, otherwise just set mode and time fields */
119#define nfsm_v3attrbuild(a, full) \
115 nfsm_bcheck(t1, mreq); \
116} while (0)
117
118/* If full is true, set all fields, otherwise just set mode and time fields */
119#define nfsm_v3attrbuild(a, full) \
120 nfsm_v3attrbuild_xx(a, full, &tl, &mb, &bpos)
120 nfsm_v3attrbuild_xx(a, full, &mb, &bpos)
121
122#define nfsm_uiotom(p, s) \
123do { \
124 int t1; \
125 t1 = nfsm_uiotombuf((p), &mb, (s), &bpos); \
126 nfsm_bcheck(t1, mreq); \
127} while (0)
128
129#define nfsm_strtom(a, s, m) \
130do { \
131 int t1; \
121
122#define nfsm_uiotom(p, s) \
123do { \
124 int t1; \
125 t1 = nfsm_uiotombuf((p), &mb, (s), &bpos); \
126 nfsm_bcheck(t1, mreq); \
127} while (0)
128
129#define nfsm_strtom(a, s, m) \
130do { \
131 int t1; \
132 t1 = nfsm_strtom_xx((a), (s), (m), &tl, &mb, &bpos); \
132 t1 = nfsm_strtom_xx((a), (s), (m), &mb, &bpos); \
133 nfsm_bcheck(t1, mreq); \
134} while (0)
135
136/* *********************************** */
137/* Send the request */
138
139#define nfsm_request(v, t, p, c) \
140do { \

--- 5 unchanged lines hidden (view full) ---

146 goto nfsmout; \
147 } \
148} while (0)
149
150/* *********************************** */
151/* Reply interpretation phase macros */
152
153int nfsm_mtofh_xx(struct vnode *d, struct vnode **v, int v3, int *f,
133 nfsm_bcheck(t1, mreq); \
134} while (0)
135
136/* *********************************** */
137/* Send the request */
138
139#define nfsm_request(v, t, p, c) \
140do { \

--- 5 unchanged lines hidden (view full) ---

146 goto nfsmout; \
147 } \
148} while (0)
149
150/* *********************************** */
151/* Reply interpretation phase macros */
152
153int nfsm_mtofh_xx(struct vnode *d, struct vnode **v, int v3, int *f,
154 u_int32_t **tl, struct mbuf **md, caddr_t *dpos);
155int nfsm_getfh_xx(nfsfh_t **f, int *s, int v3, u_int32_t **tl,
156 struct mbuf **md, caddr_t *dpos);
154 struct mbuf **md, caddr_t *dpos);
157int nfsm_loadattr_xx(struct vnode **v, struct vattr *va, u_int32_t **tl,
158 struct mbuf **md, caddr_t *dpos);
159int nfsm_postop_attr_xx(struct vnode **v, int *f, u_int32_t **tl,
160 struct mbuf **md, caddr_t *dpos);
161int nfsm_wcc_data_xx(struct vnode **v, int *f, u_int32_t **tl,
162 struct mbuf **md, caddr_t *dpos);
155int nfsm_getfh_xx(nfsfh_t **f, int *s, int v3, struct mbuf **md,
156 caddr_t *dpos);
157int nfsm_loadattr_xx(struct vnode **v, struct vattr *va, struct mbuf **md,
158 caddr_t *dpos);
159int nfsm_postop_attr_xx(struct vnode **v, int *f, struct mbuf **md,
160 caddr_t *dpos);
161int nfsm_wcc_data_xx(struct vnode **v, int *f, struct mbuf **md,
162 caddr_t *dpos);
163
164#define nfsm_mtofh(d, v, v3, f) \
165do { \
166 int32_t t1; \
163
164#define nfsm_mtofh(d, v, v3, f) \
165do { \
166 int32_t t1; \
167 t1 = nfsm_mtofh_xx((d), &(v), (v3), &(f), &tl, &md, &dpos); \
167 t1 = nfsm_mtofh_xx((d), &(v), (v3), &(f), &md, &dpos); \
168 nfsm_dcheck(t1, mrep); \
169} while (0)
170
171#define nfsm_getfh(f, s, v3) \
172do { \
173 int32_t t1; \
168 nfsm_dcheck(t1, mrep); \
169} while (0)
170
171#define nfsm_getfh(f, s, v3) \
172do { \
173 int32_t t1; \
174 t1 = nfsm_getfh_xx(&(f), &(s), (v3), &tl, &md, &dpos); \
174 t1 = nfsm_getfh_xx(&(f), &(s), (v3), &md, &dpos); \
175 nfsm_dcheck(t1, mrep); \
176} while (0)
177
178#define nfsm_loadattr(v, a) \
179do { \
180 int32_t t1; \
175 nfsm_dcheck(t1, mrep); \
176} while (0)
177
178#define nfsm_loadattr(v, a) \
179do { \
180 int32_t t1; \
181 t1 = nfsm_loadattr_xx(&v, a, &tl, &md, &dpos); \
181 t1 = nfsm_loadattr_xx(&v, a, &md, &dpos); \
182 nfsm_dcheck(t1, mrep); \
183} while (0)
184
185#define nfsm_postop_attr(v, f) \
186do { \
187 int32_t t1; \
182 nfsm_dcheck(t1, mrep); \
183} while (0)
184
185#define nfsm_postop_attr(v, f) \
186do { \
187 int32_t t1; \
188 t1 = nfsm_postop_attr_xx(&v, &f, &tl, &md, &dpos); \
188 t1 = nfsm_postop_attr_xx(&v, &f, &md, &dpos); \
189 nfsm_dcheck(t1, mrep); \
190} while (0)
191
192/* Used as (f) for nfsm_wcc_data() */
193#define NFSV3_WCCRATTR 0
194#define NFSV3_WCCCHK 1
195
196#define nfsm_wcc_data(v, f) \
197do { \
198 int32_t t1; \
189 nfsm_dcheck(t1, mrep); \
190} while (0)
191
192/* Used as (f) for nfsm_wcc_data() */
193#define NFSV3_WCCRATTR 0
194#define NFSV3_WCCCHK 1
195
196#define nfsm_wcc_data(v, f) \
197do { \
198 int32_t t1; \
199 t1 = nfsm_wcc_data_xx(&v, &f, &tl, &md, &dpos); \
199 t1 = nfsm_wcc_data_xx(&v, &f, &md, &dpos); \
200 nfsm_dcheck(t1, mrep); \
201} while (0)
202
203#endif
200 nfsm_dcheck(t1, mrep); \
201} while (0)
202
203#endif