• Dave Chinner's avatar
    xfs: rework xfs_iflush_cluster() dirty inode iteration · 5717ea4d
    Dave Chinner authored
    Now that we have all the dirty inodes attached to the cluster
    buffer, we don't actually have to do radix tree lookups to find
    them. Sure, the radix tree is efficient, but walking a linked list
    of just the dirty inodes attached to the buffer is much better.
    
    We are also no longer dependent on having a locked inode passed into
    the function to determine where to start the lookup. This means we
    can drop it from the function call and treat all inodes the same.
    
    We also make xfs_iflush_cluster skip inodes marked with
    XFS_IRECLAIM. This we avoid races with inodes that reclaim is
    actively referencing or are being re-initialised by inode lookup. If
    they are actually dirty, they'll get written by a future cluster
    flush....
    
    We also add a shutdown check after obtaining the flush lock so that
    we catch inodes that are dirty in memory and may have inconsistent
    state due to the shutdown in progress. We abort these inodes
    directly and so they remove themselves directly from the buffer list
    and the AIL rather than having to wait for the buffer to be failed
    and callbacks run to be processed correctly.
    Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    5717ea4d
xfs_inode.c 105 KB