[net.unix-wizards] Help with dbms audit/recovery

dan (02/17/83)

I am in the process of writing some audit/recovery routines for a data
base management system for a VAX running 4.1bsd.  In trying to
guarantee integrity of the data base over both program and system
crashes, I've found that I need two kernel-type primitives that are not
present in 4.1bsd.  Since I don't know how to make do without them, I'm
asking if anyone has such routines that they can send me, before I have
to (re-)invent the wheel.

What I need are the following:

    (1) byte-level file locking routines.  I need driver-level
	routines that allow a process to "lock" areas of files
	and be blocked if the areas are already locked.  It
	would be nice to have locks that allow multiple readers
	or a single writer, but I can do with just locks.

	Failing this, I could use a lock device in the style of
	the Ingres V7 lock device.  In fact, if I'm desperate
	enough, I may try to convert the one on the 4.1 tape.

    (2) file-sync primitive.  I need a primitive that causes
	all blocks in a specified file to be written to disk and
	DOES NOT RETURN until all the writes are complete.  Of
	course, this primitive also has to guarantee that all
	indirect blocks and the inode are also written.

	Since I am going to be doing the auditing on a separate
	file system partition (RL02 to start with, RA81 later),
	I can also use a primitive that syncs an entire file system,
	returning only when the writes are complete.

	In desperation, I may have to use a system-wide sync that
	doesn't return until the writes are complete, but I suspect
	this would really kill performance.

Please send responses via mail, rather than post it to news.  If anyone
is interested, I'll mail or post a summary of who has what.

	As they say, thanks in advance...

			    Dan Forsyth
			    Medical Systems Development Corporation
			    (404) 588-3368
			    (...decvax!duke!mcnc!msdc!dan)