ip->i_d.di_flags |= XFS_DIFLAG_PREALLOC;
libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error)
+ fail(_("committing space for a file failed"), error);
}
static int
xname.type = XFS_DIR3_FT_REG_FILE;
newdirent(mp, tp, pip, &xname, ip->i_ino);
libxfs_trans_log_inode(tp, ip, flags);
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error)
+ fail(_("Space preallocation failed."), error);
rsvfile(mp, ip, llen);
IRELE(ip);
return;
}
newdirectory(mp, tp, ip, pip);
libxfs_trans_log_inode(tp, ip, flags);
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error)
+ fail(_("Directory inode allocation failed."), error);
/*
* RT initialization. Do this here to ensure that
* the RT inodes get placed after the root inode.
fail(_("Unknown format"), EINVAL);
}
libxfs_trans_log_inode(tp, ip, flags);
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error) {
+ fail(_("Error encountered creating file from prototype file"),
+ error);
+ }
IRELE(ip);
}
rsumip->i_d.di_size = mp->m_rsumsize;
libxfs_trans_log_inode(tp, rsumip, XFS_ILOG_CORE);
libxfs_log_sb(tp);
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error)
+ fail(_("Completion of the realtime summary inode failed"),
+ error);
mp->m_rsumip = rsumip;
/*
* Next, give the bitmap file some zero-filled blocks.
}
}
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error)
+ fail(_("Block allocation of the realtime bitmap inode failed"),
+ error);
/*
* Give the summary file some zero-filled blocks.
bno += ep->br_blockcount;
}
}
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error)
+ fail(_("Block allocation of the realtime summary inode failed"),
+ error);
/*
* Free the whole area using transactions.
fail(_("Error initializing the realtime space"),
error);
}
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error)
+ fail(_("Initialization of the realtime space failed"),
+ error);
}
}
* commit changes
*/
libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
- libxfs_trans_commit(tp);
+ 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
bno += ep->br_blockcount;
}
}
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error) {
+ do_error(
+ _("allocation of the realtime bitmap failed, error = %d\n"),
+ error);
+ }
IRELE(ip);
}
bno++;
}
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error)
+ do_error(_("%s: commit failed, error %d\n"), __func__, error);
IRELE(ip);
return(0);
}
bno++;
}
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error)
+ do_error(_("%s: commit failed, error %d\n"), __func__, error);
IRELE(ip);
return(0);
}
* commit changes
*/
libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
- libxfs_trans_commit(tp);
+ 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
bno += ep->br_blockcount;
}
}
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error) {
+ do_error(
+ _("allocation of the realtime summary ino failed, error = %d\n"),
+ error);
+ }
IRELE(ip);
}
ip->d_ops = mp->m_dir_inode_ops;
libxfs_dir_init(tp, ip, ip);
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error)
+ do_error(_("%s: commit failed, error %d\n"), __func__, error);
+
IRELE(ip);
irec = find_inode_rec(mp, XFS_INO_TO_AGNO(mp, mp->m_sb.sb_rootino),
libxfs_trans_log_inode(tp, pip, XFS_ILOG_CORE);
libxfs_dir_init(tp, ip, pip);
libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error) {
+ do_error(_("%s directory creation failed -- bmapf error %d\n"),
+ ORPHANAGE, error);
+ }
IRELE(ip);
IRELE(pip);
add_inode_reached(irec,ino_offset);
inc_nlink(VFS_I(ino_p));
libxfs_trans_log_inode(tp, ino_p, XFS_ILOG_CORE);
- libxfs_trans_commit(tp);
+ err = -libxfs_trans_commit(tp);
+ if (err)
+ do_error(
+ _("creation of .. entry failed (%d)\n"), err);
} else {
err = -libxfs_trans_alloc(mp, &M_RES(mp)->tr_rename,
nres, 0, 0, &tp);
err);
}
- libxfs_trans_commit(tp);
+ err = -libxfs_trans_commit(tp);
+ if (err)
+ do_error(
+ _("orphanage name replace op failed (%d)\n"), err);
}
} else {
set_nlink(VFS_I(ino_p), 1);
libxfs_trans_log_inode(tp, ino_p, XFS_ILOG_CORE);
- libxfs_trans_commit(tp);
+ err = -libxfs_trans_commit(tp);
+ if (err)
+ do_error(
+ _("orphanage name create failed (%d)\n"), err);
}
IRELE(ino_p);
IRELE(orphanage_ip);
goto out_bmap_cancel;
}
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error)
+ do_error(
+ _("dir init failed (%d)\n"), error);
if (ino == mp->m_sb.sb_rootino)
need_root_dotdot = 0;
goto out_bmap_cancel;
}
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error)
+ do_error(
+_("name create failed (%d) during rebuild\n"), error);
}
return;
if (error)
do_error(_("shrink_inode failed inode %" PRIu64 " block %u\n"),
ip->i_ino, da_bno);
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error)
+ do_error(
+_("directory shrink failed (%d)\n"), error);
}
/*
d, &i);
if (needlog)
libxfs_dir2_data_log_header(&da, bp);
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error)
+ do_error(
+_("directory block fixing failed (%d)\n"), error);
/* record the largest free space in the freetab for later checking */
bf = M_DIROPS(mp)->data_bestfree_p(d);
if (dirty) {
libxfs_trans_log_inode(tp, ip,
XFS_ILOG_CORE | XFS_ILOG_DDATA);
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error)
+ res_failed(error);
} else {
libxfs_trans_cancel(tp);
}
_("can't make \"..\" entry in root inode %" PRIu64 ", createname error %d\n"), ino, error);
libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error)
+ do_error(
+ _("root inode \"..\" entry recreation failed (%d)\n"), error);
need_root_dotdot = 0;
} else if (need_root_dotdot && ino == mp->m_sb.sb_rootino) {
ino, error);
libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
- libxfs_trans_commit(tp);
+ error = -libxfs_trans_commit(tp);
+ if (error)
+ do_error(
+ _("root inode \".\" entry recreation failed (%d)\n"), error);
}
}
IRELE(ip);