]> andersk Git - moira.git/commitdiff
new quota records
authormar <mar>
Fri, 13 Apr 1990 17:31:51 +0000 (17:31 +0000)
committermar <mar>
Fri, 13 Apr 1990 17:31:51 +0000 (17:31 +0000)
dbck/FIXES
dbck/phase2.qc
dbck/phase4.qc

index 7dab292d70c97a313ff40bf79baa6b92036ef94b..fb1cca78d990b670d9e447c6d3eaa5906f45ead4 100644 (file)
@@ -75,7 +75,9 @@ P     Set to correct one if found
            else create one
    Every NFS physical's machine must exist
        Delete entry
-P  Every quota must be for a real user
+P  Every USER quota must be for a real user
+       Delete quota
+P  Every GROUP quota must be for a real list
        Delete quota
    Every quota must be on a real filesys
        Delete quota
index 363e92c69e4f7cc7dc92957ff58561372e6bfdee..d5f2337491eade2d149d9db191f63cc66f6ec7c5 100644 (file)
@@ -547,50 +547,90 @@ struct filesys *f;
 ##{
 ##  int id1, found = 1;
 
-##  retrieve (id1 = nfsquota.filsys_id) where nfsquota.users_id = id {
+##  retrieve (id1 = quota.filsys_id) where quota.entity_id = id and
+##     quota.type = "USER" {
       found = 0;
-      printf("NFSquota on fs %d for non-existant user %d\n", id1, id);
+      printf("Quota on fs %d for non-existant user %d\n", id1, id);
 ##  }
     return(found);
 ##}
 
-fix_quota_nouser(id)
-{
-    single_delete("nfsquota", "users_id", id);
-}
+##show_quota_nolist(id)
+##int id;
+##{
+##  int id1, found = 1;
+
+##  retrieve (id1 = quota.filsys_id) where quota.entity_id = id and
+##     quota.type = "GROUP" {
+      found = 0;
+      printf("Quota on fs %d for non-existant list %d\n", id1, id);
+##  }
+    return(found);
+##}
+
+##fix_quota_nouser(id)
+##int id;
+##{
+##  int rowcount, id1;
+
+    id1 = ((struct filesys *)hash_lookup(filesys, id))->phys_id;
+##  delete quota where quota.entity_id = id and quota.type = "USER"
+##  inquire_equel(rowcount = "rowcount")
+    if (rowcount > 0)
+      printf("%d entr%s deleted\n",rowcount, rowcount==1?"y":"ies");
+    else
+      printf("Not deleted\n");
+    modified("quota");
+##}
+
+##fix_quota_nolist(id)
+##int id;
+##{
+##  int rowcount, id1;
+
+    id1 = ((struct filesys *)hash_lookup(filesys, id))->phys_id;
+##  delete quota where quota.entity_id = id and quota.type = "GROUP"
+##  inquire_equel(rowcount = "rowcount")
+    if (rowcount > 0)
+      printf("%d entr%s deleted\n",rowcount, rowcount==1?"y":"ies");
+    else
+      printf("Not deleted\n");
+    modified("quota");
+##}
 
 ##show_quota_nofs(id)
 ##int id;
 ##{
 ##  int id1, found = 1;
-    struct user *u;
+##  char type[9];
 
-##  retrieve (id1 = nfsquota.users_id) where nfsquota.filsys_id = id {
-      u = (struct user *)hash_lookup(users, id1);
+##  retrieve (id1 = quota.entity_id, type = quota.#type)
+##     where quota.filsys_id = id {
       found = 0;
-      printf("NFSquota for user %s on non-existant filesys %d\n", u->login, id);
+      printf("Quota for %s %d on non-existant filesys %d\n", type, id1, id);
 ##  }
     return(found);
 ##}
 
 fix_quota_nofs(id)
 {
-    single_delete("nfsquota", "filsys_id", id);
+    single_delete("quota", "filsys_id", id);
 }
 
 ##show_quota_wrongpid(id)
 ##int id;
 ##{
 ##  int id1, found = 1;
+##  char type[9];
     struct user *u;
     struct filesys *f;
 
     f = (struct filesys *)hash_lookup(filesys, id);
-##  retrieve (id1 = nfsquota.users_id) where nfsquota.filsys_id = id {
-      u = (struct user *)hash_lookup(users, id1);
+##  retrieve (id1 = quota.entity_id, type = quota.#type)
+##     where quota.filsys_id = id {
       found = 0;
-      printf("NFSquota for user %s on filesys %s has wrong phys_id %d\n",
-            u->login, f->name, id);
+      printf("Quota for %s %d on filesys %s has wrong phys_id %d\n",
+            type, id1, f->name, id);
 ##  }
     return(found);
 ##}
@@ -601,14 +641,14 @@ fix_quota_nofs(id)
 ##  int rowcount, id1;
 
     id1 = ((struct filesys *)hash_lookup(filesys, id))->phys_id;
-##  replace nfsquota (phys_id = id1) where nfsquota.filsys_id = id and
-##     nfsquota.phys_id != id1 
+##  replace quota (phys_id = id1) where quota.filsys_id = id and
+##     quota.phys_id != id1    
 ##  inquire_equel(rowcount = "rowcount")
     if (rowcount > 0)
       printf("%d entr%s fixed\n",rowcount, rowcount==1?"y":"ies");
     else
       printf("Not fixed\n");
-    modified("nfsquota");
+    modified("quota");
 ##}
 
 ##show_srv_user(id)
@@ -838,14 +878,17 @@ phase2()
     generic_fix(sq2, show_fsg_type, "Change to \"FSTYPE\"", fix_fsg_type, 0);
     generic_delete(sq3, show_fsg_nomember, "fsgroup", "filsys_id", 1);
 
-    dprintf("Checking nfsquota...\n");
+    dprintf("Checking quotas...\n");
     sq1 = sq_create();
     sq2 = sq_create();
     sq3 = sq_create();
-##  retrieve (id1 = nfsquota.users_id, id2 = nfsquota.filsys_id,
-##           id3 = nfsquota.phys_id, id4 = nfsquota.quota) {
-       if (id1 != 0 && !hash_lookup(users, id1))
+    sq4 = sq_create();
+##  retrieve (id1 = quota.entity_id, type = quota.#type, id2 = quota.filsys_id,
+##           id3 = quota.phys_id, id4 = quota.quota) {
+       if (type[0] == 'U' && id1 != 0 && !hash_lookup(users, id1))
          sq_save_data(sq1, id1);
+       else if (type[0] == 'G' && !hash_lookup(lists, id1))
+         sq_save_data(sq4, id1);
        else if (!(f = (struct filesys *) hash_lookup(filesys, id2)))
          sq_save_data(sq2, id2);
        else if (id3 != f->phys_id ||
@@ -858,6 +901,7 @@ phase2()
     generic_fix(sq1, show_quota_nouser, "Delete", fix_quota_nouser, 1);
     generic_fix(sq2, show_quota_nofs, "Delete", fix_quota_nofs, 0);
     generic_fix(sq3, show_quota_wrongpid, "Fix", fix_quota_physid, 1);
+    generic_fix(sq4, show_quota_nolist, "Delete", fix_quota_nolist, 1);
 
     dprintf("Not checking zephyr.\n");
 
index f31ee2ab9d71976ac06dc8f79e663a58badbf042..535a22a3be1cb2f1b8bad4a6340120539c053c10 100644 (file)
@@ -171,7 +171,7 @@ count_only_setup()
 ##  }
 
     dprintf("Counting quotas...\n");
-##  retrieve (id = nfsquota.phys_id, id2 = nfsquota.quota) {
+##  retrieve (id = quota.phys_id, id2 = quota.quota) {
         if (n = (struct nfsphys  *) hash_lookup(nfsphys, id)) {
            n->count += id2;
        }
This page took 0.038606 seconds and 5 git commands to generate.