diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2009-08-04 17:12:40 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2009-08-04 17:12:40 +0000 |
commit | 1f0f159650817313e892f426a8cae18ecd0cf104 (patch) | |
tree | ee77144c6b50123b9629265469fe7585cb823c7f /sys/nfs/nfs_subs.c | |
parent | 1b1362ee43be64c7a17b57b9843cc9a5a9744830 (diff) |
group all of the on-stack variables that are uses by the nfsm_macros
to keep the data munging "state" into an nfsm_info structure. Each
function now has this structure on its stack, and it and its members
are now passed around so that the macros/functions can work there magic.
this will make removing the nfsm_* macros way easier.
Idea/code picked up from DragonflyBSD.
Tested by krw@, jacekm@ and myself.
OK blambert@.
Diffstat (limited to 'sys/nfs/nfs_subs.c')
-rw-r--r-- | sys/nfs/nfs_subs.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c index 1705640ae68..f7384ad0334 100644 --- a/sys/nfs/nfs_subs.c +++ b/sys/nfs/nfs_subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_subs.c,v 1.98 2009/07/20 16:49:40 thib Exp $ */ +/* $OpenBSD: nfs_subs.c,v 1.99 2009/08/04 17:12:39 thib Exp $ */ /* $NetBSD: nfs_subs.c,v 1.27.4.3 1996/07/08 20:34:24 jtc Exp $ */ /* @@ -671,13 +671,6 @@ nfsm_mbuftouio(mrep, uiop, siz, dpos) len = mp->m_len; } xfer = (left > len) ? len : left; -#ifdef notdef - /* Not Yet.. */ - if (uiop->uio_iov->iov_op != NULL) - (*(uiop->uio_iov->iov_op)) - (mbufcp, uiocp, xfer); - else -#endif if (uiop->uio_segflg == UIO_SYSSPACE) bcopy(mbufcp, uiocp, xfer); else @@ -1965,13 +1958,13 @@ int nfsm_srvsattr(struct mbuf **mp, struct vattr *va, struct mbuf *mrep, caddr_t *dposp) { - struct mbuf *md; + struct nfsm_info info; uint32_t *tl, t1; - caddr_t dpos, cp2; + caddr_t cp2; int error = 0; - md = *mp; - dpos = *dposp; + info.nmi_md = *mp; + info.nmi_dpos = *dposp; nfsm_dissect(tl, u_int32_t *, NFSX_UNSIGNED); if (*tl == nfs_true) { @@ -2021,8 +2014,8 @@ nfsm_srvsattr(struct mbuf **mp, struct vattr *va, struct mbuf *mrep, break; }; - *dposp = dpos; - *mp = md; + *dposp = info.nmi_dpos; + *mp = info.nmi_md; nfsmout: return (error); } |