summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_trans_inode.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-08-28 10:21:03 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2017-09-01 10:55:30 -0700
commit411350df14a3d6f1c769ea64a8b43a71f8d9760e (patch)
tree6ce47a2df6894777f7147bbc4fee7fca6e9fcc34 /fs/xfs/xfs_trans_inode.c
parentf2e9ad212def50bcf4c098c6288779dd97fff0f0 (diff)
downloadlinux-411350df14a3d6f1c769ea64a8b43a71f8d9760e.tar.bz2
xfs: refactor xfs_trans_roll
Split xfs_trans_roll into a low-level helper that just rolls the actual transaction and a new higher level xfs_trans_roll_inode that takes care of logging and rejoining the inode. This gets rid of the NULL inode case, and allows to simplify the special cases in the deferred operation code. 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>
Diffstat (limited to 'fs/xfs/xfs_trans_inode.c')
-rw-r--r--fs/xfs/xfs_trans_inode.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c
index dab8daa676f9..daa7615497f9 100644
--- a/fs/xfs/xfs_trans_inode.c
+++ b/fs/xfs/xfs_trans_inode.c
@@ -134,3 +134,17 @@ xfs_trans_log_inode(
flags |= ip->i_itemp->ili_last_fields;
ip->i_itemp->ili_fields |= flags;
}
+
+int
+xfs_trans_roll_inode(
+ struct xfs_trans **tpp,
+ struct xfs_inode *ip)
+{
+ int error;
+
+ xfs_trans_log_inode(*tpp, ip, XFS_ILOG_CORE);
+ error = xfs_trans_roll(tpp);
+ if (!error)
+ xfs_trans_ijoin(*tpp, ip, 0);
+ return error;
+}