Housekeeping change to consolidate some common definitions.
Create a new common header called afs_consts.h. This allows
us to remove the afscp.c dependency on afs.h (so src/tests
will build again.) Rename the max filename definition in the
update server package to MAXFNSIZE to avoid a name conflict
with MAXSIZE. The global defines will be prefixed with
AFS_ in a second patch.
Change-Id: I2b8d555a244cc92d889618de4eec4a99550d7c7f
Reviewed-on: http://gerrit.openafs.org/855
Reviewed-by: Mickey Lane <mlane@sinenomine.net>
Tested-by: Mickey Lane <mlane@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
#include <afs/vice.h>
#include <netinet/in.h>
#include <afs/venus.h>
+#include <afs/afs_consts.h>
#include <afs/afs_args.h>
#include "GetNativeString.h"
*/
/* just for debugging */
-#define MAXHOSTS 13
-#define OMAXHOSTS 8
#define MAXNAME 100
-#define MAXSIZE 2048
#define MAXINSIZE 1300 /* pioctl complains if data is larger than this */
#define VMSGSIZE 128 /* size of msg buf in volume hdr */
#include <osi.h>
#include <afsint.h>
+#include <afs/afs_consts.h>
#include <afs/cellconfig.h>
#include <afs/ptserver.h>
#include <afs/ptuser.h>
#include "afsd.h"
#include "cm_ioctl.h"
-#define MAXHOSTS 13
-#define OMAXHOSTS 8
-#define MAXCELLHOSTS 8
#define MAXNAME 100
-#define MAXSIZE 2048
#define MAXINSIZE 1300 /* pioctl complains if data is larger than this */
#define VMSGSIZE 128 /* size of msg buf in volume hdr */
#define CELL_MAXNAMELEN 256
#include <afs/param.h>
#include <afs/stds.h>
#include <afs/com_err.h>
+#include <afs/afs_consts.h>
#include <windows.h>
#include <stdlib.h>
#include "cmd.h"
#define MAXNAME 100
-#define MAXSIZE 2048
#define MAXINSIZE 1300 /* pioctl complains if data is larger than this */
static char space[MAXSIZE];
#include "fs.h"
#include "fs_utils.h"
#include <afsint.h>
+#include <afs/afs_consts.h>
#include <afs/cellconfig.h>
#include <afs/vldbint.h>
#include <afs/volser.h>
#define PCCHAR(str) ((char *)(const char *)(str))
#define VL_NOENT (363524L)
-#define MAXHOSTS 13
-#define OMAXHOSTS 8
#define MAXNAME 100
-#define MAXSIZE 2048
#define MAXINSIZE 1300 /* pioctl complains if data is larger than this */
#define VMSGSIZE 128 /* size of msg buf in volume hdr */
#include "make_symbolic_link_dlg.h"
#include "gui2fs.h"
#include "msgs.h"
-#define MAXSIZE 2048 /* most I'll get back from PIOCTL */
#ifdef _DEBUG
#define new DEBUG_NEW
extern "C" {
#include <afs/param.h>
#include <afs/stds.h>
+#include <afs/afs_consts.h>
}
#include <atlconv.h>
ULONG nTPRefCount=0;
ULONG nXPRefCount=0;
-#define MAXSIZE 2048 /* most I'll get back from PIOCTL */
#define PCCHAR(str) ((char *)(const char *)str)
static char space[MAXSIZE];
esac
depinstall: afszcm.cat AFS_component_version_number.c \
+ ${TOP_INCDIR}/afs/afs_consts.h \
${TOP_INCDIR}/afs/afs.h \
${TOP_INCDIR}/afs/osi_inode.h \
${TOP_INCDIR}/afs/afs_stats.h \
${TOP_INCDIR}/afs/unified_afs.h \
${TOP_INCDIR}/afs/sysctl.h
+${TOP_INCDIR}/afs/afs_consts.h: afs_consts.h
+ ${INSTALL_DATA} $? $@
+
${TOP_INCDIR}/afs/afs.h: afs.h
${INSTALL_DATA} $? $@
install: unified_afs.h
${INSTALL} -d ${DESTDIR}${includedir}/afs
${INSTALL_DATA} afs.h ${DESTDIR}${includedir}/afs/afs.h
+ ${INSTALL_DATA} afs_consts.h ${DESTDIR}${includedir}/afs/afs_consts.h
${INSTALL_DATA} afs_stats.h ${DESTDIR}${includedir}/afs/afs_stats.h
${INSTALL_DATA} exporter.h ${DESTDIR}${includedir}/afs/exporter.h
${INSTALL_DATA} nfsclient.h ${DESTDIR}${includedir}/afs/nfsclient.h
dest: unified_afs.h
${INSTALL} -d ${DEST}/include/afs
${INSTALL_DATA} afs.h ${DEST}/include/afs/afs.h
+ ${INSTALL_DATA} afs_consts.h ${DEST}/include/afs/afs_consts.h
${INSTALL_DATA} afs_stats.h ${DEST}/include/afs/afs_stats.h
${INSTALL_DATA} exporter.h ${DEST}/include/afs/exporter.h
${INSTALL_DATA} nfsclient.h ${DEST}/include/afs/nfsclient.h
$(COMPILE_ET) unified_afs -h unified_afs
$(COPY) unified_afs.h $(DESTDIR)\include\afs
-install: $(INCDIR)\afs\unified_afs.c $(INCDIR)\afs\afs_stats.h
+install: $(INCDIR)\afs\unified_afs.c $(INCDIR)\afs\afs_stats.h $(INCDIR)\afs\afs_consts.h
*/
#ifdef KDUMP_KERNEL
#include <afs/afs_args.h>
+#include <afs/afs_consts.h>
#else
#include "afs/afs_args.h"
+#include "afs/afs_consts.h"
#endif
/*
/* The basic defines for the Andrew file system
better keep things powers of two so "& (foo-1)" hack works for masking bits */
-#define MAXHOSTS 13 /* max hosts per single volume */
-#define OMAXHOSTS 8 /* backwards compatibility */
-#define MAXCELLHOSTS 8 /* max vldb servers per cell */
#define NBRS 15 /* max number of queued daemon requests */
#define NUSERS 16 /* hash table size for unixuser table */
#define NSERVERS 16 /* hash table size for server table */
--- /dev/null
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License. For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+
+#ifndef _AFS_CONSTS_H_
+#define _AFS_CONSTS_H_
+
+#define MAXHOSTS 13 /* max hosts per single volume */
+#define OMAXHOSTS 8 /* backwards compatibility */
+#define MAXCELLHOSTS 8 /* max vldb servers per cell */
+
+#define MAXSIZE 2048 /* max returned from PIOCTL */
+
+#endif /* _AFS_CONSTS_H_ */
#include <stdlib.h>
#include <string.h>
#include <afs/sys_prototypes.h>
+#include <afs/afs_consts.h>
#include "kkids.h"
#define MAXNAME 100
-#define MAXSIZE 2048
static int using_child = 0;
static FILE *childin, *childout; /* file pointers on pipe to kpwvalid */
#include <afs/com_err.h>
#include <afs/cellconfig.h>
#include <afs/auth.h>
+#include <afs/afs_consts.h>
#include "kautils.h"
/* Stolen from the "fs" command. */
#define MAXNAME 100
-#define MAXSIZE 2048
static void
ListCellsCmd()
#include <afsconfig.h>
#include <afs/param.h>
-
+#include <afs/afs_consts.h>
#include <errno.h>
#include <sys/param.h>
*/
#define MAXNAME 100
-#define MAXSIZE 2048
-#define MAXHOSTS 8 /* XXX HARD Limit limitation XXX */
#define MAXGCSIZE 16
struct Acl {
afs_uint32 mode;
int error;
- char hostname[MAXSIZE];
+ char hostname[MAXFNSIZE];
FILE *stream;
afs_int32 time, length, atime;
struct filestr *df;
int a, cnt;
rxkad_level level;
- char dirbuf[MAXSIZE], filename[MAXSIZE];
+ char dirbuf[MAXFNSIZE], filename[MAXFNSIZE];
struct filestr *dirname, *ModFiles, *okhostfiles;
#ifdef AFS_AIX32_ENV
/*
{ /*delete all the redundant files on the client */
DIR *dirp;
struct dirent *dp;
- char filename[MAXSIZE];
+ char filename[MAXFNSIZE];
dirp = opendir(curDir);
if (dirp == 0) {
static int
RenameNewFiles(struct filestr *modFiles)
{
- char newname[MAXSIZE];
+ char newname[MAXFNSIZE];
char *fname;
int errcode = 0;
struct filestr *tf;
#else
struct timeval tvp[2];
#endif
- char newfile[MAXSIZE];
+ char newfile[MAXFNSIZE];
/* construct local path from canonical (wire-format) path */
errcode = ConstructLocalPath(filename, "/", &lfile);
#endif
#define TIMEOUT 300 /*interval after which the files are resynch'ed */
-#define MAXSIZE 1024 /*max size of filenames */
+#define MAXFNSIZE 1024 /*max size of filenames */
#define MAXENTRIES 20
#define UPDATEERR 100
struct dirent *dp;
FILE *stream;
struct stat tstatus;
- char filename[MAXSIZE], dirInfoFile[MAXSIZE];
+ char filename[MAXFNSIZE], dirInfoFile[MAXFNSIZE];
int fd, tfd, errcode, error, err;
error = 0;
goto fail;
}
if ((tstatus.st_mode & S_IFMT) != S_IFDIR) { /* not a directory */
- char dirEntry[MAXSIZE];
+ char dirEntry[MAXFNSIZE];
strcpy(dirEntry, origDir);
strcat(dirEntry, "/");
#include <afs/afsint.h>
#include <afs/prs_fs.h>
#include <afs/com_err.h>
+#include <afs/afs_consts.h>
#define MAXNAME 100
-#define MAXSIZE 2048
#undef USS_ACL_DB
#include <afs/afsutil.h>
#include <rx/rx.h>
#include <rx/xdr.h>
+#include <afs/afs_consts.h>
#include <afs/afscbint.h>
#include <afs/vldbint.h>
#include <afs/vlserver.h>
#include <des_prototypes.h>
#include <rx_prototypes.h>
#include "../rxkad/md5.h"
-#define MAXHOSTS 13
#ifdef O_LARGEFILE
#define afs_stat stat64
#define afs_fstat fstat64
#include <afs/param.h>
+#include <afs/afs_consts.h>
#include <afs/afs_args.h>
#include <rx/xdr.h>
#include <sys/ioctl.h>
#include <afs/vice.h>
#include <afs/venus.h>
#include <afs/com_err.h>
+#include <afs/afs_consts.h>
#ifdef AFS_AIX32_ENV
#include <signal.h>
#endif
#include <afs/ptuser.h>
#include <afs/afsutil.h>
#include <afs/sys_prototypes.h>
-
-#define MAXHOSTS 13
-#define OMAXHOSTS 8
-#define MAXCELLHOSTS 8
+
#define MAXNAME 100
-#define MAXSIZE 2048
#define MAXINSIZE 1300 /* pioctl complains if data is larger than this */
#define VMSGSIZE 128 /* size of msg buf in volume hdr */
#include <afs/vice.h>
#include <afs/venus.h>
#include <afs/com_err.h>
+#include <afs/afs_consts.h>
#include <afs/sys_prototypes.h>
#ifdef AFS_AIX32_ENV
#include <signal.h>
#endif
-#define MAXSIZE 2048
static char space[MAXSIZE];
int
#include <afs/cmd.h>
#include <strings.h>
#include <afs/com_err.h>
+#include <afs/afs_consts.h>
-#define MAXSIZE 2048
#define MAXINSIZE 1300 /* pioctl complains if data is larger than this */
#define VMSGSIZE 128 /* size of msg buf in volume hdr */
#include <afs/venus.h>
#include <afs/sys_prototypes.h>
#include <afs/afsutil.h>
+#include <afs/afs_consts.h>
/* ************************************************************* */
short oldAcl = 0;
char file1[MAXPATHLEN], file2[MAXPATHLEN];
-#define MAXSIZE 2048
static char space[MAXSIZE];
struct OldAcl {
#include "vlserver.h"
#include "cnvldb.h" /* CHANGEME! */
-#define MAXSIZE 2048 /* most I'll get back from PIOCTL */
#define BADSERVERID 255 /* XXX */
#include <netinet/in.h>
#include <afs/venus.h>
#include <afs/cmd.h>
+#include <afs/afs_consts.h>
#ifdef notdef
#include <afs/vice.h>
#endif
#include <strings.h>
-#define MAXSIZE 2048 /* most I'll get back from PIOCTL */
static char pn[] = "cnvldb";