summaryrefslogtreecommitdiff
path: root/sys/nfs/nfsm_subs.h
diff options
context:
space:
mode:
authorBret Lambert <blambert@cvs.openbsd.org>2008-04-14 13:46:14 +0000
committerBret Lambert <blambert@cvs.openbsd.org>2008-04-14 13:46:14 +0000
commitfe4a063c62965b992bbec37f13b16e9353f8732e (patch)
tree39c59852998d14bdb6868bda69ff22816056a2ef /sys/nfs/nfsm_subs.h
parent5f97b1deb72ac91b5c5eb0773fcb4c466ff308f9 (diff)
Rework NFS mbuf write routines:
nfsm_uiotombuf(): - no meaningful return, function becomes void - replace frankensteined uiomove/MGET with actual call to uiomove nfsm_strtmbuf(): - no meaningful return, becomes void - rename and reorder parameters to be consistent with other functions - becomes wrapper to nfsm_uiotombuf nfsm_buftombuf(): - new function; unused but slated for future use - wrapper to nfsm_uiotombuf As a bonus, making these functions void removes much unneeded code and garbage collects `magic' variable t2 which was only used (invisibly) by the macros from nfsm_subs.h Preps the way for removing much more NFS goo... testing by myself, thib@ and merdely@ ok thib@
Diffstat (limited to 'sys/nfs/nfsm_subs.h')
-rw-r--r--sys/nfs/nfsm_subs.h30
1 files changed, 4 insertions, 26 deletions
diff --git a/sys/nfs/nfsm_subs.h b/sys/nfs/nfsm_subs.h
index 14adbdb552e..cf5b20223f7 100644
--- a/sys/nfs/nfsm_subs.h
+++ b/sys/nfs/nfsm_subs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfsm_subs.h,v 1.24 2008/01/06 17:38:23 blambert Exp $ */
+/* $OpenBSD: nfsm_subs.h,v 1.25 2008/04/14 13:46:13 blambert Exp $ */
/* $NetBSD: nfsm_subs.h,v 1.10 1996/03/20 21:59:56 fvdl Exp $ */
/*
@@ -83,20 +83,8 @@
#define nfsm_fhtom(v, v3) \
{ if (v3) { \
- t2 = nfsm_rndup(VTONFS(v)->n_fhsize) + NFSX_UNSIGNED; \
- if (t2 <= M_TRAILINGSPACE(mb)) { \
- tl = nfsm_build(&mb, t2, &bpos); \
- *tl++ = txdr_unsigned(VTONFS(v)->n_fhsize); \
- *(tl + ((t2>>2) - 2)) = 0; \
- bcopy((caddr_t)VTONFS(v)->n_fhp,(caddr_t)tl, \
- VTONFS(v)->n_fhsize); \
- } else if ((t2 = nfsm_strtmbuf(&mb, &bpos, \
- (caddr_t)VTONFS(v)->n_fhp, \
- VTONFS(v)->n_fhsize)) != 0) { \
- error = t2; \
- m_freem(mreq); \
- goto nfsmout; \
- } \
+ nfsm_strtombuf(&mb, VTONFS(v)->n_fhp, \
+ VTONFS(v)->n_fhsize, &bpos); \
} else { \
cp = nfsm_build(&mb, NFSX_V2FH, &bpos); \
bcopy((caddr_t)VTONFS(v)->n_fhp, cp, NFSX_V2FH); \
@@ -256,17 +244,7 @@
error = ENAMETOOLONG; \
goto nfsmout; \
} \
- t2 = nfsm_rndup(s)+NFSX_UNSIGNED; \
- if (t2 <= M_TRAILINGSPACE(mb)) { \
- tl = nfsm_build(&mb, t2, &bpos); \
- *tl++ = txdr_unsigned(s); \
- *(tl+((t2>>2)-2)) = 0; \
- bcopy((caddr_t)(a), (caddr_t)tl, (s)); \
- } else if ((t2 = nfsm_strtmbuf(&mb, &bpos, (a), (s))) != 0) { \
- error = t2; \
- m_freem(mreq); \
- goto nfsmout; \
- }
+ nfsm_strtombuf(&mb, (a), (s), &bpos)
#define nfsm_reply(s) \
{ \