• Allison Henderson's avatar
    xfs: Add delay ready attr set routines · 8f502a40
    Allison Henderson authored
    This patch modifies the attr set routines to be delay ready. This means
    they no longer roll or commit transactions, but instead return -EAGAIN
    to have the calling routine roll and refresh the transaction.  In this
    series, xfs_attr_set_args has become xfs_attr_set_iter, which uses a
    state machine like switch to keep track of where it was when EAGAIN was
    returned. See xfs_attr.h for a more detailed diagram of the states.
    
    Two new helper functions have been added: xfs_attr_rmtval_find_space and
    xfs_attr_rmtval_set_blk.  They provide a subset of logic similar to
    xfs_attr_rmtval_set, but they store the current block in the delay attr
    context to allow the caller to roll the transaction between allocations.
    This helps to simplify and consolidate code used by
    xfs_attr_leaf_addname and xfs_attr_node_addname. xfs_attr_set_args has
    now become a simple loop to refresh the transaction until the operation
    is completed.  Lastly, xfs_attr_rmtval_remove is no longer used, and is
    removed.
    Signed-off-by: default avatarAllison Henderson <allison.henderson@oracle.com>
    Reviewed-by: default avatarChandan Babu R <chandanrlinux@gmail.com>
    Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
    8f502a40
xfs_attr.h 18.9 KB