char rootVolume[64] = "root.afs"; /*AFS root volume name*/
afs_int32 cacheSetTime = 1; /*Keep checking time to avoid drift?*/
afs_int32 isHomeCell; /*Is current cell info for the home cell?*/
+#ifdef AFS_XBSD_ENV
+int createAndTrunc = O_RDWR | O_CREAT | O_TRUNC; /*Create & truncate on open*/
+#else
int createAndTrunc = O_CREAT | O_TRUNC; /*Create & truncate on open*/
+#endif
int ownerRWmode = 0600; /*Read/write OK by owner*/
static int filesSet = 0; /*True if number of files explicitly set*/
static int nFilesPerDir = 2048; /* # files per cache dir */
}
if (as->parms[27].items) {
/* -fakestat */
+ enable_fakestat = 2;
+ }
+ if (as->parms[28].items) {
+ /* -fakestat-all */
enable_fakestat = 1;
}
sprintf(fullpn_VFile, "%s/", cacheBaseDir);
vFilePtr = fullpn_VFile + strlen(fullpn_VFile);
+#ifdef AFS_SUN5_ENV
+ {
+ FILE *vfstab;
+ struct mnttab mnt;
+ struct stat statmnt, statci;
+
+ if ((stat(cacheBaseDir, &statci) == 0) &&
+ ((vfstab = fopen(MNTTAB, "r")) != NULL)) {
+ while (getmntent(vfstab, &mnt) == 0) {
+ if (strcmp(cacheBaseDir, mnt.mnt_mountp) != 0) {
+ char *cp;
+ int rdev = 0;
+
+ if (cp = hasmntopt(&mnt, "dev="))
+ rdev=(int)strtol(cp+strlen("dev="), (char **)NULL, 16);
+
+ if ((rdev == 0) && (stat(mnt.mnt_mountp, &statmnt) == 0))
+ rdev=statmnt.st_dev;
+
+ if ((rdev == statci.st_dev) &&
+ (hasmntopt (&mnt, "logging") != NULL)) {
+ printf("WARNING: Mounting a multi-use partition which contains the AFS cache with the\n\"logging\" option may deadlock your system.\n\n");
+ fflush(stdout);
+ }
+ }
+ }
+ fclose(vfstab);
+ }
+ }
+#endif
+
#if 0
fputs(AFS_GOVERNMENT_MESSAGE, stdout);
fflush(stdout);
if (enable_fakestat) {
if (afsd_verbose)
printf("%s: Enabling fakestat support in kernel.\n", rn);
- code = call_syscall(AFSOP_SET_FAKESTAT, 1);
+ code = call_syscall(AFSOP_SET_FAKESTAT, enable_fakestat);
if (code)
printf("%s: Error enabling fakestat support.\n", rn);
}
), "Enable AFSDB support");
cmd_AddParm(ts, "-files_per_subdir", CMD_SINGLE, CMD_OPTIONAL, "log(2) of the number of cache files per cache subdirectory");
cmd_AddParm(ts, "-dynroot", CMD_FLAG, CMD_OPTIONAL, "Enable dynroot support");
- cmd_AddParm(ts, "-fakestat", CMD_FLAG, CMD_OPTIONAL, "Enable fakestat support");
+ cmd_AddParm(ts, "-fakestat", CMD_FLAG, CMD_OPTIONAL, "Enable fakestat support for cross-cell mounts");
+ cmd_AddParm(ts, "-fakestat-all", CMD_FLAG, CMD_OPTIONAL, "Enable fakestat support for all mounts");
return (cmd_Dispatch(argc, argv));
}