]> andersk Git - moira.git/commitdiff
Now handles activation/rename/deactivation of AFS volumes
authorprobe <probe>
Tue, 18 Aug 1992 15:30:36 +0000 (15:30 +0000)
committerprobe <probe>
Tue, 18 Aug 1992 15:30:36 +0000 (15:30 +0000)
incremental/afs.c

index 28dffee30ae009b5b1eb2abe0e09bddc60d4bc1d..1c1a623c42fd1c0e594cbb6305622fc2207b4864 100644 (file)
@@ -351,37 +351,45 @@ int afterc;
        return;
     }
     
-    /* What do we do?  When do we use FS_CREATE?
-     *
-     * Currently, we use FS_CREATE to indicate that Moira should attempt
-     * to update the file servers (rename, creation, ownership change).
-     * 
-     * Howerver, at this time, we there is no back-end support to handle:
-     *   TYPE change       (eg. AFS -> ERR)
-     *   LOCKERTYPE change (eg. PROJECT -> COURSE)
-     *   PACK change       (eg. /afs/athena/foo -> /afs/athena/bar)
-     *   LABEL change      (eg. "foo" -> "bar")
-     *   Locker Deletion
-     */
-
     btype = !strcmp(before[FS_TYPE], "AFS");
     if (afterc < FS_CREATE) {
        if (btype)
            critical_alert("incremental",
-                          "Could not delete AFS filesystem %s: Operation not supported",
+                          "Cannot delete AFS filesystem %s: Operation not supported",
                           before[FS_NAME]);
        return;
-    } if (acreate && atype) {
-       if (btype) {
-           critical_alert("incremental",
-                          "Cannot change attributes of AFS filesystem %s: Operation not supported",
-                          after[FS_NAME]);
-       } else {
-           critical_alert("incremental",
-                          "Cannot convert %s to an AFS filesystem: Operation not supported",
-                          after[FS_NAME]);
-       }
     }
+
+    if (!acreate)
+       return;
+
+    /* Are we dealing with AFS lockers (could be type ERR lockers) */
+    if (!atype && !btype)
+       if (strcmp(before[FS_TYPE], "ERR") || strcmp(after[FS_TYPE], "ERR"))
+           return;
+                                                   
+    /* By now, we know we are simply changing AFS filesystem attributes.
+     * Operations supported:
+     *    Name change:  rename/remount
+     *    Path change:  remount
+     *    Type change:  ERR<-->AFS
+     */
+    
+    if (strcmp(before[FS_OWNER], after[FS_OWNER]) ||
+       strcmp(before[FS_OWNERS], after[FS_OWNERS)))
+    {
+       critical_alert("incremental",
+                      "Cannot change ownership of filesystem %s: Operation not yet supported",
+                      after[FS_NAME]);
+    }
+
+    sprintf(cmd, "%s/perl -I%s %s/afs_rename.pl %s %s %s %s %s %s %s %s %s %s",
+           BIN_DIR, BIN_DIR, BIN_DIR,
+           before[FS_NAME], before[FS_CELL], before[FS_TYPE],
+           before[FS_L_TYPE], before[FS_PACK],
+           after[FS_NAME], after[FS_CELL], after[FS_TYPE],
+           after[FS_L_TYPE], after[FS_PACK]);
+    run_cmd(cmd);
 }
 
 
This page took 0.038967 seconds and 5 git commands to generate.