• Tejun Heo's avatar
    block: refactor get_request[_wait]() · a06e05e6
    Tejun Heo authored
    Currently, there are two request allocation functions - get_request()
    and get_request_wait().  The former tries to allocate a request once
    and the latter keeps retrying until it succeeds.  The latter wraps the
    former and keeps retrying until allocation succeeds.
    
    The combination of two functions deliver fallible non-wait allocation,
    fallible wait allocation and unfailing wait allocation.  However,
    given that forward progress is guaranteed, fallible wait allocation
    isn't all that useful and in fact nobody uses it.
    
    This patch simplifies the interface as follows.
    
    * get_request() is renamed to __get_request() and is only used by the
      wrapper function.
    
    * get_request_wait() is renamed to get_request().  It now takes
      @gfp_mask and retries iff it contains %__GFP_WAIT.
    
    This patch doesn't introduce any functional change and is to prepare
    for further updates to request allocation path.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Acked-by: default avatarVivek Goyal <vgoyal@redhat.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    a06e05e6
blk-core.c 80.1 KB