• T
    blk-throttle: implement sq_to_tg(), sq_to_td() and throtl_log() · fda6f272
    Tejun Heo 提交于
    Now that both throtl_data and throtl_grp embed throtl_service_queue,
    we can unify throtl_log() and throtl_log_tg().
    
    * sq_to_tg() is added.  This returns the throtl_grp a service_queue is
      embedded in.  If the service_queue is the top-level one embedded in
      throtl_data, NULL is returned.
    
    * sq_to_td() is added.  A service_queue is always associated with a
      throtl_data.  This function finds the associated td and returns it.
    
    * throtl_log() is updated to take throtl_service_queue instead of
      throtl_data.  If the service_queue is one embedded in throtl_grp, it
      prints the same header as throtl_log_tg() did.  If it's one embedded
      in throtl_data, it behaves the same as before.  This renders
      throtl_log_tg() unnecessary.  Removed.
    
    This change is necessary for hierarchy support as we're gonna be using
    the same code paths to dispatch bios to intermediate service_queues
    embedded in throtl_grps and the top-level service_queue embedded in
    throtl_data.
    
    This patch doesn't make any behavior changes.
    
    v2: throtl_log() didn't print a space after blkg path.  Updated so
        that it prints a space after throtl_grp path.  Spotted by Vivek.
    Signed-off-by: NTejun Heo <tj@kernel.org>
    Acked-by: NVivek Goyal <vgoyal@redhat.com>
    fda6f272
blk-throttle.c 32.3 KB