Deleted Added
full compact
nfsm_subs.h (36541) nfsm_subs.h (42060)
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 * $Id: nfsm_subs.h,v 1.20 1998/05/31 19:00:19 peter Exp $
37 * $Id: nfsm_subs.h,v 1.21 1998/05/31 20:08:57 peter Exp $
38 */
39
40
41#ifndef _NFS_NFSM_SUBS_H_
42#define _NFS_NFSM_SUBS_H_
43
44struct ucred;
45struct vnode;

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

230 } \
231 nfsm_postop_attr((v), ttattrf); \
232 if (f) { \
233 (f) = ttretf; \
234 } else { \
235 (f) = ttattrf; \
236 } }
237
38 */
39
40
41#ifndef _NFS_NFSM_SUBS_H_
42#define _NFS_NFSM_SUBS_H_
43
44struct ucred;
45struct vnode;

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

230 } \
231 nfsm_postop_attr((v), ttattrf); \
232 if (f) { \
233 (f) = ttretf; \
234 } else { \
235 (f) = ttattrf; \
236 } }
237
238#define nfsm_v3sattr(s, a) \
239 { (s)->sa_modetrue = nfs_true; \
240 (s)->sa_mode = vtonfsv3_mode((a)->va_mode); \
241 (s)->sa_uidfalse = nfs_false; \
242 (s)->sa_gidfalse = nfs_false; \
243 (s)->sa_sizefalse = nfs_false; \
244 (s)->sa_atimetype = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
245 txdr_nfsv3time(&(a)->va_atime, &(s)->sa_atime); \
246 (s)->sa_mtimetype = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
247 txdr_nfsv3time(&(a)->va_mtime, &(s)->sa_mtime); \
238/* If full is true, set all fields, otherwise just set mode and time fields */
239#define nfsm_v3attrbuild(a, full) \
240 { if ((a)->va_mode != (mode_t)VNOVAL) { \
241 nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
242 *tl++ = nfs_true; \
243 *tl = txdr_unsigned((a)->va_mode); \
244 } else { \
245 nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
246 *tl = nfs_false; \
247 } \
248 if ((full) && (a)->va_uid != (uid_t)VNOVAL) { \
249 nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
250 *tl++ = nfs_true; \
251 *tl = txdr_unsigned((a)->va_uid); \
252 } else { \
253 nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
254 *tl = nfs_false; \
255 } \
256 if ((full) && (a)->va_gid != (gid_t)VNOVAL) { \
257 nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED); \
258 *tl++ = nfs_true; \
259 *tl = txdr_unsigned((a)->va_gid); \
260 } else { \
261 nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
262 *tl = nfs_false; \
263 } \
264 if ((full) && (a)->va_size != VNOVAL) { \
265 nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED); \
266 *tl++ = nfs_true; \
267 txdr_hyper(&(a)->va_size, tl); \
268 } else { \
269 nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
270 *tl = nfs_false; \
271 } \
272 if ((a)->va_atime.tv_sec != VNOVAL) { \
273 if ((a)->va_atime.tv_sec != time_second) { \
274 nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED); \
275 *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
276 txdr_nfsv3time(&(a)->va_atime, tl); \
277 } else { \
278 nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
279 *tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER); \
280 } \
281 } else { \
282 nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
283 *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE); \
284 } \
285 if ((a)->va_mtime.tv_sec != VNOVAL) { \
286 if ((a)->va_mtime.tv_sec != time_second) { \
287 nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED); \
288 *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
289 txdr_nfsv3time(&(a)->va_mtime, tl); \
290 } else { \
291 nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
292 *tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER); \
293 } \
294 } else { \
295 nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED); \
296 *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE); \
297 } \
248 }
298 }
299
249
250#define nfsm_strsiz(s,m) \
251 { nfsm_dissect(tl,u_int32_t *,NFSX_UNSIGNED); \
252 if (((s) = fxdr_unsigned(int32_t,*tl)) > (m)) { \
253 m_freem(mrep); \
254 error = EBADRPC; \
255 goto nfsmout; \
256 } }

--- 198 unchanged lines hidden ---
300
301#define nfsm_strsiz(s,m) \
302 { nfsm_dissect(tl,u_int32_t *,NFSX_UNSIGNED); \
303 if (((s) = fxdr_unsigned(int32_t,*tl)) > (m)) { \
304 m_freem(mrep); \
305 error = EBADRPC; \
306 goto nfsmout; \
307 } }

--- 198 unchanged lines hidden ---