diff options
author | Bret Lambert <blambert@cvs.openbsd.org> | 2009-04-13 17:51:58 +0000 |
---|---|---|
committer | Bret Lambert <blambert@cvs.openbsd.org> | 2009-04-13 17:51:58 +0000 |
commit | 095e1a46a8eef59e3e980707c10ff03ce1aa23d8 (patch) | |
tree | 7be2d4e5562640feef887d9c220ec4adf192bcf9 /sys/nfs/nfs_subs.c | |
parent | 9ff60d25b0d62b7a9c3aebecaf85050bb5869187 (diff) |
Convert macros to functions to reduce kernel memory usage.
In snaps for a while (way too long, according to deraadt@)
Diffstat (limited to 'sys/nfs/nfs_subs.c')
-rw-r--r-- | sys/nfs/nfs_subs.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c index c71113db558..39e650671d7 100644 --- a/sys/nfs/nfs_subs.c +++ b/sys/nfs/nfs_subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_subs.c,v 1.93 2009/03/30 19:58:50 blambert Exp $ */ +/* $OpenBSD: nfs_subs.c,v 1.94 2009/04/13 17:51:57 blambert Exp $ */ /* $NetBSD: nfs_subs.c,v 1.27.4.3 1996/07/08 20:34:24 jtc Exp $ */ /* @@ -1949,6 +1949,28 @@ nfsm_build(struct mbuf **mp, u_int len) return (bpos); } +void +nfsm_fhtom(struct mbuf **mp, struct vnode *v, int v3) +{ + struct nfsnode *n = VTONFS(v); + + if (v3) { + nfsm_strtombuf(mp, n->n_fhp, n->n_fhsize); + } else { + nfsm_buftombuf(mp, n->n_fhp, NFSX_V2FH); + } +} + +void +nfsm_srvfhtom(struct mbuf **mp, fhandle_t *f, int v3) +{ + if (v3) { + nfsm_strtombuf(mp, f, NFSX_V3FH); + } else { + nfsm_buftombuf(mp, f, NFSX_V2FH); + } +} + int nfsm_srvsattr(struct mbuf **mp, struct vattr *va, struct mbuf *mrep, caddr_t *dposp) |