[OpenAFS-devel] [PATCHES] prototype src/bucoord, libbxdb

Christopher Allen Wing wingc@engin.umich.edu
Fri, 7 Jul 2006 17:33:47 -0400 (EDT)


Here is a set of patches which add prototypes for all the stuff in 
src/bucoord.  This can be divided into two pieces:

 	1. libbxdb.a, which is used by 'backup' as well as 'butc'

 	2. the sources for 'backup' itself


Due to the size of the patches I haven't included them with this email. 
You can find them at:

 	http://www-personal.umich.edu/~wingc/afs-backup/patches/bucoord/

or

 	/afs/engin.umich.edu/u/w/i/wingc/Public/afs-backup/patches/bucoord



The patches apply in the following order:

 	openafs-1.4.x-20060707-bucoord-prototype-1.patch

 		This is the result of a 'protoize' on src/bucoord/*.c;
 		convert all function declarations to ANSI.  No other
 		changes.

 	openafs-1.4.x-20060707-bucoord-prototype-2.patch

 		This patch fills in missing return types for the functions
 		in src/bucoord/*.c.  Most of them want afs_int32 to match
 		what their callers expect.  A few are void or int.

 	openafs-1.4.x-20060707-bucoord-prototype-3.patch

 		This patch collects all the prototypes for non-static
 		functions in src/bucoord/*.c into two header files:

 			src/bucoord/bucoord_prototypes.h

 				(prototypes for functions that are used by
 				objects that build 'backup')

 			src/bucoord/bxdb_prototypes.h

 				(prototypes for functions that get built
 				into libbxdb)

 	openafs-1.4.x-20060707-bucoord-prototype-4.patch

 		This patch modifies the code in src/bucoord to actually
 		use the prototypes added by patch #3.  The necessary
 		includes are added.  Some includes are added to the
 		prototype headers themselves to define types used in the
 		function declarations.

 		Two functions are made static in src/bucoord/commands.c:

 			getSPEntries()
 			randSPEntries()

 		These functions take argument types which are only defined
 		inside src/bucoord/commands.c, and thus can't be used by
 		other code anyway.

 		The prototype for ubik_Call_SingleServer() is removed;
 		this function uses a hack calling convention (like
 		ubik_Call()) so that it can never be prototyped (or else
 		it breaks).

 		This patch also removes all the existing non-prototype
 		function declarations which were sprinkled inside
 		src/bucoord.


 		Finally, it installs the bxdb_prototypes.h header into the
 		standard include directories, since libbxdb.a may be used
 		by other code.

 	openafs-1.4.x-20060707-bucoord-prototype-butc.patch

 		This patch modifies src/butc to use the prototypes for
 		libbxdb provided by the bxdb_prototypes.h header file.

 		It corrects one instance where bcdb_FinishTape() was
 		called with an incorrect number of arguments.

 	openafs-1.4.x-20060707-bucoord-prototype-5.patch

 		This patch adds prototype declarations for all static
 		functions in src/bucoord.

 	openafs-1.4.x-20060707-bucoord-prototype-6.patch

 		Finally, this patch corrects some remaining missing header
 		#includes in src/bucoord/*.c.  <string.h> is missing from
 		many files.  Also, several AFS-internal headers need to be
 		added to get prototypes for some functions.

 		<unistd.h> is added to one file, but outside
 		'#ifdef AFS_NT40_ENV', so that it will only be included on
 		unix systems.

 		The old <strings.h> header is removed from several files
 		in src/bucoord; this is obsolete and should only be used
 		for bcopy(), bzero(), etc; these functions were removed
 		from the openafs sources a long time ago.




Finally, if you prefer, all of these patches are collapsed into a single 
patch here:

 	openafs-1.4.x-20060707-bucoord-prototype-all.patch




I tested this on openafs-stable-1_4_x with the modified 'backup' and 
'butc'.  I was able to successfully dump and restore a volume.  (this is 
using 64-bit Linux)

The patches also apply to HEAD without any fuzz, but I haven't tried 
compiling or testing that.



I would appreciate feedback if you think these kinds of patches are 
useful.


Thanks,

Chris Wing
wingc@engin.umich.edu