* -confdir The configuration directory .
* -nosettime Don't keep checking the time to avoid drift (default).
* -settime Keep checking the time to avoid drift.
+ * -rxmaxmtu Set the max mtu to help with VPN issues.
* -verbose Be chatty.
+ * -disable-dynamic-vcaches Disable the use of -stat value as the starting size of
+ * the size of the vcache/stat cache pool,
+ * but increase that pool dynamically as needed.
* -debug Print out additional debugging info.
* -kerndev [OBSOLETE] The kernel device for AFS.
* -dontfork [OBSOLETE] Don't fork off as a new process.
static IONotificationPortRef notify;
static io_object_t iterator;
static CFRunLoopSourceRef source;
-static DNSSDState dnsstate;
static int event_pid;
static int rootVolSet = 0; /*True if root volume name explicitly set */
int addrNum; /*Cell server address index being printed */
static int cacheFlags = 0; /*Flags to cache manager */
+#ifdef AFS_AIX32_ENV
static int nBiods = 5; /* AIX3.1 only */
+#endif
static int preallocs = 400; /* Def # of allocated memory blocks */
static int enable_peer_stats = 0; /* enable rx stats */
static int enable_process_stats = 0; /* enable rx stats */
#ifdef notdef
static int inodes = 60; /* VERY conservative, but has to be */
#endif
+int afsd_dynamic_vcaches = 0; /* Enable dynamic-vcache support */
int afsd_verbose = 0; /*Are we being chatty? */
int afsd_debug = 0; /*Are we printing debugging info? */
int afsd_CloseSynch = 0; /*Are closes synchronous or not? */
+int rxmaxmtu = 0; /* Are we forcing a limit on the mtu? */
#ifdef AFS_SGI62_ENV
#define AFSD_INO_T ino64_t
int afsd_rmtsys = 0; /* Default: don't support rmtsys */
struct afs_cacheParams cparams; /* params passed to cache manager */
-static int HandleMTab();
+static int HandleMTab(void);
+int PartSizeOverflow(char *path, int cs);
#ifdef AFS_DARWIN_ENV
static void
afsd_sleep_callback(void * refCon, io_service_t service,
natural_t messageType, void * messageArgument )
{
- afs_int32 code;
-
switch (messageType) {
case kIOMessageCanSystemSleep:
/* Idle sleep is about to kick in; can
afsd_update_addresses(CFRunLoopTimerRef timer, void *info)
{
/* parse multihomed address files */
- afs_int32 addrbuf[MAXIPADDRS], maskbuf[MAXIPADDRS],
+ afs_uint32 addrbuf[MAXIPADDRS], maskbuf[MAXIPADDRS],
mtubuf[MAXIPADDRS];
char reason[1024];
afs_int32 code;
static void
afsd_event_cleanup(int signo) {
- DNSSDState *query = &dnsstate;
CFRunLoopRemoveSource(CFRunLoopGetCurrent(), source, kCFRunLoopDefaultMode);
CFRelease (source);
}
/* Adapted from "Living in a Dynamic TCP/IP Environment" technote. */
-static Boolean
+static void
afsd_install_events(void)
{
SCDynamicStoreContext ctx = {0};
*---------------------------------------------------------------------------*/
static int
-doGetXFileNumber(fname, filechar, maxNum)
- char *fname;
- char filechar;
- int maxNum;
+doGetXFileNumber(char *fname, char filechar, int maxNum)
{
int computedVNumber; /*The computed file number we return */
int filenameLen; /*Number of chars in filename */
}
int
-GetVFileNumber(fname, maxFile)
- char *fname;
- int maxFile;
+GetVFileNumber(char *fname, int maxFile)
{
return doGetXFileNumber(fname, 'V', maxFile);
}
int
-GetDDirNumber(fname, maxDir)
- char *fname;
- int maxDir;
+GetDDirNumber(char *fname, int maxDir)
{
return doGetXFileNumber(fname, 'D', maxDir);
}
*---------------------------------------------------------------------------*/
static int
-CreateCacheSubDir(basename, dirNum)
- char *basename;
- int dirNum;
+CreateCacheSubDir(char *basename, int dirNum)
{
static char rn[] = "CreateCacheSubDir"; /* Routine Name */
char dir[1024];
}
static int
-MoveCacheFile(basename, fromDir, toDir, cacheFile, maxDir)
- char *basename;
- int fromDir, toDir, cacheFile, maxDir;
+MoveCacheFile(char *basename, int fromDir, int toDir, int cacheFile,
+ int maxDir)
{
static char rn[] = "MoveCacheFile";
char from[1024], to[1024];
}
int
-CreateCacheFile(fname, statp)
- char *fname;
- struct stat *statp;
+CreateCacheFile(char *fname, struct stat *statp)
{
static char rn[] = "CreateCacheFile"; /*Routine name */
int cfd; /*File descriptor to AFS cache file */
static int
-doSweepAFSCache(vFilesFound, directory, dirNum, maxDir)
- int *vFilesFound;
- char *directory; /* /path/to/cache/directory */
- int dirNum; /* current directory number */
- int maxDir; /* maximum directory number */
+doSweepAFSCache(int *vFilesFound,
+ char *directory, /* /path/to/cache/directory */
+ int dirNum, /* current directory number */
+ int maxDir) /* maximum directory number */
{
static char rn[] = "doSweepAFSCache"; /* Routine Name */
char fullpn_FileToDelete[1024]; /*File to be deleted from cache */
#ifdef AFS_SGI62_ENV
printf("\tinode=%" AFS_INT64_FMT ", reclen=%d, name='%s'\n", currp->d_ino,
currp->d_reclen, currp->d_name);
+#elif defined(AFS_DFBSD_ENV)
+ printf("\tinode=%d, name='%s'\n", currp->d_ino, currp->d_name);
#else
printf("\tinode=%d, reclen=%d, name='%s'\n", currp->d_ino,
currp->d_reclen, currp->d_name);
}
int
-SweepAFSCache(vFilesFound)
- int *vFilesFound;
+SweepAFSCache(int *vFilesFound)
{
static char rn[] = "SweepAFSCache"; /*Routine name */
int maxDir = (cacheFiles + nFilesPerDir - 1) / nFilesPerDir;
return 0;
}
-static
+static int
ConfigCellAlias(struct afsconf_cellalias *aca,
void *arock, struct afsconf_dir *adir)
{
}
#ifdef AFS_AFSDB_ENV
-static
-AfsdbLookupHandler()
+static void
+AfsdbLookupHandler(void)
{
afs_int32 kernelMsg[64];
char acellName[128];
#endif
#endif
+int
mainproc(struct cmd_syndesc *as, void *arock)
{
static char rn[] = "afsd"; /*Name of this routine */
int cacheIteration; /*How many times through cache verification */
int vFilesFound; /*How many data cache files were found in sweep */
struct afsconf_dir *cdir; /* config dir */
- FILE *logfd;
char *fsTypeMsg = NULL;
#ifdef AFS_SUN5_ENV
struct stat st;
#endif
- afs_int32 vfs1_type = -1;
#ifdef AFS_SGI65_ENV
struct sched_param sp;
#endif
}
}
}
+ if (as->parms[35].items) {
+#ifdef AFS_MAXVCOUNT_ENV
+ /* -disable-dynamic-vcaches */
+ afsd_dynamic_vcaches = FALSE;
+#else
+ printf("afsd: Error toggling flag, dynamically allocated vcaches not supported on your platform\n");
+ exit(1);
+#endif
+ }
+#ifdef AFS_MAXVCOUNT_ENV
+ else {
+ /* -dynamic-vcaches */
+ afsd_dynamic_vcaches = TRUE;
+ }
+
+ if (afsd_verbose)
+ printf("afsd: %s dynamically allocated vcaches\n", ( afsd_dynamic_vcaches ? "enabling" : "disabling" ));
+#endif
+
+ /* set -rxmaxmtu */
+ if (as->parms[35].items) {
+ /* -rxmaxmtu */
+ rxmaxmtu = atoi(as->parms[35].items->data);
+ }
+
/*
* Pull out all the configuration info for the workstation's AFS cache and
* the cellular community we're willing to let our users see.
}
memset(inode_for_V, '\0', (cacheFiles * sizeof(AFSD_INO_T)));
if (afsd_debug)
- printf("%s: %d inode_for_V entries at 0x%x, %d bytes\n", rn,
+ printf("%s: %d inode_for_V entries at 0x%x, %lu bytes\n", rn,
cacheFiles, inode_for_V, (cacheFiles * sizeof(AFSD_INO_T)));
#endif
/* initialize the rx random number generator from user space */
{
/* parse multihomed address files */
- afs_int32 addrbuf[MAXIPADDRS], maskbuf[MAXIPADDRS],
+ afs_uint32 addrbuf[MAXIPADDRS], maskbuf[MAXIPADDRS],
mtubuf[MAXIPADDRS];
char reason[1024];
code =
cparams.chunkSize = chunkSize;
cparams.setTimeFlag = cacheSetTime;
cparams.memCacheFlag = cacheFlags;
+ cparams.dynamic_vcaches = afsd_dynamic_vcaches;
#ifdef notdef
cparams.inodes = inodes;
#endif
fullpn_CellInfoFile);
call_syscall(AFSOP_CELLINFO, fullpn_CellInfoFile);
+ if (rxmaxmtu) {
+ if (afsd_verbose)
+ printf("%s: Setting rxmaxmtu in kernel = %d\n", rn, rxmaxmtu);
+ code = call_syscall(AFSOP_SET_RXMAXMTU, rxmaxmtu);
+ if (code)
+ printf("%s: Error seting rxmaxmtu\n", rn);
+ }
+
if (enable_dynroot) {
if (afsd_verbose)
printf("%s: Enabling dynroot support in kernel.\n", rn);
#include "AFS_component_version_number.c"
-
+int
main(int argc, char **argv)
{
struct cmd_syndesc *ts;
"set rx_extraPackets to this value");
cmd_AddParm(ts, "-splitcache", CMD_SINGLE, CMD_OPTIONAL,
"Percentage RW versus RO in cache (specify as 60/40)");
-
+ cmd_AddParm(ts, "-disable-dynamic-vcaches", CMD_FLAG, CMD_OPTIONAL,
+ "disable stat/vcache cache growing as needed");
+ cmd_AddParm(ts, "-rxmaxmtu", CMD_SINGLE, CMD_OPTIONAL, "set rx max MTU to use");
+
return (cmd_Dispatch(argc, argv));
}
#endif
static int
-HandleMTab()
+HandleMTab(void)
{
#if (defined (AFS_SUN_ENV) || defined (AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV)) && !defined(AFS_SUN58_ENV)
FILE *tfilep;
#if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV)
-call_syscall(param1, param2, param3, param4, param5, param6, param7)
- long param1, param2, param3, param4, param5, param6, param7;
+int
+call_syscall(long param1, long param2, long param3, long param4, long param5,
+ long param6, long param7)
{
int error;
#ifdef AFS_LINUX20_ENV
#endif
if (afsd_debug)
- printf("SScall(%d, %d, %d)=%d ", AFS_SYSCALL, AFSCALL_CALL, param1,
+ printf("SScall(%d, %d, %ld)=%d ", AFS_SYSCALL, AFSCALL_CALL, param1,
error);
return (error);
}