diff options
author | peter <peter@FreeBSD.org> | 2001-09-27 02:33:36 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-09-27 02:33:36 +0000 |
commit | bc122022f949f237aecea9ea5738eb2735a0040c (patch) | |
tree | ec16033a89e67cafbfb2dd889cbd62893166f806 /sys/nfs | |
parent | 422ba83d3cac0646cf127807c6a95c782f010a60 (diff) | |
download | FreeBSD-src-bc122022f949f237aecea9ea5738eb2735a0040c.zip FreeBSD-src-bc122022f949f237aecea9ea5738eb2735a0040c.tar.gz |
Tidy up nfsm_build usage. This is only partially finished.
Diffstat (limited to 'sys/nfs')
-rw-r--r-- | sys/nfs/nfs_common.c | 8 | ||||
-rw-r--r-- | sys/nfs/nfs_common.h | 9 |
2 files changed, 8 insertions, 9 deletions
diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c index d51edc5..5635945 100644 --- a/sys/nfs/nfs_common.c +++ b/sys/nfs/nfs_common.c @@ -245,10 +245,11 @@ nfs_adv(struct mbuf **mdp, caddr_t *dposp, int offs, int left) return (0); } -void -nfsm_build_xx(void **a, int s, struct mbuf **mb, caddr_t *bpos) +void * +nfsm_build_xx(int s, struct mbuf **mb, caddr_t *bpos) { struct mbuf *mb2; + void *ret; if (s > M_TRAILINGSPACE(*mb)) { MGET(mb2, M_TRYWAIT, MT_DATA); @@ -259,9 +260,10 @@ nfsm_build_xx(void **a, int s, struct mbuf **mb, caddr_t *bpos) (*mb)->m_len = 0; *bpos = mtod(*mb, caddr_t); } - *a = *bpos; + ret = *bpos; (*mb)->m_len += s; *bpos += s; + return ret; } int diff --git a/sys/nfs/nfs_common.h b/sys/nfs/nfs_common.h index 825ab35..c43dd3e 100644 --- a/sys/nfs/nfs_common.h +++ b/sys/nfs/nfs_common.h @@ -56,7 +56,7 @@ extern nfstype nfsv3_type[]; } while (0) int nfs_adv(struct mbuf **, caddr_t *, int, int); -void nfsm_build_xx(void **a, int s, struct mbuf **mb, caddr_t *bpos); +void *nfsm_build_xx(int s, struct mbuf **mb, caddr_t *bpos); int nfsm_dissect_xx(void **a, int s, struct mbuf **md, caddr_t *dpos); int nfsm_strsiz_xx(int *s, int m, u_int32_t **tl, struct mbuf **mb, caddr_t *bpos); @@ -64,11 +64,8 @@ int nfsm_adv_xx(int s, u_int32_t **tl, struct mbuf **md, caddr_t *dpos); u_quad_t nfs_curusec(void); int nfsm_disct(struct mbuf **, caddr_t *, int, int, caddr_t *); -#define nfsm_build(a, c, s) \ -do { \ - nfsm_build_xx((void **)&(a), (s), &mb, &bpos); \ -} while (0) - +#define nfsm_build(c, s) \ + (c)nfsm_build_xx((s), &mb, &bpos); \ /* XXX 'c' arg (type) is not used */ #define nfsm_dissect(a, c, s) \ |