[linux-cifs-client] cifs 1.44 for older kernels
Juan José Villaplana Querol
villapla at si.uji.es
Mon Jun 19 08:23:26 GMT 2006
On Fri, Jun 16, 2006 at 01:10:33PM -0500, Dave Kleikamp wrote:
> On Fri, 2006-06-16 at 11:59 -0500, Steve French wrote:
> > Juan José Villaplana Querol wrote:
>
> > >Applying the proposed patch for 1.42b solves this problem.
> > >
> > >
> > >Regards,
> > > Juanjo
> > >
> > >(*) http://lists.samba.org/archive/linux-cifs-client/2006-May/001345.html
> > >
> > >
> > >
> > Thanks - Yesterday I had been looking for the previous posts about build
> > problems to make sure I had addressed them - and had missed yours.
> >
> > This build problem is tricky to fix because RHEL4 did not define kzalloc
> > in slab.h in 2.6.9-5 and 2.6.9-6 (which I was testing on) so we need to
> > find another way to tell if kzalloc is defined (I don't know which
> > refresh of the RHEL 4 headers added the #define). I would like to make
> > sure this builds cleanly (no warnings) on all the RHEL4s because it is a
> > fairly important upgrade.
>
> This is a bit of a kludge, but you may try something similar to Juanjo's
> patch, but check explicitly for kzalloc in the header file:
>
> kzalloc := $(shell grep "kzalloc" $(TOPDIR)/include/linux/slab.h 2> /dev/null)
> ifneq ($(strip $(kzalloc)),)
> CFLAGS += -DHAVE_KZALLOC
> endif
>
> Of course, the code would have:
>
> #ifndef HAVE_KZALLOC
> void * kzalloc(size_t size, unsigned flgs)
> ...
>
> I haven't tested this. :-)
kzalloc definition in slab.h first appeared on 2.6.9-34.EL as:
extern void *kzalloc(size_t, int);
I have tested Dave's patch on 2.6.9-34.0.1.EL (HAVE_KZALLOC) and
2.6.9-22.0.2.EL (! HAVE_KZALLOC) and it works fine. You will find it
attached.
Regards,
Juanjo
--
Juan Jose Villaplana Querol/Servei d'Informatica/Universitat Jaume I
-------------- next part --------------
--- Makefile.orig 2006-06-15 06:31:03.000000000 +0200
+++ Makefile 2006-06-19 09:53:29.000000000 +0200
@@ -3,4 +3,9 @@
#
obj-$(CONFIG_CIFS) += cifs.o
+kzalloc := $(shell grep "kzalloc" $(TOPDIR)/include/linux/slab.h 2> /dev/null)
+ifneq ($(strip $(kzalloc)),)
+CFLAGS += -DHAVE_KZALLOC
+endif
+
cifs-objs := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o fcntl.o readdir.o ioctl.o sess.o
--- cifsfs.c.orig 2006-06-15 20:01:11.000000000 +0200
+++ cifsfs.c 2006-06-19 10:01:55.000000000 +0200
@@ -170,7 +170,7 @@
return;
}
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
+#ifndef HAVE_KZALLOC
void * kzalloc(size_t size, unsigned flgs)
{
void * buf;
--- cifsproto.h.orig 2006-06-15 07:03:01.000000000 +0200
+++ cifsproto.h 2006-06-19 10:01:50.000000000 +0200
@@ -355,7 +355,7 @@
const struct nls_table *nls_codepage, int remap_special_chars);
extern int CIFSGetExtAttr(const int xid, struct cifsTconInfo *tcon,
const int netfid, __u64 * pExtAttrBits, __u64 *pMask);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
+#ifndef HAVE_KZALLOC
extern void * kzalloc(size_t size, unsigned flgs);
#endif
#endif /* _CIFSPROTO_H */
More information about the linux-cifs-client
mailing list