20.14 free (7000)

This procedure is called by “itrunc” (7435, 7438, 7442) to reinsert a simple storage block into the available list for a device.

7005:

It is not clear why the “s_fmod” flag is set here as well as at the end of the procedure (line 7026). Any suggestions?

7006:

Observe the locking protocol;

7010:

If no free blocks previously existed for the device, restore the situation by setting up a one element list containing an entry for block #0. This value will subsequently be interpreted as an “end of list” sentinel;

7014:

If the available list in the “super block” is already full, it is time to write it out onto the FSV. Set “s_flock”;

7016:

Get a buffer, associated with the block now being entered in the free list;

7019:

Copy the contents of the super block list, preceded by a count of the number of valid blocks, into the buffer; write the buffer; unset the lock and “wakeup” anybody waiting,

7025:

Add the returned block to the available list.