Deleted Added
full compact
nfs_common.h (48125) nfs_common.h (49405)
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.23 1999/06/05 05:35:03 peter Exp $
37 * $Id: nfsm_subs.h,v 1.24 1999/06/23 04:44:14 julian Exp $
38 */
39
40
41#ifndef _NFS_NFSM_SUBS_H_
42#define _NFS_NFSM_SUBS_H_
43
44struct ucred;
45struct vnode;

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

414 dpos += (s); \
415 } else if ((t1 = nfs_adv(&md, &dpos, (s), t1)) != 0) { \
416 error = t1; \
417 m_freem(mrep); \
418 goto nfsmout; \
419 } }
420
421#define nfsm_srvmtofh(f) \
38 */
39
40
41#ifndef _NFS_NFSM_SUBS_H_
42#define _NFS_NFSM_SUBS_H_
43
44struct ucred;
45struct vnode;

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

414 dpos += (s); \
415 } else if ((t1 = nfs_adv(&md, &dpos, (s), t1)) != 0) { \
416 error = t1; \
417 m_freem(mrep); \
418 goto nfsmout; \
419 } }
420
421#define nfsm_srvmtofh(f) \
422 { int fhlen = NFSX_V3FH; \
422 do { \
423 int fhlen; \
423 if (nfsd->nd_flag & ND_NFSV3) { \
424 nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
425 fhlen = fxdr_unsigned(int, *tl); \
424 if (nfsd->nd_flag & ND_NFSV3) { \
425 nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); \
426 fhlen = fxdr_unsigned(int, *tl); \
426 if (fhlen == 0) { \
427 bzero((caddr_t)(f), NFSX_V3FH); \
428 } else if (fhlen != NFSX_V3FH) { \
427 if (fhlen != 0 && fhlen != NFSX_V3FH) { \
429 error = EBADRPC; \
430 nfsm_reply(0); \
431 } \
428 error = EBADRPC; \
429 nfsm_reply(0); \
430 } \
431 } else { \
432 fhlen = NFSX_V2FH; \
432 } \
433 if (fhlen != 0) { \
433 } \
434 if (fhlen != 0) { \
434 nfsm_dissect(tl, u_int32_t *, NFSX_V3FH); \
435 bcopy((caddr_t)tl, (caddr_t)(f), NFSX_V3FH); \
436 if ((nfsd->nd_flag & ND_NFSV3) == 0) \
437 nfsm_adv(NFSX_V2FH - NFSX_V3FH); \
435 nfsm_dissect(tl, u_int32_t *, fhlen); \
436 bcopy((caddr_t)tl, (caddr_t)(f), fhlen); \
437 } else {\
438 bzero((caddr_t)(f), NFSX_V3FH); \
438 } \
439 } \
439 }
440 } while (0)
440
441#define nfsm_clget \
442 if (bp >= be) { \
443 if (mp == mb) \
444 mp->m_len += bp-bpos; \
445 MGET(mp, M_WAIT, MT_DATA); \
446 MCLGET(mp, M_WAIT); \
447 mp->m_len = NFSMSIZ(mp); \

--- 59 unchanged lines hidden ---
441
442#define nfsm_clget \
443 if (bp >= be) { \
444 if (mp == mb) \
445 mp->m_len += bp-bpos; \
446 MGET(mp, M_WAIT, MT_DATA); \
447 MCLGET(mp, M_WAIT); \
448 mp->m_len = NFSMSIZ(mp); \

--- 59 unchanged lines hidden ---