afsd -dynroot-sparse mode for hushed cells
[openafs.git] / src / afs / afs_dynroot.c
index 4edcf70..9a4e1ad 100644 (file)
@@ -87,7 +87,7 @@ static int
 afs_dynrootCellInit(void)
 {
     if (!afs_dynrootCell) {
-       afs_int32 cellHosts[MAXCELLHOSTS];
+       afs_int32 cellHosts[AFS_MAXCELLHOSTS];
        struct cell *tc;
        int code;
 
@@ -341,9 +341,10 @@ afs_RebuildDynroot(void)
        c = afs_GetCellByIndex(cellidx, READ_LOCK);
        if (!c)
            break;
-       if (c->cellNum == afs_dynrootCell)
+       if ((c->cellNum == afs_dynrootCell) || (c->states & CHush)) {
+           afs_PutCell(c, READ_LOCK);
            continue;
-
+       }
        dotLen = strlen(c->cellName) + 2;
        dotCell = afs_osi_Alloc(dotLen);
        strcpy(dotCell, ".");
@@ -417,8 +418,10 @@ afs_RebuildDynroot(void)
        c = afs_GetCellByIndex(cellidx, READ_LOCK);
        if (!c)
            continue;
-       if (c->cellNum == afs_dynrootCell)
+       if ((c->cellNum == afs_dynrootCell) || (c->states & CHush)) {
+           afs_PutCell(c, READ_LOCK);
            continue;
+       }
 
        dotLen = strlen(c->cellName) + 2;
        dotCell = afs_osi_Alloc(dotLen);
@@ -798,7 +801,7 @@ afs_DynrootVOPRemove(struct vcache *avc, afs_ucred_t *acred, char *aname)
 #if defined(AFS_SUN510_ENV)
     if (crgetruid(acred))
 #else
-    if (cr_uid(acred))
+    if (afs_cr_uid(acred))
 #endif
        return EPERM;
 
@@ -838,7 +841,7 @@ afs_DynrootVOPSymlink(struct vcache *avc, afs_ucred_t *acred,
 {
     struct afs_dynSymlink *tps;
 
-    if (cr_uid(acred))
+    if (afs_cr_uid(acred))
        return EPERM;
     if (afs_CellOrAliasExists(aname))
        return EEXIST;