Initial fakestat support (fake mountpoint directory attributes).
[openafs.git] / src / afsd / afsd.c
index e63a20e..7e95b73 100644 (file)
@@ -240,6 +240,7 @@ static int enable_process_stats = 0;        /* enable rx stats */
 static int enable_afsdb = 0;           /* enable AFSDB support */
 #endif
 static int enable_dynroot = 0;         /* enable dynroot support */
+static int enable_fakestat = 0;                /* enable fakestat support */
 #ifdef notdef
 static int inodes = 60;                        /* VERY conservative, but has to be */
 #endif
@@ -1326,6 +1327,10 @@ mainproc(as, arock)
        /* -dynroot */
        enable_dynroot = 1;
     }
+    if (as->parms[27].items) {
+       /* -fakestat */
+       enable_fakestat = 1;
+    }
 
     /*
      * Pull out all the configuration info for the workstation's AFS cache and
@@ -1565,6 +1570,14 @@ mainproc(as, arock)
            printf("%s: Error enabling dynroot support.\n", rn);
     }
 
+    if (enable_fakestat) {
+       if (afsd_verbose)
+           printf("%s: Enabling fakestat support in kernel.\n", rn);
+       code = call_syscall(AFSOP_SET_FAKESTAT, 1);
+       if (code)
+           printf("%s: Error enabling fakestat support.\n", rn);
+    }
+
     /* Initialize AFS daemon threads. */
     if (afsd_verbose)
        printf("%s: Forking AFS daemon.\n", rn);
@@ -1918,6 +1931,7 @@ char **argv; {
                ), "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");
     return (cmd_Dispatch(argc, argv));
 }