[fa.info-vax] Invoking the overdraft...

root@ucbvax.UUCP (10/10/83)

From GEOFF5@SRI-CSL  Mon Oct 10 01:52:06 1983
Here's how overdraft works:
(assume you start under your permanent quota)
You do a $PUT that requires that the file be extended.  The ACP
checks and sees that you would exceed your permanent quota and
returns the error SS$_EXDISKQUOTA, but notes this fact in the
Window Control Block.  The next time it is called it checks
against permanent+overdraft because the overdraft flag is set
for that file.  In the "gray area" it returns the alternate
success code SS$_OVRDSKQUOTA.  RMS does NOT return this to the
user (the $PUT returns RMS$_NORMAL; STV contains the 2nd longword
of the IOSB).

How to use it:
If a $PUT fails with STS'STV = RMS$_EXT'SS$_EXDISKQUOTA retry the
$PUT.  If it succeeds you are now in the "gray area" (if not you
are past the overdraft).

High-level language experiment:
(I don't program in DEC PASCAL for "religious reasons" but I
understand that there is a PAS$RAB function that lets you play
similar games, which are left as an exercise to the reader.)

	Program OverDraft
C	Attempt to utilize disk overdraft from FORTRASH
	Integer*4 I
	Open (Unit=21,File='OUTFILE',CarriageControl='LIST',
     *	Status='NEW')
	Do 20 I=1,999
10		Format (I4,' The quick brown fox jumps over the lazy dog
     *''s back')
		Write (21,10,Err=25) I
20	Continue
	Stop
C	For some reason a WRITE has failed!
25	Call Check(%Val(For$RAB(21)),I)
	Go To 20
	End
C	This is what I have to put up with in a language that
C	doesn't have pointers...at least it doesn't type check
	Subroutine Check(RAB,I)
	Integer*4 RAB(0:*),I,Sys$Put
50	Format (' I=',I4,' STS=',Z8.8,' STV=',Z8.8)
	Type 50,I,RAB(2),RAB(3)
	If (.Not.Sys$Put(RAB)) Then
60		Format (' Retry: STS=',Z8.8,' STV=',Z8.8)
		Type 60,RAB(2),RAB(3)
		Stop
	End If
	End

Observations:
Something trashes STS'STV before CHECK gets called.  Other than
that it seems to work.

Conclusions:
You can't easily take advantage of overdrafts from high level
languages.  DEC should provide better support at the RMS level.

					-=EPS=-
------

root@ucbvax.UUCP (10/11/83)

>From GEOFF5@SRI-CSL  Tue Oct 11 00:28:02 1983
I implemented overdraft in FORTRAN much more simply.  Without looking at
the status codes, I try operations that cause errors twice.  If the
error can't be recovered (like exceeding the overdraft) you get one
useless try, but it handles the overdraft ok.  It sure was a pain tho...

I had to do something similar in a training system as part of power
failure recovery.  The recovery code was flawed & did not recover all
the time (thus the retry logic on errors).

  --Mark  (MHJohnson.F-15 @ HI-Multics)