20.9 update (7201)

The function of this procedure, in its broadest terms, is to ensure that information on the file system volumes is kept up to date. The comment for this procedure (beginning on line 7190) describes the three main sub-functions, (in the reverse order!).

“update” is the whole business of the “sync” system call (3486). This may be invoked via the “sync” shell command. Alternatively there is a standard system program which runs continuously and whose only function is to call “sync” every 30 seconds. (See “UPDATE(VIII)” in the UPM.)

“update” is called by “sumount” (6150) before a file system volume is unmounted, and by “panic” (2420) as the last action of the system before activity ceases.

7207:

If another execution of “update” is under way, then just return;

7210:

Search the “mount” table;

7211:

For each mounted volume, ...

7213:

Unless the file system has not been recently modified or the “super block” is locked or the volume has been mounted “read only” ...

7217:

Update the “super block”, copy it into a buffer and write the buffer out onto the volume;

7223:

Search the “inode” table, and for each non-null entry, lock the entry and call “iupdat” to update the “inode” entry on the volume if appropriate;

7229:

Allow additional executions of “update” to commence;

7230:

“bflush” (5229) forces out any “delayed write” blocks.