[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [dm-devel] questions about device-mappers XXXX-map funtion()

On Sunday 07 September 2003 06:31, Jon Bendtsen wrote:
> Me and a friend are trying to built encryption into LVM2, and are
> currently in the process of making a dm-crypt mapping target.
> (it is also a university project).
> We copy a bio, not cloning. After this we encrypt the data in the bio,
> bio_data(), and use submit_bio() to store it at the disk. But the
> original bio are still written to disk, so we are looking for a way
> to cancel the writing of this original bio?


What is your map function returning? If you return 1, then DM will assume you 
simply adjusted the bi_sector and bi_dev fields, and it will continue 
submitting the request to the lower-level device. If you return 0, DM assumes 
your target module is taking ownership of the bio, and does not perform any 
additional processing on that bio. In this case your code will be responsible 
for either submitting that bio, or eventually calling bio_endio() on the bio.

For an example of how this works, see dm-snapshot.c in the 2.4-kernel-version 
of DM.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]