xfs_defer_init(NULL, &free_list, &firstfsb);
error = xfs_bmapi_write(tp, ip, startoffset_fsb, allocatesize_fsb,
- xfs_bmapi_flags, &firstfsb, 0, imapp, &reccount);
+ xfs_bmapi_flags, 0, imapp, &reccount);
if (error)
goto error0;
&args->trans->t_firstblock);
nmap = 1;
error = xfs_bmapi_write(args->trans, dp, (xfs_fileoff_t)lblkno,
- blkcnt, XFS_BMAPI_ATTRFORK,
- &args->trans->t_firstblock, args->total, &map,
+ blkcnt, XFS_BMAPI_ATTRFORK, args->total, &map,
&nmap);
if (error)
goto out_defer_cancel;
* extent state if necessary. Details behaviour is controlled by the flags
* parameter. Only allocates blocks from a single allocation group, to avoid
* locking problems.
- *
- * The returned value in "firstblock" from the first call in a transaction
- * must be remembered and presented to subsequent calls in "firstblock".
- * An upper bound for the number of blocks to be allocated is supplied to
- * the first call in "total"; if no allocation group has that many free
- * blocks then the call will fail (return NULLFSBLOCK in "firstblock").
*/
int
xfs_bmapi_write(
xfs_fileoff_t bno, /* starting file offs. mapped */
xfs_filblks_t len, /* length to map in file */
int flags, /* XFS_BMAPI_... */
- xfs_fsblock_t *firstblock, /* first allocated block
- controls a.g. for allocs */
xfs_extlen_t total, /* total blocks needed */
struct xfs_bmbt_irec *mval, /* output: map values */
int *nmap) /* i/o: mval size/count */
XFS_STATS_INC(mp, xs_blk_mapw);
- if (!tp || *firstblock == NULLFSBLOCK) {
+ if (!tp || tp->t_firstblock == NULLFSBLOCK) {
if (XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE)
bma.minleft = be16_to_cpu(ifp->if_broot->bb_level) + 1;
else
bma.ip = ip;
bma.total = total;
bma.datatype = 0;
- bma.firstblock = firstblock;
+ bma.firstblock = &tp->t_firstblock;
ASSERT(!tp || tp->t_dfops);
while (bno < end && n < *nmap) {
if (bma.cur) {
if (!error) {
- ASSERT(*firstblock == NULLFSBLOCK ||
- XFS_FSB_TO_AGNO(mp, *firstblock) <=
+ ASSERT(tp->t_firstblock == NULLFSBLOCK ||
+ XFS_FSB_TO_AGNO(mp, tp->t_firstblock) <=
XFS_FSB_TO_AGNO(mp,
bma.cur->bc_private.b.firstblock));
- *firstblock = bma.cur->bc_private.b.firstblock;
+ tp->t_firstblock = bma.cur->bc_private.b.firstblock;
}
xfs_btree_del_cursor(bma.cur,
error ? XFS_BTREE_ERROR : XFS_BTREE_NOERROR);
int *nmap, int flags);
int xfs_bmapi_write(struct xfs_trans *tp, struct xfs_inode *ip,
xfs_fileoff_t bno, xfs_filblks_t len, int flags,
- xfs_fsblock_t *firstblock, xfs_extlen_t total,
- struct xfs_bmbt_irec *mval, int *nmap);
+ xfs_extlen_t total, struct xfs_bmbt_irec *mval, int *nmap);
int __xfs_bunmapi(struct xfs_trans *tp, struct xfs_inode *ip,
xfs_fileoff_t bno, xfs_filblks_t *rlen, int flags,
xfs_extnum_t nexts, xfs_fsblock_t *firstblock);
nmap = 1;
error = xfs_bmapi_write(tp, dp, *bno, count,
xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA|XFS_BMAPI_CONTIG,
- &tp->t_firstblock, args->total, &map, &nmap);
+ args->total, &map, &nmap);
if (error)
return error;
c = (int)(*bno + count - b);
error = xfs_bmapi_write(tp, dp, b, c,
xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA,
- &tp->t_firstblock, args->total,
- &mapp[mapi], &nmap);
+ args->total, &mapp[mapi], &nmap);
if (error)
goto out_free_map;
if (nmap < 1)
static void fail(char *msg, int i);
static struct xfs_trans * getres(struct xfs_mount *mp, uint blocks);
static void rsvfile(xfs_mount_t *mp, xfs_inode_t *ip, long long len);
-static int newfile(xfs_trans_t *tp, xfs_inode_t *ip,
- xfs_fsblock_t *first, int dolocal, int logit, char *buf, int len);
+static int newfile(xfs_trans_t *tp, xfs_inode_t *ip, int dolocal, int logit,
+ char *buf, int len);
static char *newregfile(char **pp, int *len);
static void rtinit(xfs_mount_t *mp);
static long filesize(int fd);
newfile(
xfs_trans_t *tp,
xfs_inode_t *ip,
- xfs_fsblock_t *first,
int dolocal,
int logit,
char *buf,
} else if (len > 0) {
nb = XFS_B_TO_FSB(mp, len);
nmap = 1;
- error = -libxfs_bmapi_write(tp, ip, 0, nb, 0, first, nb,
- &map, &nmap);
+ error = -libxfs_bmapi_write(tp, ip, 0, nb, 0, nb, &map, &nmap);
if (error) {
fail(_("error allocating space for a file"), error);
}
&creds, fsxp, &ip);
if (error)
fail(_("Inode allocation failed"), error);
- flags |= newfile(tp, ip, &first, 0, 0, buf, len);
+ flags |= newfile(tp, ip, 0, 0, buf, len);
if (buf)
free(buf);
libxfs_trans_ijoin(tp, pip, 0);
&creds, fsxp, &ip);
if (error)
fail(_("Inode allocation failed"), error);
- flags |= newfile(tp, ip, &first, 1, 1, buf, len);
+ flags |= newfile(tp, ip, 1, 1, buf, len);
libxfs_trans_ijoin(tp, pip, 0);
xname.type = XFS_DIR3_FT_SYMLINK;
newdirent(mp, tp, pip, &xname, ip->i_ino);
nmap = XFS_BMAP_MAX_NMAP;
error = -libxfs_bmapi_write(tp, rbmip, bno,
(xfs_extlen_t)(mp->m_sb.sb_rbmblocks - bno),
- 0, &first, mp->m_sb.sb_rbmblocks, map, &nmap);
+ 0, mp->m_sb.sb_rbmblocks, map, &nmap);
if (error) {
fail(_("Allocation of the realtime bitmap failed"),
error);
nmap = XFS_BMAP_MAX_NMAP;
error = -libxfs_bmapi_write(tp, rsumip, bno,
(xfs_extlen_t)(nsumblocks - bno),
- 0, &first, nsumblocks, map, &nmap);
+ 0, nsumblocks, map, &nmap);
if (error) {
fail(_("Allocation of the realtime summary failed"),
error);
nmap = XFS_BMAP_MAX_NMAP;
error = -libxfs_bmapi_write(tp, ip, bno,
(xfs_extlen_t)(mp->m_sb.sb_rbmblocks - bno),
- 0, &first, mp->m_sb.sb_rbmblocks, map, &nmap);
+ 0, mp->m_sb.sb_rbmblocks, map, &nmap);
if (error) {
do_error(
_("couldn't allocate realtime bitmap, error = %d\n"),
xfs_trans_t *tp;
xfs_inode_t *ip;
xfs_rtword_t *bmp;
- xfs_fsblock_t first;
int nmap;
int error;
xfs_fileoff_t bno;
error);
}
- first = NULLFSBLOCK;
while (bno < mp->m_sb.sb_rbmblocks) {
/*
* fill the file one block at a time
*/
nmap = 1;
- error = -libxfs_bmapi_write(tp, ip, bno, 1, 0,
- &first, 1, &map, &nmap);
+ error = -libxfs_bmapi_write(tp, ip, bno, 1, 0, 1, &map, &nmap);
if (error || nmap != 1) {
do_error(
_("couldn't map realtime bitmap block %" PRIu64 ", error = %d\n"),
xfs_trans_t *tp;
xfs_inode_t *ip;
xfs_suminfo_t *smp;
- xfs_fsblock_t first;
int nmap;
int error;
xfs_fileoff_t bno;
error);
}
- first = NULLFSBLOCK;
while (bno < end_bno) {
/*
* fill the file one block at a time
*/
nmap = 1;
- error = -libxfs_bmapi_write(tp, ip, bno, 1, 0,
- &first, 1, &map, &nmap);
+ error = -libxfs_bmapi_write(tp, ip, bno, 1, 0, 1, &map, &nmap);
if (error || nmap != 1) {
do_error(
_("couldn't map realtime summary inode block %" PRIu64 ", error = %d\n"),
nmap = XFS_BMAP_MAX_NMAP;
error = -libxfs_bmapi_write(tp, ip, bno,
(xfs_extlen_t)(nsumblocks - bno),
- 0, &first, nsumblocks, map, &nmap);
+ 0, nsumblocks, map, &nmap);
if (error) {
do_error(
_("couldn't allocate realtime summary inode, error = %d\n"),