aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2018-06-04 20:29:09 -0400
committerDarrick J. Wong <darrick.wong@oracle.com>2018-06-04 21:25:05 -0400
commit89c2e71123badc1e75316ccd969ee8a5c6fd921a (patch)
tree380be5c7fcc8dd652dc8700ab58c6b0993c1f524
parentd2e736654247dcfe98e2b86fa2ee77fb36292144 (diff)
xfs: use xfs_trans_getsb in xfs_sync_sb_buf
Use xfs_trans_getsb rather than reaching right in for mp->m_sb_bp; I think this is more correct, and it facilitates building this libxfs code in userspace as well. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r--fs/xfs/libxfs/xfs_sb.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
index d485e14313c6..b5dca3c8c84d 100644
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -970,14 +970,16 @@ xfs_sync_sb_buf(
970 struct xfs_mount *mp) 970 struct xfs_mount *mp)
971{ 971{
972 struct xfs_trans *tp; 972 struct xfs_trans *tp;
973 struct xfs_buf *bp;
973 int error; 974 int error;
974 975
975 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_sb, 0, 0, 0, &tp); 976 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_sb, 0, 0, 0, &tp);
976 if (error) 977 if (error)
977 return error; 978 return error;
978 979
980 bp = xfs_trans_getsb(tp, mp, 0);
979 xfs_log_sb(tp); 981 xfs_log_sb(tp);
980 xfs_trans_bhold(tp, mp->m_sb_bp); 982 xfs_trans_bhold(tp, bp);
981 xfs_trans_set_sync(tp); 983 xfs_trans_set_sync(tp);
982 error = xfs_trans_commit(tp); 984 error = xfs_trans_commit(tp);
983 if (error) 985 if (error)
@@ -985,9 +987,9 @@ xfs_sync_sb_buf(
985 /* 987 /*
986 * write out the sb buffer to get the changes to disk 988 * write out the sb buffer to get the changes to disk
987 */ 989 */
988 error = xfs_bwrite(mp->m_sb_bp); 990 error = xfs_bwrite(bp);
989out: 991out:
990 xfs_buf_relse(mp->m_sb_bp); 992 xfs_buf_relse(bp);
991 return error; 993 return error;
992} 994}
993 995