&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
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",
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);
# 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
{
#
sub afs_quota_adj
{
- local($cell,$asrv,$apart,$adj) = @_;
+ local($cell,$asrv,$apart,$adj,$dusage) = @_;
local($found) = 0;
&afs_lock;
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";