Skip to content
  • Mike Snitzer's avatar
    block: make bio_inc_remaining() interface accessible again · 0ef5a50c
    Mike Snitzer authored
    Commit 326e1dbb
    
     ("block: remove management of bi_remaining when
    restoring original bi_end_io") made bio_inc_remaining() private to bio.c
    because the only use-case that made sense was confined to the
    bio_chain() interface.
    
    Since that time DM thinp went on to use bio_chain() in its relatively
    complex implementation of async discard support.  That implementation,
    even when converted over to use the new async __blkdev_issue_discard()
    interface, depends on deferred completion of the original discard bio --
    which is most appropriately implemented using bio_inc_remaining().
    
    DM thinp foolishly duplicated bio_inc_remaining(), local to dm-thin.c as
    __bio_inc_remaining(), so re-exporting bio_inc_remaining() allows us to
    put an end to that foolishness.
    
    All said, bio_inc_remaining() should really only be used in conjunction
    with bio_chain().  It isn't intended for generic bio reference counting.
    
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    Acked-by: default avatarJoe Thornber <ejt@redhat.com>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    0ef5a50c