summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2017-07-31 16:47:03 +0000
committerflorian <florian@openbsd.org>2017-07-31 16:47:03 +0000
commit207fea7108693e745fd94d69ae6fdf6e8fc7be51 (patch)
tree99cc0e7957147abae47915c65c6d9a3d8172d441
parenthandle empty output correctly in mda_getlastline() (diff)
downloadwireguard-openbsd-207fea7108693e745fd94d69ae6fdf6e8fc7be51.tar.xz
wireguard-openbsd-207fea7108693e745fd94d69ae6fdf6e8fc7be51.zip
Give back some space to the ramdisk by compiling net/radix.c only
if we compile pf, ipsec, pipex or nfsserver. Suggested by mpi some time ago. Tweak & OK bluhm deraadt assumes it's fair
-rw-r--r--sys/conf/files4
-rw-r--r--sys/kern/vfs_subr.c16
2 files changed, 16 insertions, 4 deletions
diff --git a/sys/conf/files b/sys/conf/files
index feb48595945..56f13e402a5 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1,4 +1,4 @@
-# $OpenBSD: files,v 1.649 2017/07/30 18:16:14 florian Exp $
+# $OpenBSD: files,v 1.650 2017/07/31 16:47:03 florian Exp $
# $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
@@ -784,7 +784,7 @@ file net/if_switch.c switch needs-count
file net/switchctl.c switch
file net/switchofp.c switch
file net/pipex.c pipex
-file net/radix.c
+file net/radix.c pf | ipsec | pipex | nfsserver
file net/raw_cb.c
file net/raw_usrreq.c
file net/rtable.c
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 2a643bf36bb..86e119003bf 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.259 2017/04/20 14:13:00 visa Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.260 2017/07/31 16:47:03 florian Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -155,7 +155,9 @@ vntblinit(void)
*/
vn_initialize_syncerd();
+#ifdef NFSSERVER
rn_init(sizeof(struct sockaddr_in));
+#endif /* NFSSERVER */
}
/*
@@ -1354,9 +1356,10 @@ vfs_mountedon(struct vnode *vp)
return (error);
}
+#ifdef NFSSERVER
/*
* Build hash lists of net addresses and hang them off the mount point.
- * Called by ufs_mount() to set up the lists of export addresses.
+ * Called by vfs_export() to set up the lists of export addresses.
*/
int
vfs_hang_addrlist(struct mount *mp, struct netexport *nep,
@@ -1454,10 +1457,12 @@ vfs_free_addrlist(struct netexport *nep)
nep->ne_rtable_inet = NULL;
}
}
+#endif /* NFSSERVER */
int
vfs_export(struct mount *mp, struct netexport *nep, struct export_args *argp)
{
+#ifdef NFSSERVER
int error;
if (argp->ex_flags & MNT_DELEXPORT) {
@@ -1470,11 +1475,15 @@ vfs_export(struct mount *mp, struct netexport *nep, struct export_args *argp)
mp->mnt_flag |= MNT_EXPORTED;
}
return (0);
+#else
+ return (ENOTSUP);
+#endif /* NFSSERVER */
}
struct netcred *
vfs_export_lookup(struct mount *mp, struct netexport *nep, struct mbuf *nam)
{
+#ifdef NFSSERVER
struct netcred *np;
struct radix_node_head *rnh;
struct sockaddr *saddr;
@@ -1504,6 +1513,9 @@ vfs_export_lookup(struct mount *mp, struct netexport *nep, struct mbuf *nam)
np = &nep->ne_defexported;
}
return (np);
+#else
+ return (NULL);
+#endif /* NFSSERVER */
}
/*