On Monday, 23 August 1999 at 8:47:34 +0200, Poul-Henning Kamp wrote: > In message <19990823152849.h83...@freebie.lemis.com>, Greg Lehey writes: > >>> Why should it be made unavailable ? >> >> So that certain multiple accesses can be done atomically. > > You don't need that. You initialize a index to 0, and whenever the > sector with that index is written, you increment it. > > At any one time you know that all parityblocks <= your index > are valid.
Sure, that's pretty much what I do in the situation you're thinking about. But it won't work without locking. Take a look at vinumrevive.c and vinumrequest.c. My real question was more like "OK, I have a situation coming up in which I need to be able to lock out other processes. What tools are available for it". I don't know yet whether what I end up with can be solved by this method, but it's nice to know what tools you have. You certainly wouldn't want to lock out access to the entire device during this time. >> I'm a little surprised that there's any objection to the concept of >> mandatory locking. > > Too many of us have had wedged systems because of it I guess... Strange, I've probably used it more than anybody here, and I've never had a wedged system. Of course, you need to use it appropriately. 'rm' can be a lethal tool :-) Greg -- See complete headers for address, home page and phone numbers finger g...@lemis.com for PGP public key To Unsubscribe: send mail to majord...@freebsd.org with "unsubscribe freebsd-hackers" in the body of the message