xfs: remove xfs_trans_ail_delete_bulk
xfs_iflush_done uses an on-stack variable length array to pass the log items to be deleted to xfs_trans_ail_delete_bulk. On-stack VLAs are a nasty gcc extension that can lead to unbounded stack allocations, but fortunately we can easily avoid them by simply open coding xfs_trans_ail_delete_bulk in xfs_iflush_done, which is the only caller of it except for the single-item xfs_trans_ail_delete. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:

committed by
Darrick J. Wong

parent
3f88a15ae0
commit
27af1bbf52
@@ -731,22 +731,27 @@ xfs_iflush_done(
|
||||
* holding the lock before removing the inode from the AIL.
|
||||
*/
|
||||
if (need_ail) {
|
||||
struct xfs_log_item *log_items[need_ail];
|
||||
int i = 0;
|
||||
bool mlip_changed = false;
|
||||
|
||||
/* this is an opencoded batch version of xfs_trans_ail_delete */
|
||||
spin_lock(&ailp->xa_lock);
|
||||
for (blip = lip; blip; blip = blip->li_bio_list) {
|
||||
iip = INODE_ITEM(blip);
|
||||
if (iip->ili_logged &&
|
||||
blip->li_lsn == iip->ili_flush_lsn) {
|
||||
log_items[i++] = blip;
|
||||
}
|
||||
ASSERT(i <= need_ail);
|
||||
if (INODE_ITEM(blip)->ili_logged &&
|
||||
blip->li_lsn == INODE_ITEM(blip)->ili_flush_lsn)
|
||||
mlip_changed |= xfs_ail_delete_one(ailp, blip);
|
||||
}
|
||||
/* xfs_trans_ail_delete_bulk() drops the AIL lock. */
|
||||
xfs_trans_ail_delete_bulk(ailp, log_items, i,
|
||||
SHUTDOWN_CORRUPT_INCORE);
|
||||
}
|
||||
|
||||
if (mlip_changed) {
|
||||
if (!XFS_FORCED_SHUTDOWN(ailp->xa_mount))
|
||||
xlog_assign_tail_lsn_locked(ailp->xa_mount);
|
||||
if (list_empty(&ailp->xa_ail))
|
||||
wake_up_all(&ailp->xa_empty);
|
||||
}
|
||||
spin_unlock(&ailp->xa_lock);
|
||||
|
||||
if (mlip_changed)
|
||||
xfs_log_space_wake(ailp->xa_mount);
|
||||
}
|
||||
|
||||
/*
|
||||
* clean up and unlock the flush lock now we are done. We can clear the
|
||||
|
Reference in New Issue
Block a user