cifs: do not build smb1ops if legacy support is disabled
authorSteve French <stfrench@microsoft.com>
Thu, 2 Jun 2022 02:25:43 +0000 (21:25 -0500)
committerSteve French <stfrench@microsoft.com>
Thu, 2 Jun 2022 02:49:27 +0000 (21:49 -0500)
We should not be including unused SMB1/CIFS functions when legacy
support is disabled (CONFIG_CIFS_ALLOW_INSECURE_LEGACY turned
off), but especially obvious is not needing to build smb1ops.c
at all when legacy support is disabled. Over time we can move
more SMB1/CIFS and SMB2.0 legacy functions into ifdefs but this
is a good start (and shrinks the module size a few percent).

Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/Makefile

index cc8fdcb35b7178296cfa7d2c44bbb9f6fa8b3c2c..8c9f2c00be726fcc310ce72f9677c5821c106e64 100644 (file)
@@ -8,7 +8,7 @@ obj-$(CONFIG_CIFS) += cifs.o
 cifs-y := trace.o cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o \
          inode.o link.o misc.o netmisc.o smbencrypt.o transport.o \
          cifs_unicode.o nterr.o cifsencrypt.o \
-         readdir.o ioctl.o sess.o export.o smb1ops.o unc.o winucase.o \
+         readdir.o ioctl.o sess.o export.o unc.o winucase.o \
          smb2ops.o smb2maperror.o smb2transport.o \
          smb2misc.o smb2pdu.o smb2inode.o smb2file.o cifsacl.o fs_context.o \
          dns_resolve.o cifs_spnego_negtokeninit.asn1.o asn1.o
@@ -30,3 +30,5 @@ cifs-$(CONFIG_CIFS_FSCACHE) += fscache.o
 cifs-$(CONFIG_CIFS_SMB_DIRECT) += smbdirect.o
 
 cifs-$(CONFIG_CIFS_ROOT) += cifsroot.o
+
+cifs-$(CONFIG_CIFS_ALLOW_INSECURE_LEGACY) += smb1ops.o