Reduce duplicate Attach() calls in bdev
Currently, the 'public' functions of bdev (FindDevice and AttachOrAssemble) will call the Attach() method right after class instantiation. But the constructor itself calls this function, and therefore we have duplicate Attach() calls (which are not cheap at all). The patch introduces a new 'attached' instance attribute that tells if the last Attach() was successful. The public functions reuse this so that we only do the minimum required number of calls. Reviewed-by: imsnah
Loading
Please register or sign in to comment