Skip to content
  • Dave Chinner's avatar
    xfs: avoid CIL allocation during insert · f5baac35
    Dave Chinner authored
    
    
    Now that we have the size of the log vector that has been allocated,
    we can determine if we need to allocate a new log vector for
    formatting and insertion. We only need to allocate a new vector if
    it won't fit into the existing buffer.
    
    However, we need to hold the CIL context lock while we do this so
    that we can't race with a push draining the currently queued log
    vectors. It is safe to do this as long as we do GFP_NOFS allocation
    to avoid avoid memory allocation recursing into the filesystem.
    Hence we can safely overwrite the existing log vector on the CIL if
    it is large enough to hold all the dirty regions of the current
    item.
    
    Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarMark Tinguely <tinguely@sgi.com>
    Signed-off-by: default avatarBen Myers <bpm@sgi.com>
    f5baac35