Page MenuHomeFreeBSD

D38590.diff
No OneTemporary

D38590.diff

diff --git a/sys/conf/NOTES b/sys/conf/NOTES
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -698,13 +698,9 @@
#
# SMB/CIFS requester
-# NETSMB enables support for SMB protocol, it requires LIBMCHAIN and LIBICONV
-# options.
+# NETSMB enables support for SMB protocol, it requires the LIBICONV option.
options NETSMB #SMB/CIFS requester
-# mchain library. It can be either loaded as KLD or compiled into kernel
-options LIBMCHAIN
-
# libalias library, performing NAT
options LIBALIAS
diff --git a/sys/conf/files b/sys/conf/files
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -3910,7 +3910,6 @@
kern/subr_kobj.c standard
kern/subr_lock.c standard
kern/subr_log.c standard
-kern/subr_mchain.c optional libmchain
kern/subr_module.c standard
kern/subr_msan.c optional kmsan \
compile-with "${NORMAL_C:N-fsanitize*:N-fstack-protector*}"
@@ -4560,6 +4559,7 @@
netsmb/smb_rq.c optional netsmb
netsmb/smb_smb.c optional netsmb
netsmb/smb_subr.c optional netsmb
+netsmb/smb_subr_mchain.c optional netsmb
netsmb/smb_trantcp.c optional netsmb
netsmb/smb_usr.c optional netsmb
nfs/bootp_subr.c optional bootp nfscl
diff --git a/sys/conf/options b/sys/conf/options
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -457,7 +457,6 @@
KERN_TLS
KRPC
LIBALIAS
-LIBMCHAIN
MBUF_PROFILING
MBUF_STRESS_TEST
MROUTING opt_mrouting.h
diff --git a/sys/fs/smbfs/smbfs_vfsops.c b/sys/fs/smbfs/smbfs_vfsops.c
--- a/sys/fs/smbfs/smbfs_vfsops.c
+++ b/sys/fs/smbfs/smbfs_vfsops.c
@@ -85,7 +85,6 @@
MODULE_DEPEND(smbfs, netsmb, NSMB_VERSION, NSMB_VERSION, NSMB_VERSION);
MODULE_DEPEND(smbfs, libiconv, 1, 1, 2);
-MODULE_DEPEND(smbfs, libmchain, 1, 1, 1);
uma_zone_t smbfs_pbuf_zone;
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -212,7 +212,6 @@
lge \
libalias \
libiconv \
- libmchain \
lindebugfs \
linuxkpi \
linuxkpi_wlan \
diff --git a/sys/modules/libmchain/Makefile b/sys/modules/libmchain/Makefile
deleted file mode 100644
--- a/sys/modules/libmchain/Makefile
+++ /dev/null
@@ -1,44 +0,0 @@
-# $FreeBSD$
-
-.PATH: ${SRCTOP}/sys/kern
-
-KMOD= libmchain
-SRCS= subr_mchain.c
-
-EXPORT_SYMS= mb_init \
- mb_initm \
- mb_done \
- mb_detach \
- mb_fixhdr \
- mb_reserve \
- mb_put_padbyte \
- mb_put_uint8 \
- mb_put_uint16be \
- mb_put_uint16le \
- mb_put_uint32be \
- mb_put_uint32le \
- mb_put_int64be \
- mb_put_int64le \
- mb_put_mem \
- mb_put_mbuf \
- mb_put_uio \
- md_init \
- md_initm \
- md_done \
- md_append_record \
- md_next_record \
- md_get_uint8 \
- md_get_uint16 \
- md_get_uint16le \
- md_get_uint16be \
- md_get_uint32 \
- md_get_uint32be \
- md_get_uint32le \
- md_get_int64 \
- md_get_int64be \
- md_get_int64le \
- md_get_mem \
- md_get_mbuf \
- md_get_uio \
-
-.include <bsd.kmod.mk>
diff --git a/sys/modules/smbfs/Makefile b/sys/modules/smbfs/Makefile
--- a/sys/modules/smbfs/Makefile
+++ b/sys/modules/smbfs/Makefile
@@ -14,7 +14,7 @@
iconv_converter_if.h \
md4c.c \
smb_conn.c smb_dev.c smb_trantcp.c smb_smb.c smb_subr.c smb_rq.c \
- smb_usr.c smb_crypt.c smb_iod.c \
+ smb_usr.c smb_crypt.c smb_iod.c smb_subr_mchain.c \
smbfs_vfsops.c smbfs_node.c smbfs_io.c smbfs_vnops.c \
smbfs_subr.c smbfs_smb.c
diff --git a/sys/netsmb/smb_crypt.c b/sys/netsmb/smb_crypt.c
--- a/sys/netsmb/smb_crypt.c
+++ b/sys/netsmb/smb_crypt.c
@@ -50,7 +50,6 @@
#include <sys/sysctl.h>
#include <sys/endian.h>
#include <sys/mbuf.h>
-#include <sys/mchain.h>
#include <sys/md4.h>
#include <sys/md5.h>
#include <sys/iconv.h>
@@ -60,6 +59,7 @@
#include <netsmb/smb_subr.h>
#include <netsmb/smb_rq.h>
#include <netsmb/smb_dev.h>
+#include <netsmb/smb_mchain.h>
#include <crypto/des/des.h>
diff --git a/sys/netsmb/smb_dev.h b/sys/netsmb/smb_dev.h
--- a/sys/netsmb/smb_dev.h
+++ b/sys/netsmb/smb_dev.h
@@ -40,7 +40,7 @@
#define NSMB_NAME "nsmb"
#define NSMB_VERMAJ 1
-#define NSMB_VERMIN 3006
+#define NSMB_VERMIN 3007
#define NSMB_VERSION (NSMB_VERMAJ * 100000 + NSMB_VERMIN)
#define NSMBFL_OPEN 0x0001
diff --git a/sys/sys/mchain.h b/sys/netsmb/smb_mchain.h
rename from sys/sys/mchain.h
rename to sys/netsmb/smb_mchain.h
--- a/sys/sys/mchain.h
+++ b/sys/netsmb/smb_mchain.h
@@ -27,8 +27,12 @@
*
* $FreeBSD$
*/
-#ifndef _SYS_MCHAIN_H_
-#define _SYS_MCHAIN_H_
+#ifndef _NETSMB_SMB_MCHAIN_H_
+#define _NETSMB_SMB_MCHAIN_H_
+
+/*
+ * Formerly sys/mchain.h. The interface has been folded into netsmb.
+ */
#ifdef _KERNEL
@@ -102,4 +106,4 @@
#endif /* ifdef _KERNEL */
-#endif /* !_SYS_MCHAIN_H_ */
+#endif /* !_NETSMB_SMB_MCHAIN_H_ */
diff --git a/sys/netsmb/smb_rq.h b/sys/netsmb/smb_rq.h
--- a/sys/netsmb/smb_rq.h
+++ b/sys/netsmb/smb_rq.h
@@ -31,7 +31,7 @@
#define _NETSMB_SMB_RQ_H_
#ifndef MB_MSYSTEM
-#include <sys/mchain.h>
+#include <netsmb/smb_mchain.h>
#endif
#define SMBR_ALLOCED 0x0001 /* structure was malloced */
diff --git a/sys/kern/subr_mchain.c b/sys/netsmb/smb_subr_mchain.c
rename from sys/kern/subr_mchain.c
rename to sys/netsmb/smb_subr_mchain.c
--- a/sys/kern/subr_mchain.c
+++ b/sys/netsmb/smb_subr_mchain.c
@@ -39,15 +39,12 @@
#include <sys/errno.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
-#include <sys/module.h>
#include <sys/uio.h>
-#include <sys/mchain.h>
+#include <netsmb/smb_mchain.h>
FEATURE(libmchain, "mchain library");
-MODULE_VERSION(libmchain, 1);
-
#define MBERROR(format, ...) printf("%s(%d): "format, __func__ , \
__LINE__ , ## __VA_ARGS__)
@@ -55,8 +52,11 @@
__LINE__ , ## __VA_ARGS__)
/*
- * Various helper functions
+ * Various helper functions for chains of mbufs. This logic was formerly its
+ * own module, libmchain. smbfs has long been its only consumer, and so its
+ * scope was decreased.
*/
+
int
mb_init(struct mbchain *mbp)
{
diff --git a/sys/netsmb/smb_trantcp.c b/sys/netsmb/smb_trantcp.c
--- a/sys/netsmb/smb_trantcp.c
+++ b/sys/netsmb/smb_trantcp.c
@@ -53,12 +53,11 @@
#include <netinet/in.h>
#include <netinet/tcp.h>
-#include <sys/mchain.h>
-
#include <netsmb/netbios.h>
#include <netsmb/smb.h>
#include <netsmb/smb_conn.h>
+#include <netsmb/smb_mchain.h>
#include <netsmb/smb_tran.h>
#include <netsmb/smb_trantcp.h>
#include <netsmb/smb_subr.h>

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 1, 7:33 AM (6 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29103937
Default Alt Text
D38590.diff (6 KB)

Event Timeline