Product SiteDocumentation Site

9.16. Creating Transactions

A transaction is typically coded as
Create the incore structure for the transaction
tp = xfs_trans_alloc(type);
Reserve space for the transaction, quick lookup in mount_t structure
error = xfs_trans_reserve(tp, data, log, rt, ...);
Now make changes, allocate space, free space, etc.
Attach superblock/inode(s)/buffers etc, log ranges within these objects, typically via
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
Commit the transaction, copying data from that attached objects
error = xfs_trans_commit(tp);