error = -libxfs_trans_commit(tp);
if (error)
do_error(_("%s: commit failed, error %d\n"), __func__, error);
-
- /*
- * then allocate blocks for file and fill with zeroes (stolen
- * from mkfs)
- */
- if (mp->m_sb.sb_rbmblocks) {
- error = -libxfs_alloc_file_space(ip, 0,
- mp->m_sb.sb_rbmblocks << mp->m_sb.sb_blocklog,
- XFS_BMAPI_ZERO);
- if (error) {
- do_error(
- _("allocation of the realtime bitmap failed, error = %d\n"),
- error);
- }
- }
libxfs_irele(ip);
}
error = -libxfs_trans_commit(tp);
if (error)
do_error(_("%s: commit failed, error %d\n"), __func__, error);
-
- /*
- * then allocate blocks for file and fill with zeroes (stolen
- * from mkfs)
- */
- if (mp->m_rsumsize) {
- error = -libxfs_alloc_file_space(ip, 0, mp->m_rsumsize,
- XFS_BMAPI_ZERO);
- if (error) {
- do_error(
- _("allocation of the realtime summary ino failed, error = %d\n"),
- error);
- }
- }
libxfs_irele(ip);
}
if (!end_bno)
return;
- error = -libxfs_trans_alloc_rollable(mp, 10, &tp);
+ error = -libxfs_trans_alloc_empty(mp, &tp);
if (error)
- do_error(_("xfs_trans_reserve returned %d\n"), error);
-
+ do_error(_("xfs_trans_alloc_empty returned %d\n"), error);
error = -libxfs_iget(mp, tp, ino, 0, &ip);
+ libxfs_trans_cancel(tp);
if (error) {
do_error(
_("couldn't iget realtime %s inode -- error - %d\n"),
name, error);
}
+ error = -libxfs_alloc_file_space(ip, 0, XFS_FSB_TO_B(mp, end_bno), 0);
+ if (error)
+ do_error(
+ _("allocation of the realtime %s inode failed, error - %d\n"),
+ name, error);
+
+ error = -libxfs_trans_alloc_rollable(mp, 10, &tp);
+ if (error)
+ do_error(_("xfs_trans_reserve returned %d\n"), error);
libxfs_trans_ijoin(tp, ip, 0);
+
while (bno < end_bno) {
struct xfs_buf *bp;
struct xfs_bmbt_irec map;