[OpenAFS-devel] Some small patches for the client and AIX

Hartmut Reuter reuter@rzg.mpg.de
Wed, 03 Sep 2003 17:42:37 +0200


This is a multi-part message in MIME format.
--------------000205070003050403080805
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit


OpenAFS now runs also on AIX 5.2 with 32-bit or 64-bit kernels.
I created a param.rs_aix52.h by copying param.rs_aix51.h, changing the 
sysname and adding a define for AFS_AIX52_ENV.

In afs_vcache.c was a typing error which after a chown command let large 
files appear only modulo 4 GB in size!

The patch in afs_vnop_remove.c should help against a dead-lock we saw on 
one of our AIX 5.1 systems. Experts should have a look on it to see 
whether it breaks any thing else.

cfgexport.c had still a bug, but all other changes are only necessary 
for building in a different than the source tree.

Thanks,
Hartmut
-----------------------------------------------------------------
Hartmut Reuter                           e-mail reuter@rzg.mpg.de
					   phone +49-89-3299-1328
RZG (Rechenzentrum Garching)               fax   +49-89-3299-1301
Computing Center of the Max-Planck-Gesellschaft (MPG) and the
Institut fuer Plasmaphysik (IPP)
-----------------------------------------------------------------

--------------000205070003050403080805
Content-Type: text/plain;
 name="diffs"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="diffs"

? diffs
? src/config/param.rs_aix52.h
? src/config/param.rs_aix52_usr.h
Index: src/afs/afs_vcache.c
===================================================================
RCS file: /cvs/openafs/src/afs/afs_vcache.c,v
retrieving revision 1.54
diff -u -r1.54 afs_vcache.c
--- src/afs/afs_vcache.c	27 Aug 2003 21:43:16 -0000	1.54
+++ src/afs/afs_vcache.c	3 Sep 2003 15:19:23 -0000
@@ -1408,7 +1408,7 @@
 #else
     if ((avc->execsOrWriters <= 0) && !afs_DirtyPages(avc)) {
 #endif
-#ifdef AFS_64BIT_ClIENT
+#ifdef AFS_64BIT_CLIENT
 	FillInt64(length, astat->Length_hi, astat->Length);
 #else /* AFS_64BIT_CLIENT */
 	length = astat->Length;
Index: src/afs/VNOPS/afs_vnop_remove.c
===================================================================
RCS file: /cvs/openafs/src/afs/VNOPS/afs_vnop_remove.c,v
retrieving revision 1.25
diff -u -r1.25 afs_vnop_remove.c
--- src/afs/VNOPS/afs_vnop_remove.c	15 Jul 2003 23:14:30 -0000	1.25
+++ src/afs/VNOPS/afs_vnop_remove.c	3 Sep 2003 15:19:23 -0000
@@ -374,7 +374,9 @@
 	FetchWholeEnchilada(tvc, &treq);
 #endif
 	ReleaseWriteLock(&tvc->lock);
+        if (tdc) ReleaseSharedLock(&tdc->lock);
 	ObtainWriteLock(&adp->lock, 144);
+        if (tdc) ObtainSharedLock(&tdc->lock, 1638);
     }
 
     osi_dnlc_remove(adp, aname, tvc);
Index: src/config/afs_sysnames.h
===================================================================
RCS file: /cvs/openafs/src/config/afs_sysnames.h,v
retrieving revision 1.40
diff -u -r1.40 afs_sysnames.h
--- src/config/afs_sysnames.h	8 Aug 2003 19:15:21 -0000	1.40
+++ src/config/afs_sysnames.h	3 Sep 2003 15:19:24 -0000
@@ -62,6 +62,7 @@
 #define SYS_NAME_ID_rs_aix42		 703
 #define SYS_NAME_ID_rs_aix51		 704
 #define SYS_NAME_ID_rs_aix43		 705
+#define SYS_NAME_ID_rs_aix52		 706
 
 #define SYS_NAME_ID_sun3_411		 906
 #define SYS_NAME_ID_sun3x_411		 912
Index: src/export/Makefile.in
===================================================================
RCS file: /cvs/openafs/src/export/Makefile.in,v
retrieving revision 1.13
diff -u -r1.13 Makefile.in
--- src/export/Makefile.in	4 Jul 2003 15:58:04 -0000	1.13
+++ src/export/Makefile.in	3 Sep 2003 15:19:24 -0000
@@ -9,7 +9,7 @@
 include @TOP_OBJDIR@/src/config/Makefile.config
 
   EXPORTS = -bexport:export.exp
-  IMPORTS = /lib/kernex.exp /lib/syscalls.exp extras.exp
+  IMPORTS = /lib/kernex.exp /lib/syscalls.exp ${srcdir}/extras.exp
      KOBJ = export.o symtab.o
 
 include ../config/Makefile.version
@@ -17,22 +17,24 @@
 all: ${TOP_LIBDIR}/export.exp ${TOP_LIBDIR}/export64.exp ${TOP_LIBDIR}/extras.exp cfgexport cfgafs
 all: ${TOP_LIBDIR}/export.exp ${TOP_LIBDIR}/extras.exp cfgexport cfgafs
 	${INSTALL} ${srcdir}/export.h ${KERNELDIR}
-	${INSTALL} ${srcdir}/export.exp ${KERNELDIR}
+	${INSTALL} export.exp ${KERNELDIR}
+	${INSTALL} export64.exp ${KERNELDIR}
 	${INSTALL} ${srcdir}/export.h ${UKERNELDIR}
-	${INSTALL} ${srcdir}/export.exp ${UKERNELDIR}
+	${INSTALL} export64.exp ${UKERNELDIR}
+	${INSTALL} export.exp ${UKERNELDIR}
 
 noversion system: install
 
 install: ${DESTDIR}${libdir}/afs/export.exp ${DESTDIR}${libdir}/afs/extras.exp  
 
-export.exp: export4.exp export5.exp
+export.exp: ${srcdir}/export4.exp ${srcdir}/export5.exp
 	case ${SYS_NAME} in \
 	rs_aix4* ) \
-		cp -p export4.exp export.exp ; \
-		cp -p export4-64.exp export64.exp ;; \
+		cp -p ${srcdir}/export4.exp export.exp ; \
+		cp -p ${srcdir}/export4-64.exp export64.exp ;; \
 	rs_aix5* ) \
-		cp -p export5.exp export.exp ; \
-		cp -p export5-64.exp export64.exp ;; \
+		cp -p ${srcdir}/export5.exp export.exp ; \
+		cp -p ${srcdir}/export5-64.exp export64.exp ;; \
 	esac
 
 export.ext: ${KOBJ}
@@ -50,34 +52,34 @@
 	${LD} -b64 -o export64.ext.nonfs -eexport ${IMPORTS} export64.nonfs.o \
 		symtab64.o -bexport:export64.exp -lcsys
 
-symtab.o symtab64.o: symtab.c
+symtab.o symtab64.o: ${srcdir}/symtab.c
 	case ${SYS_NAME} in \
 	rs_aix4* ) \
-		${CC} ${CFLAGS} -c symtab.c ;; \
+		${CC} ${CFLAGS} -c ${srcdir}/symtab.c ;; \
 	rs_aix5* ) \
-		${CC} ${CFLAGS} -q64 -D__XCOFF64__ -DAFS_64BIT_KERNEL -DAFS_AIX51_ENV -c symtab.c ; \
+		${CC} ${CFLAGS} -q64 -D__XCOFF64__ -DAFS_64BIT_KERNEL -DAFS_AIX51_ENV -c ${srcdir}/symtab.c ; \
 		mv symtab.o symtab64.o ; \
-		${CC} ${CFLAGS} -DAFS_AIX51_ENV -c symtab.c ;; \
+		${CC} ${CFLAGS} -DAFS_AIX51_ENV -c ${srcdir}/symtab.c ;; \
 	esac
 
-export.o export64.o: export.c
+export.o export64.o: ${srcdir}/export.c
 	case ${SYS_NAME} in \
 	rs_aix4* ) \
-		${CC} ${CFLAGS} -c export.c ;; \
+		${CC} ${CFLAGS} -c ${srcdir}/export.c ;; \
 	rs_aix5* ) \
-		${CC} ${CFLAGS} -q64 -D__XCOFF64__ -DAFS_64BIT_KERNEL -DAFS_AIX51_ENV -c export.c ; \
+		${CC} ${CFLAGS} -q64 -D__XCOFF64__ -DAFS_64BIT_KERNEL -DAFS_AIX51_ENV -c ${srcdir}/export.c ; \
 		mv export.o export64.o ; \
-		${CC} ${CFLAGS} -DAFS_AIX51_ENV -c export.c ;; \
+		${CC} ${CFLAGS} -DAFS_AIX51_ENV -c ${srcdir}/export.c ;; \
 	esac
                
-export.nonfs.o export64.nonfs.o: export.c
+export.nonfs.o export64.nonfs.o: ${srcdir}/export.c
 	case ${SYS_NAME} in \
 	rs_aix4* ) \
-		${CC} ${INCS} -DAFS_NONFSTRANS -c export.c ;; \
+		${CC} ${INCS} -DAFS_NONFSTRANS -c ${srcdir}/export.c ;; \
 	rs_aix5* ) \
-		${CC} -q64 ${INCS} -D__XCOFF64__ -DAFS_64BIT_KERNEL -DAFS_NONFSTRANS -DAFS_AIX51_ENV -c export.c ; \
+		${CC} -q64 ${INCS} -D__XCOFF64__ -DAFS_64BIT_KERNEL -DAFS_NONFSTRANS -DAFS_AIX51_ENV -c ${srcdir}/export.c ; \
 		mv export.o export64.nonfs.o ; \
-		${CC} ${INCS} -DAFS_NONFSTRANS -DAFS_AIX51_ENV -c export.c ;; \
+		${CC} ${INCS} -DAFS_NONFSTRANS -DAFS_AIX51_ENV -c ${srcdir}/export.c ;; \
 	esac
 	-mv export.o export.nonfs.o
 
@@ -93,16 +95,17 @@
 cfgafs64: cfgafs64.o
 	${CC} -g ${INCS} -q64 -o cfgafs64 cfgafs64.o
 
-cfgexport64.o: cfgexport.c AFS_component_version_number.c
-	${CC} -g -q64 ${CFLAGS} -D__XCOFF64__ -c cfgexport.c -o cfgexport64.o
+cfgexport64.o: ${srcdir}/cfgexport.c AFS_component_version_number.c
+	${CC} -g -q64 ${CFLAGS} -D__XCOFF64__ -c ${srcdir}/cfgexport.c -o cfgexport64.o
 
-cfgexport.o: cfgexport.c AFS_component_version_number.c
-cfgafs.o: cfgafs.c AFS_component_version_number.c
-cfgafs64.o: cfgafs.c AFS_component_version_number.c
-	${CC} -q64 ${CFLAGS} -c cfgafs.c -o cfgafs64.o
+cfgexport.o: ${srcdir}/cfgexport.c AFS_component_version_number.c
+cfgafs.o: ${srcdir}/cfgafs.c AFS_component_version_number.c
+cfgafs64.o: ${srcdir}/cfgafs.c AFS_component_version_number.c
+	${CC} -q64 ${CFLAGS} -c ${srcdir}/cfgafs.c -o cfgafs64.o
 
 clean:
-	$(RM) -f *.o *.Zlst *.map *.out cfgexport cfgafs *.ext AFS_component_version_number.c export.exp
+	$(RM) -f *.o *.Zlst *.map *.out cfgexport cfgafs *.ext AFS_component_version_number.c export.exp export64.exp
+
 ${DEST}/root.client/usr/vice/etc/dkload/export.ext: export.ext
 	${INSTALL} $? $@
 
@@ -133,14 +136,14 @@
 ${TOP_LIBDIR}/export64.exp: export64.exp
 	${INSTALL} $? $@
 
-${DEST}/lib/afs/extras.exp: extras.exp
+${DEST}/lib/afs/extras.exp: ${srcdir}/extras.exp
 	${INSTALL} $? $@
 
-${DESTDIR}${libdir}/afs/extras.exp: extras.exp
+${DESTDIR}${libdir}/afs/extras.exp: ${srcdir}/extras.exp
 	${INSTALL} $? $@
 
 
-${TOP_LIBDIR}/extras.exp: extras.exp
+${TOP_LIBDIR}/extras.exp: ${srcdir}/extras.exp
 	${INSTALL} $? $@
 
 
Index: src/export/cfgexport.c
===================================================================
RCS file: /cvs/openafs/src/export/cfgexport.c,v
retrieving revision 1.10
diff -u -r1.10 cfgexport.c
--- src/export/cfgexport.c	15 Jul 2003 23:15:06 -0000	1.10
+++ src/export/cfgexport.c	3 Sep 2003 15:19:24 -0000
@@ -382,7 +382,7 @@
      uint *szp;
 {
     register len;
-    static char *export_strings, *prev = "";
+    static char *export_strings = 0, *prev = "";
     static left, offset, sz;
 
     if (!export_strings) {
Index: src/libafsrpc/Makefile.in
===================================================================
RCS file: /cvs/openafs/src/libafsrpc/Makefile.in,v
retrieving revision 1.24
diff -u -r1.24 Makefile.in
--- src/libafsrpc/Makefile.in	3 Mar 2003 15:45:36 -0000	1.24
+++ src/libafsrpc/Makefile.in	3 Sep 2003 15:19:24 -0000
@@ -130,7 +130,7 @@
 	$(RANLIB) $@
 	case "${SYS_NAME}" in \
 	    rs_aix*) \
-		$(AR) crv $@ ${srcdir}/../sys/afsl.exp;; \
+		$(AR) crv $@ ../sys/afsl.exp;; \
         esac
 
 rx_event.o: ${RX}/rx_event.c
Index: src/shlibafsrpc/Makefile.in
===================================================================
RCS file: /cvs/openafs/src/shlibafsrpc/Makefile.in,v
retrieving revision 1.12
diff -u -r1.12 Makefile.in
--- src/shlibafsrpc/Makefile.in	11 Jan 2003 07:34:54 -0000	1.12
+++ src/shlibafsrpc/Makefile.in	3 Sep 2003 15:19:25 -0000
@@ -135,7 +135,7 @@
 ${LIBAFSRPC}: ${LIBOBJS}
 	case ${SYS_NAME} in \
 	rs_aix4* | rs_aix5*) \
-		${SHLIB_LINKER} -o ${LIBAFSRPC} ${LIBOBJS} -bE:afsrpc.exp ${MT_LIBS};; \
+		${SHLIB_LINKER} -o ${LIBAFSRPC} ${LIBOBJS} -bE:${srcdir}/afsrpc.exp ${MT_LIBS};; \
 	sun*_5*) \
 		${SHLIB_LINKER} -h ${LIBAFSRPC} -o ${LIBAFSRPC} ${LIBOBJS} ${MT_LIBS};; \
 	*) \
Index: src/sys/Makefile.in
===================================================================
RCS file: /cvs/openafs/src/sys/Makefile.in,v
retrieving revision 1.22
diff -u -r1.22 Makefile.in
--- src/sys/Makefile.in	14 Jul 2003 23:43:45 -0000	1.22
+++ src/sys/Makefile.in	3 Sep 2003 15:19:25 -0000
@@ -36,7 +36,7 @@
 	$(RANLIB) $@
 	case "${SYS_NAME}" in                   	\
 		rs_aix*) 			        \
-			$(AR) crv $@ ${srcdir}/afsl.exp;;         \
+			$(AR) crv $@ afsl.exp;;         \
 	esac
 
 tests:	pagsh pagsh.krb fixit iinc idec icreate iopen istat rmtsysd
@@ -67,7 +67,7 @@
 	${CC} ${CFLAGS} -c ${srcdir}/afssyscalls.c
 
 rmtsysnet.o rmtsysc.o rmtsyss.o rmtsysd.o: rmtsys.h
-rmtsysd: AFS_component_version_number.o
+rmtsysd: AFS_component_version_number.o afs.exp afsl.exp
 
 rmtsys.cs.c: rmtsys.xg
 	${RXGEN} -C -o $@ ${srcdir}/rmtsys.xg
@@ -127,7 +127,7 @@
 		$(CC) -o xfsinode ${CFLAGS} ${srcdir}/xfsinode.c ${LIBS}
 	esac
 
-afs.exp: afs4.exp afs5.exp
+afs.exp: ${srcdir}/afs4.exp ${srcdir}/afs5.exp
 	case ${SYS_NAME} in \
 		rs_aix5* ) \
 			cp -p ${srcdir}/afs5.exp afs.exp ;; \
@@ -135,7 +135,7 @@
 			cp -p ${srcdir}/afs4.exp afs.exp ;; \
 	esac
 
-afsl.exp: afsl4.exp afsl5.exp
+afsl.exp: ${srcdir}/afsl4.exp ${srcdir}/afsl5.exp
 	case ${SYS_NAME} in \
 		rs_aix5* ) \
 			cp -p ${srcdir}/afsl5.exp afsl.exp ;; \
Index: src/util/Makefile.in
===================================================================
RCS file: /cvs/openafs/src/util/Makefile.in,v
retrieving revision 1.23
diff -u -r1.23 Makefile.in
--- src/util/Makefile.in	2 Jul 2003 01:03:20 -0000	1.23
+++ src/util/Makefile.in	3 Sep 2003 15:19:25 -0000
@@ -124,6 +124,12 @@
 afs_lhash.o: ${srcdir}/afs_lhash.c ${includes}
 	${CC} ${CFLAGS} -c ${srcdir}/afs_lhash.c
 
+strlcat.o: ${srcdir}/strlcat.c ${includes}
+	${CC} ${CFLAGS} -c ${srcdir}/strlcat.c
+
+strlcpy.o: ${srcdir}/strlcpy.c ${includes}
+	${CC} ${CFLAGS} -c ${srcdir}/strlcpy.c
+
 #
 # Install targets
 #

--------------000205070003050403080805--