From d9db52256e500f4f4d86e0f32114c7c459429fbf Mon Sep 17 00:00:00 2001 From: Craig Rodrigues Date: Wed, 22 Apr 2015 14:38:58 +0000 Subject: [PATCH] Move zlib.c from net to libkern. It is not network-specific code and would be better as part of libkern instead. Move zlib.h and zutil.h from net/ to sys/ Update includes to use sys/zlib.h and sys/zutil.h instead of net/ Submitted by: Steve Kiernan stevek@juniper.net Obtained from: Juniper Networks, Inc. GitHub Pull Request: https://github.com/freebsd/freebsd/pull/28 Relnotes: yes --- sys/conf/files | 6 +++--- sys/dev/bxe/bxe.h | 2 +- sys/dev/mxge/if_mxge.c | 2 +- sys/geom/uncompress/g_uncompress.c | 2 +- sys/geom/uzip/g_uzip.c | 2 +- sys/kern/kern_gzio.c | 3 +-- sys/kern/link_elf.c | 2 +- sys/kern/link_elf_obj.c | 2 +- sys/{net => libkern}/zlib.c | 2 +- sys/netgraph/ng_deflate.c | 3 +-- sys/opencrypto/cryptodeflate.c | 4 ++-- sys/opencrypto/deflate.h | 2 +- sys/{net => sys}/zlib.h | 0 sys/{net => sys}/zutil.h | 2 +- 14 files changed, 16 insertions(+), 18 deletions(-) rename sys/{net => libkern}/zlib.c (99%) rename sys/{net => sys}/zlib.h (100%) rename sys/{net => sys}/zutil.h (99%) diff --git a/sys/conf/files b/sys/conf/files index ce28fa17de06..905bde6d7a7e 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3262,6 +3262,9 @@ libkern/strtoul.c standard libkern/strtouq.c standard libkern/strvalid.c standard libkern/timingsafe_bcmp.c standard +libkern/zlib.c optional crypto | geom_uzip | ipsec | \ + mxge | netgraph_deflate | \ + ddb_ctf | gzio | geom_uncompress net/altq/altq_cbq.c optional altq net/altq/altq_cdnr.c optional altq net/altq/altq_hfsc.c optional altq @@ -3324,9 +3327,6 @@ net/slcompress.c optional netgraph_vjc | sppp | \ netgraph_sppp net/toeplitz.c optional inet rss | inet6 rss net/vnet.c optional vimage -net/zlib.c optional crypto | geom_uzip | ipsec | \ - mxge | netgraph_deflate | \ - ddb_ctf | gzio | geom_uncompress net80211/ieee80211.c optional wlan net80211/ieee80211_acl.c optional wlan wlan_acl net80211/ieee80211_action.c optional wlan diff --git a/sys/dev/bxe/bxe.h b/sys/dev/bxe/bxe.h index f37b93f56e73..eb695d045211 100644 --- a/sys/dev/bxe/bxe.h +++ b/sys/dev/bxe/bxe.h @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -60,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include diff --git a/sys/dev/mxge/if_mxge.c b/sys/dev/mxge/if_mxge.c index fe8c08a72495..983caa30bc29 100644 --- a/sys/dev/mxge/if_mxge.c +++ b/sys/dev/mxge/if_mxge.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -58,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include diff --git a/sys/geom/uncompress/g_uncompress.c b/sys/geom/uncompress/g_uncompress.c index d8193711b5e7..8c2d5cb6c929 100644 --- a/sys/geom/uncompress/g_uncompress.c +++ b/sys/geom/uncompress/g_uncompress.c @@ -45,10 +45,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include -#include #include #ifdef GEOM_UNCOMPRESS_DEBUG diff --git a/sys/geom/uzip/g_uzip.c b/sys/geom/uzip/g_uzip.c index c2ed64b365c8..732de9d5e8d0 100644 --- a/sys/geom/uzip/g_uzip.c +++ b/sys/geom/uzip/g_uzip.c @@ -38,9 +38,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include -#include FEATURE(geom_uzip, "GEOM uzip read-only compressed disks support"); diff --git a/sys/kern/kern_gzio.c b/sys/kern/kern_gzio.c index a4974a729c3f..cee21f0655b1 100644 --- a/sys/kern/kern_gzio.c +++ b/sys/kern/kern_gzio.c @@ -32,8 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include - -#include +#include #define KERN_GZ_HDRLEN 10 /* gzip header length */ #define KERN_GZ_TRAILERLEN 8 /* gzip trailer length */ diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index 65c8276a950b..26be03504e79 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -66,7 +66,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef DDB_CTF -#include +#include #endif #include "linker_if.h" diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index 5c107fee44ba..021381db78d7 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef DDB_CTF -#include +#include #endif #include "linker_if.h" diff --git a/sys/net/zlib.c b/sys/libkern/zlib.c similarity index 99% rename from sys/net/zlib.c rename to sys/libkern/zlib.c index b3482483d334..f5c3854800e3 100644 --- a/sys/net/zlib.c +++ b/sys/libkern/zlib.c @@ -54,7 +54,7 @@ #define _Z_UTIL_H #ifdef _KERNEL -#include +#include #else #include "zlib.h" #endif diff --git a/sys/netgraph/ng_deflate.c b/sys/netgraph/ng_deflate.c index da68e49d24a8..be5294236150 100644 --- a/sys/netgraph/ng_deflate.c +++ b/sys/netgraph/ng_deflate.c @@ -39,8 +39,7 @@ #include #include #include - -#include +#include #include #include diff --git a/sys/opencrypto/cryptodeflate.c b/sys/opencrypto/cryptodeflate.c index 0ad86e3303e3..c55210dcbb78 100644 --- a/sys/opencrypto/cryptodeflate.c +++ b/sys/opencrypto/cryptodeflate.c @@ -29,7 +29,7 @@ /* * This file contains a wrapper around the deflate algo compression - * functions using the zlib library (see net/zlib.{c,h}) + * functions using the zlib library (see libkern/zlib.c and sys/zlib.h}) */ #include @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include diff --git a/sys/opencrypto/deflate.h b/sys/opencrypto/deflate.h index dcf7a8441350..d31a3bf27e5b 100644 --- a/sys/opencrypto/deflate.h +++ b/sys/opencrypto/deflate.h @@ -36,7 +36,7 @@ #ifndef _CRYPTO_DEFLATE_H_ #define _CRYPTO_DEFLATE_H_ -#include +#include #define Z_METHOD 8 #define Z_MEMLEVEL 8 diff --git a/sys/net/zlib.h b/sys/sys/zlib.h similarity index 100% rename from sys/net/zlib.h rename to sys/sys/zlib.h diff --git a/sys/net/zutil.h b/sys/sys/zutil.h similarity index 99% rename from sys/net/zutil.h rename to sys/sys/zutil.h index 74f022181e28..1431b6f9e9a3 100644 --- a/sys/net/zutil.h +++ b/sys/sys/zutil.h @@ -17,7 +17,7 @@ #define ZEXPORT #ifdef _KERNEL -#include +#include #else #include "zlib.h" #endif