• Jakub Kicinski's avatar
    devlink: convert remaining dumps to the by-instance scheme · 5ce76d78
    Jakub Kicinski authored
    Soon we'll have to check if a devlink instance is alive after
    locking it. Convert to the by-instance dumping scheme to make
    refactoring easier.
    
    Most of the subobject code no longer has to worry about any devlink
    locking / lifetime rules (the only ones that still do are the two subject
    types which stubbornly use their own locking). Both dump and do callbacks
    are given a devlink instance which is already locked and good-to-access
    (do from the .pre_doit handler, dump from the new dump indirection).
    
    Note that we'll now check presence of an op (e.g. for sb_pool_get)
    under the devlink instance lock, that will soon be necessary anyway,
    because we don't hold refs on the driver modules so the memory
    in which ops live may be gone for a dead instance, after upcoming
    locking changes.
    Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    5ce76d78
leftover.c 318 KB