/* Used to log changes to the superblock unit and width fields which could be altered by the mount options, as well as any potential sb_features2 fixup. Only the first superblock is updated.  */
int xfs_mount_log_sb(xfs_mount_t *mp, __int64_t fields)
/* Used to log changes to the superblock unit and width fields which could be altered by the mount options, as well as any potential sb_features2 fixup. Only the first superblock is updated.  */
int xfs_mount_log_sb(xfs_mount_t *mp, __int64_t fields)
{
	xfs_trans_t	*tp;
	int		error;
	ASSERT(fields & (XFS_SB_UNIT | XFS_SB_WIDTH | XFS_SB_UUID |
			 XFS_SB_FEATURES2 | XFS_SB_BAD_FEATURES2 |
			 XFS_SB_VERSIONNUM));
	tp = xfs_trans_alloc(mp, XFS_TRANS_SB_UNIT);
	error = xfs_trans_reserve(tp, 0, mp->m_sb.sb_sectsize + 128, 0, 0,
				XFS_DEFAULT_LOG_COUNT);
	if (error) {
		xfs_trans_cancel(tp, 0);
		return error;
	}
	xfs_mod_sb(tp, fields);
	error = xfs_trans_commit(tp, 0);
	return error;
}