]> andersk Git - moira.git/commitdiff
Added an extra argument to the afs_quota_adj()... disk usage.
authorprobe <probe>
Wed, 2 Nov 1994 11:28:10 +0000 (11:28 +0000)
committerprobe <probe>
Wed, 2 Nov 1994 11:28:10 +0000 (11:28 +0000)
This allows the calling routine to update the current disk usage on the
given partition, if it has it available (or passes 0 if it doesn't).

incremental/afs_create.pl
incremental/afs_quota.pl
incremental/afs_utils.pl

index 1d104f61d9cf651c561af104ae5248203b29e913..807d2b93eb7d0c9f3871603132af7e0a573218ae 100644 (file)
@@ -71,7 +71,8 @@ if ($tmp[$#tmp] !~ /user\../) {
        &fatal("Can't release $tmp[$#tmp] in cell $cell");
 }
 
-&afs_quota_adj($cell,$asrv,$apart,$quota);
+# Update the quota records.
+&afs_quota_adj($cell,$asrv,$apart,$quota,0);
 exit(0);
 
 sub fatal
index 444a932f473984d79a89c387425cc3084f292221..2f09801c02121c90bde558e1497c8ddbb7d8a18a 100644 (file)
@@ -52,7 +52,7 @@ $dusage = $dtotal - $tmp[5];
 system("$fs","sq",$path,$newq);
 die "Unable to change quota on $path\n" if ($?);
 
-&afs_quota_adj($cell,$asrv,$apart,$newq-$oldq);
+&afs_quota_adj($cell,$asrv,$apart,$newq-$oldq,$dusage);
 
 if ($dusage > (0.9 * $dtotal)) {
     system("$zwrite","-q","-n","-c","afsadm","-m",
@@ -70,8 +70,3 @@ elsif ($newq-$oldq > 39999) {
     system("$zwrite","-q","-n","-c","afsadm","-m",
           "Increased quota on volume $vname ($asrv:$apart) from $oldq to $newq");
 }
-
-#$stat_fs = $?;
-#$stat_qa = &afs_quota_adj($cell,$asrv,$apart,($stat_fs ? 0 : $newq-$oldq));
-#die "Unable to change quota on $path\n" if ($stat_fs && $stat_qa);
-#warn "Unable to change quota on $path\n" if ($stat_fs);
index 183b491b55ecfc130a58c85aa22a6504004fa88a..06cbecb0fcac06f28a0cb95c26928ee41fe1492a 100644 (file)
@@ -68,8 +68,8 @@ sub afs_unlock
 #    max[ (2*free space) - (unused quota) ]
 #    = max(2*total - usage - alloc)
 #
-# Note: This routine does not actually adjust the quota; the caller
-# should use afs_quota_adj();
+# Note: This routine does not actually adjust the quota;
+# the calling routine should use afs_quota_adj();
 
 sub afs_find
 {
@@ -101,7 +101,7 @@ sub afs_find
 #
 sub afs_quota_adj
 {
-    local($cell,$asrv,$apart,$adj) = @_;
+    local($cell,$asrv,$apart,$adj,$dusage) = @_;
     local($found) = 0;
 
     &afs_lock;
@@ -110,8 +110,9 @@ sub afs_quota_adj
     for (@afs_data) {
        local ($c, $as, $ap, $t, $total, $used, $alloc) = split(/\s+/,$_);
        if ($c eq $cell && $as eq $asrv && $ap eq $apart) {
+           $dusage = $used unless ($dusage);
            $alloc += $adj;
-           $_ = join(' ',$c,$asrv,$apart,$t,$total,$used,$alloc);
+           $_ = join(' ',$c,$asrv,$apart,$t,$total,$dusage,$alloc);
            $found = 1;
        }
        print SRV "$_\n";
This page took 0.05231 seconds and 5 git commands to generate.