• Brian Foster's avatar
    xfs: replace xfs_defer_ops ->dop_pending with on-stack list · 1ae093cb
    Brian Foster authored
    The xfs_defer_ops ->dop_pending list is used to track active
    deferred operations once intents are logged. These items must be
    aborted in the event of an error. The list is populated as intents
    are logged and items are removed as they complete (or are aborted).
    
    Now that xfs_defer_finish() cancels on error, there is no need to
    ever access ->dop_pending outside of xfs_defer_finish(). The list is
    only ever populated after xfs_defer_finish() begins and is either
    completed or cancelled before it returns.
    
    Remove ->dop_pending from xfs_defer_ops and replace it with a local
    list in the xfs_defer_finish() path. Pass the local list to the
    various helpers now that it is not accessible via dfops. Note that
    we have to check for NULL in the abort case as the final tx roll
    occurs outside of the scope of the new local list (once the dfops
    has completed and thus drained the list).
    Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    1ae093cb
xfs_defer.c 17.6 KB