xfs_filblks_t datablocks;
xfs_filblks_t allocated_fsb;
xfs_filblks_t allocatesize_fsb;
- struct xfs_defer_ops free_list;
xfs_bmbt_irec_t *imapp;
xfs_bmbt_irec_t imaps[1];
int reccount;
}
xfs_trans_ijoin(tp, ip, 0);
- xfs_defer_init(NULL, &free_list);
error = xfs_bmapi_write(tp, ip, startoffset_fsb, allocatesize_fsb,
xfs_bmapi_flags, 0, imapp, &reccount);
/*
* Complete the transaction
*/
- error = xfs_defer_finish(&tp, &free_list);
- if (error)
- goto error0;
-
error = xfs_trans_commit(tp);
if (error)
break;
return error;
error0: /* Cancel bmap, cancel trans */
- xfs_defer_cancel(&free_list);
xfs_trans_cancel(tp);
return error;
}
int size, /* space new attribute needs */
int rsvd) /* xact may use reserved blks */
{
- struct xfs_defer_ops dfops; /* freed extent records */
xfs_mount_t *mp; /* mount structure */
xfs_trans_t *tp; /* transaction pointer */
int blks; /* space reservation */
rsvd ? XFS_TRANS_RESERVE : 0, &tp);
if (error)
return error;
- xfs_defer_init(tp, &dfops);
xfs_ilock(ip, XFS_ILOCK_EXCL);
error = xfs_trans_reserve_quota_nblks(tp, ip, blks, 0, rsvd ?
if (logflags)
xfs_trans_log_inode(tp, ip, logflags);
if (error)
- goto bmap_cancel;
+ goto trans_cancel;
if (!xfs_sb_version_hasattr(&mp->m_sb) ||
(!xfs_sb_version_hasattr2(&mp->m_sb) && version == 2)) {
bool log_sb = false;
xfs_log_sb(tp);
}
- error = xfs_defer_finish(&tp, &dfops);
- if (error)
- goto bmap_cancel;
error = xfs_trans_commit(tp);
xfs_iunlock(ip, XFS_ILOCK_EXCL);
return error;
-bmap_cancel:
- xfs_defer_cancel(&dfops);
trans_cancel:
xfs_trans_cancel(tp);
xfs_iunlock(ip, XFS_ILOCK_EXCL);
{
struct xfs_mount *mp = ip->i_mount;
struct xfs_trans *tp;
- struct xfs_defer_ops dfops;
int error;
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write,
XFS_DIOSTRAT_SPACE_RES(mp, 0), 0, 0, &tp);
if (error)
return error;
- xfs_defer_init(tp, &dfops);
xfs_ilock(ip, XFS_ILOCK_EXCL);
xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
if (error)
goto out;
- error = xfs_defer_finish(&tp, &dfops);
- if (error)
- goto out;
-
return xfs_trans_commit(tp);
out:
- xfs_defer_cancel(&dfops);
xfs_trans_cancel(tp);
return error;
}
struct list_head debris;
union xfs_btree_irec low;
union xfs_btree_irec high;
- struct xfs_defer_ops dfops;
xfs_fsblock_t fsb;
xfs_agblock_t agbno;
int error;
trace_xfs_refcount_recover_extent(mp, agno, &rr->rr_rrec);
/* Free the orphan record */
- xfs_defer_init(tp, &dfops);
agbno = rr->rr_rrec.rc_startblock - XFS_REFC_COW_START;
fsb = XFS_AGB_TO_FSB(mp, agno, agbno);
error = xfs_refcount_free_cow_extent(mp, tp->t_dfops, fsb,
rr->rr_rrec.rc_blockcount);
if (error)
- goto out_defer;
+ goto out_trans;
/* Free the block. */
xfs_bmap_add_free(mp, tp->t_dfops, fsb,
rr->rr_rrec.rc_blockcount, NULL);
- error = xfs_defer_finish(&tp, tp->t_dfops);
- if (error)
- goto out_defer;
-
error = xfs_trans_commit(tp);
if (error)
goto out_free;
}
return error;
-out_defer:
- xfs_defer_cancel(tp->t_dfops);
out_trans:
xfs_trans_cancel(tp);
out_free:
case IF_REGULAR:
buf = newregfile(pp, &len);
tp = getres(mp, XFS_B_TO_FSB(mp, len));
- libxfs_defer_init(tp, &dfops);
error = -libxfs_inode_alloc(&tp, pip, mode|S_IFREG, 1, 0,
&creds, fsxp, &ip);
if (error)
exit(1);
}
tp = getres(mp, XFS_B_TO_FSB(mp, llen));
- libxfs_defer_init(tp, &dfops);
error = -libxfs_inode_alloc(&tp, pip, mode|S_IFREG, 1, 0,
&creds, fsxp, &ip);
libxfs_trans_log_inode(tp, ip, flags);
libxfs_defer_ijoin(&dfops, ip);
- error = -libxfs_defer_finish(&tp, &dfops);
- if (error)
- fail(_("Pre-allocated file creation failed"), error);
libxfs_trans_commit(tp);
rsvfile(mp, ip, llen);
IRELE(ip);
case IF_BLOCK:
tp = getres(mp, 0);
- libxfs_defer_init(tp, &dfops);
majdev = getnum(getstr(pp), 0, 0, false);
mindev = getnum(getstr(pp), 0, 0, false);
error = -libxfs_inode_alloc(&tp, pip, mode|S_IFBLK, 1,
case IF_CHAR:
tp = getres(mp, 0);
- libxfs_defer_init(tp, &dfops);
majdev = getnum(getstr(pp), 0, 0, false);
mindev = getnum(getstr(pp), 0, 0, false);
error = -libxfs_inode_alloc(&tp, pip, mode|S_IFCHR, 1,
case IF_FIFO:
tp = getres(mp, 0);
- libxfs_defer_init(tp, &dfops);
error = -libxfs_inode_alloc(&tp, pip, mode|S_IFIFO, 1, 0,
&creds, fsxp, &ip);
if (error)
buf = getstr(pp);
len = (int)strlen(buf);
tp = getres(mp, XFS_B_TO_FSB(mp, len));
- libxfs_defer_init(tp, &dfops);
error = -libxfs_inode_alloc(&tp, pip, mode|S_IFLNK, 1, 0,
&creds, fsxp, &ip);
if (error)
break;
case IF_DIRECTORY:
tp = getres(mp, 0);
- libxfs_defer_init(tp, &dfops);
error = -libxfs_inode_alloc(&tp, pip, mode|S_IFDIR, 1, 0,
&creds, fsxp, &ip);
if (error)
newdirectory(mp, tp, ip, pip);
libxfs_trans_log_inode(tp, ip, flags);
libxfs_defer_ijoin(&dfops, ip);
- error = -libxfs_defer_finish(&tp, &dfops);
- if (error)
- fail(_("Directory creation failed"), error);
libxfs_trans_commit(tp);
/*
* RT initialization. Do this here to ensure that
}
libxfs_trans_log_inode(tp, ip, flags);
libxfs_defer_ijoin(&dfops, ip);
- error = -libxfs_defer_finish(&tp, &dfops);
- if (error) {
- fail(_("Error encountered creating file from prototype file"),
- error);
- }
libxfs_trans_commit(tp);
IRELE(ip);
}
libxfs_trans_ijoin(tp, rbmip, 0);
bno = 0;
- libxfs_defer_init(tp, &dfops);
while (bno < mp->m_sb.sb_rbmblocks) {
nmap = XFS_BMAP_MAX_NMAP;
error = -libxfs_bmapi_write(tp, rbmip, bno,
}
libxfs_defer_ijoin(&dfops, rbmip);
- error = -libxfs_defer_finish(&tp, &dfops);
- if (error) {
- fail(_("Completion of the realtime bitmap failed"), error);
- }
libxfs_trans_commit(tp);
/*
res_failed(i);
libxfs_trans_ijoin(tp, rsumip, 0);
bno = 0;
- libxfs_defer_init(tp, &dfops);
while (bno < nsumblocks) {
nmap = XFS_BMAP_MAX_NMAP;
error = -libxfs_bmapi_write(tp, rsumip, bno,
}
}
libxfs_defer_ijoin(&dfops, rsumip);
- error = -libxfs_defer_finish(&tp, &dfops);
- if (error) {
- fail(_("Completion of the realtime summary failed"), error);
- }
libxfs_trans_commit(tp);
/*
if (i)
res_failed(i);
libxfs_trans_ijoin(tp, rbmip, 0);
- libxfs_defer_init(tp, &dfops);
ebno = XFS_RTMIN(mp->m_sb.sb_rextents,
bno + NBBY * mp->m_sb.sb_blocksize);
error = -libxfs_rtfree_extent(tp, bno, (xfs_extlen_t)(ebno-bno));
error);
}
libxfs_defer_ijoin(&dfops, rbmip);
- error = -libxfs_defer_finish(&tp, &dfops);
- if (error) {
- fail(_("Error completing the realtime space"), error);
- }
libxfs_trans_commit(tp);
}
}
libxfs_trans_ijoin(tp, ip, 0);
bno = 0;
- libxfs_defer_init(tp, &dfops);
while (bno < mp->m_sb.sb_rbmblocks) {
nmap = XFS_BMAP_MAX_NMAP;
error = -libxfs_bmapi_write(tp, ip, bno,
}
}
libxfs_defer_ijoin(&dfops, ip);
- error = -libxfs_defer_finish(&tp, &dfops);
- if (error) {
- do_error(
- _("allocation of the realtime bitmap failed, error = %d\n"),
- error);
- }
libxfs_trans_commit(tp);
IRELE(ip);
}
libxfs_trans_ijoin(tp, ip, 0);
bno = 0;
- libxfs_defer_init(tp, &dfops);
while (bno < nsumblocks) {
nmap = XFS_BMAP_MAX_NMAP;
error = -libxfs_bmapi_write(tp, ip, bno,
}
}
libxfs_defer_ijoin(&dfops, ip);
- error = -libxfs_defer_finish(&tp, &dfops);
- if (error) {
- do_error(
- _("allocation of the realtime summary ino failed, error = %d\n"),
- error);
- }
libxfs_trans_commit(tp);
IRELE(ip);
}
i = -libxfs_trans_alloc(mp, &M_RES(mp)->tr_mkdir, nres, 0, 0, &tp);
if (i)
res_failed(i);
- libxfs_defer_init(tp, &dfops);
/*
* use iget/ijoin instead of trans_iget because the ialloc
libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
libxfs_defer_ijoin(&dfops, ip);
- error = -libxfs_defer_finish(&tp, &dfops);
- if (error) {
- do_error(_("%s directory creation failed -- bmapf error %d\n"),
- ORPHANAGE, error);
- }
-
-
libxfs_trans_commit(tp);
IRELE(ip);
IRELE(pip);
libxfs_trans_ijoin(tp, orphanage_ip, 0);
libxfs_trans_ijoin(tp, ino_p, 0);
- libxfs_defer_init(tp, &dfops);
err = -libxfs_dir_createname(tp, orphanage_ip, &xname,
ino, nres);
if (err)
libxfs_trans_log_inode(tp, ino_p, XFS_ILOG_CORE);
libxfs_defer_ijoin(&dfops, ino_p);
- err = -libxfs_defer_finish(&tp, &dfops);
- if (err)
- do_error(
- _("bmap finish failed (err - %d), filesystem may be out of space\n"),
- err);
-
libxfs_trans_commit(tp);
} else {
err = -libxfs_trans_alloc(mp, &M_RES(mp)->tr_rename,
libxfs_trans_ijoin(tp, orphanage_ip, 0);
libxfs_trans_ijoin(tp, ino_p, 0);
- libxfs_defer_init(tp, &dfops);
err = -libxfs_dir_createname(tp, orphanage_ip, &xname,
ino, nres);
}
libxfs_defer_ijoin(&dfops, ino_p);
- err = -libxfs_defer_finish(&tp, &dfops);
- if (err)
- do_error(
- _("bmap finish failed (%d), filesystem may be out of space\n"),
- err);
-
libxfs_trans_commit(tp);
}
libxfs_trans_ijoin(tp, orphanage_ip, 0);
libxfs_trans_ijoin(tp, ino_p, 0);
- libxfs_defer_init(tp, &dfops);
err = -libxfs_dir_createname(tp, orphanage_ip, &xname, ino,
nres);
if (err)
libxfs_trans_log_inode(tp, ino_p, XFS_ILOG_CORE);
libxfs_defer_ijoin(&dfops, ino_p);
- err = -libxfs_defer_finish(&tp, &dfops);
- if (err)
- do_error(
- _("bmap finish failed (%d), filesystem may be out of space\n"),
- err);
-
libxfs_trans_commit(tp);
}
IRELE(ino_p);
libxfs_dir_ino_validate(mp, pip.i_ino))
pip.i_ino = mp->m_sb.sb_rootino;
- libxfs_defer_init(NULL, &dfops);
-
nres = XFS_REMOVE_SPACE_RES(mp);
error = -libxfs_trans_alloc(mp, &M_RES(mp)->tr_remove, nres, 0, 0, &tp);
if (error)
}
libxfs_defer_ijoin(&dfops, ip);
- error = -libxfs_defer_finish(&tp, &dfops);
-
libxfs_trans_commit(tp);
if (ino == mp->m_sb.sb_rootino)
libxfs_trans_ijoin(tp, ip, 0);
- libxfs_defer_init(tp, &dfops);
error = -libxfs_dir_createname(tp, ip, &p->name, p->inum,
nres);
if (error) {
}
libxfs_defer_ijoin(&dfops, ip);
- error = -libxfs_defer_finish(&tp, &dfops);
- if (error) {
- do_warn(
- _("bmap finish failed (%d), filesystem may be out of space\n"),
- error);
- goto out_bmap_cancel;
- }
-
libxfs_trans_commit(tp);
}
return;
out_bmap_cancel:
- libxfs_defer_cancel(&dfops);
libxfs_trans_cancel(tp);
return;
}
libxfs_trans_ijoin(tp, ip, 0);
libxfs_trans_bjoin(tp, bp);
memset(&args, 0, sizeof(args));
- libxfs_defer_init(tp, &dfops);
args.dp = ip;
args.trans = tp;
args.whichfork = XFS_DATA_FORK;
do_error(_("shrink_inode failed inode %" PRIu64 " block %u\n"),
ip->i_ino, da_bno);
libxfs_defer_ijoin(&dfops, ip);
- libxfs_defer_finish(&tp, &dfops);
libxfs_trans_commit(tp);
}
libxfs_trans_ijoin(tp, ip, 0);
libxfs_trans_bjoin(tp, bp);
libxfs_trans_bhold(tp, bp);
- libxfs_defer_init(tp, &dfops);
if (be32_to_cpu(d->magic) != wantmagic) {
do_warn(
_("bad directory block magic # %#x for directory inode %" PRIu64 " block %d: "),
if (needlog)
libxfs_dir2_data_log_header(&da, bp);
libxfs_defer_ijoin(&dfops, ip);
- libxfs_defer_finish(&tp, &dfops);
libxfs_trans_commit(tp);
/* record the largest free space in the freetab for later checking */
libxfs_trans_ijoin(tp, ip, 0);
- libxfs_defer_init(tp, &dfops);
-
error = -libxfs_dir_createname(tp, ip, &xfs_name_dotdot,
ip->i_ino, nres);
if (error)
libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
libxfs_defer_ijoin(&dfops, ip);
- error = -libxfs_defer_finish(&tp, &dfops);
- ASSERT(error == 0);
libxfs_trans_commit(tp);
need_root_dotdot = 0;
libxfs_trans_ijoin(tp, ip, 0);
- libxfs_defer_init(tp, &dfops);
-
error = -libxfs_dir_createname(tp, ip, &xfs_name_dot,
ip->i_ino, nres);
if (error)
libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
libxfs_defer_ijoin(&dfops, ip);
- error = -libxfs_defer_finish(&tp, &dfops);
- ASSERT(error == 0);
libxfs_trans_commit(tp);
}
}