• Dave Chinner's avatar
    xfs: add in-memory iunlink log item · 784eb7d8
    Dave Chinner authored
    Now that we have a clean operation to update the di_next_unlinked
    field of inode cluster buffers, we can easily defer this operation
    to transaction commit time so we can order the inode cluster buffer
    locking consistently.
    
    To do this, we introduce a new in-memory log item to track the
    unlinked list item modification that we are going to make. This
    follows the same observations as the in-memory double linked list
    used to track unlinked inodes in that the inodes on the list are
    pinned in memory and cannot go away, and hence we can simply
    reference them for the duration of the transaction without needing
    to take active references or pin them or look them up.
    
    This allows us to pass the xfs_inode to the transaction commit code
    along with the modification to be made, and then order the logged
    modifications via the ->iop_sort and ->iop_precommit operations
    for the new log item type. As this is an in-memory log item, it
    doesn't have formatting, CIL or AIL operational hooks - it exists
    purely to run the inode unlink modifications and is then removed
    from the transaction item list and freed once the precommit
    operation has run.
    Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    784eb7d8
xfs_iunlink_item.c 4.59 KB