summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2020-06-29 14:49:18 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2020-07-07 07:15:08 -0700
commit48d55e2ae3ce837598c073995bbbac5d24a35fe1 (patch)
treeb5d1923900858dd3e77b725bae8d4a0f666fcc5f /fs/xfs/libxfs
parent71e3e35646861f2f9b8d36e00720904ed3ca31cb (diff)
xfs: attach inodes to the cluster buffer when dirtied
Rather than attach inodes to the cluster buffer just when we are doing IO, attach the inodes to the cluster buffer when they are dirtied. The means the buffer always carries a list of dirty inodes that reference it, and we can use that list to make more fundamental changes to inode writeback that aren't otherwise possible. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs')
-rw-r--r--fs/xfs/libxfs/xfs_trans_inode.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/xfs/libxfs/xfs_trans_inode.c b/fs/xfs/libxfs/xfs_trans_inode.c
index ad5974365c58..e15129647e00 100644
--- a/fs/xfs/libxfs/xfs_trans_inode.c
+++ b/fs/xfs/libxfs/xfs_trans_inode.c
@@ -163,13 +163,16 @@ xfs_trans_log_inode(
/*
* We need an explicit buffer reference for the log item but
* don't want the buffer to remain attached to the transaction.
- * Hold the buffer but release the transaction reference.
+ * Hold the buffer but release the transaction reference once
+ * we've attached the inode log item to the buffer log item
+ * list.
*/
xfs_buf_hold(bp);
- xfs_trans_brelse(tp, bp);
-
spin_lock(&iip->ili_lock);
iip->ili_item.li_buf = bp;
+ bp->b_flags |= _XBF_INODES;
+ list_add_tail(&iip->ili_item.li_bio_list, &bp->b_li_list);
+ xfs_trans_brelse(tp, bp);
}
/*