Re: Loop Encryption

Andrew E. Mileski (aem@netcom.ca)
Sun, 1 Jun 1997 22:19:58 -0400 (EDT)


> > What's the difference between BH_Locked and BH_Protected?
>
> BH_Locked prevents anybody from accessing the buffer (if they call
> wait_on_buffer, that is). BH_Protected just prevents reuse of the
> buffer, and IMHO is a broken feature --- if you want to pin a buffer
> against reuse, the correct way should really be to increment b_count
> around the critical code.
>
> > Using BH_Protected seems to work for the loop driver - buffers for the
> > requests it creates cannot be freed until the loop driver is finished
> > with them [or so I'm led to believe by the ramdisk driver].
>
> If that's all you want, then use b_count instead. It has the
> advantage that two concurrent processes trying to pin the buffer in
> memory won't conflict with each other.

Thanks for the suggestion, but using b_count doesn't work in this case.
There must be something else that BH_Protected does <shrug>

--
Andrew E. Mileski   mailto:aem@netcom.ca
Linux Plug-and-Play Hardware Support http://www.redhat.com/linux-info/pnp/
XFree86 Matrox Team http://www.bf.rmit.edu.au/~ajv/xf86-matrox.html
Ottawa-Carleton Linux User's Group (OCLUG) http://www.storm.ca/~linux/