I'm developing a device mapper driver and was wondering about delays dues to performing disk initialization in the constructor context. There's a fair amount of IO to be done during some initial setup - ranges of blocks to clean out.
From looking over dm implementations it appears that this work is done synchronously in the constructor. That is the constructor shouldn't be allowed to return until this operation is done. I don't know if that's a good idea or whether there's a way to make it asynchronous until the init time work is done.
I was thinking that calls to 'map' might be deferred by returning DM_IO_REQUEUE until the operation completes. But that may be some seconds. I've not found any docs or reference that covers the function set of the target_type structure in dm. Just what I've seen of some dm drivers making use of some of these function indirects. Any hints on where there's details of the methods or rules on what can and can't be done in the constructor?