Commit 4b77a088 authored by Brian Foster's avatar Brian Foster Committed by Darrick J. Wong

xfs: use ->t_firstblock in bmap extent split

Also remove the unnecessary xfs_bmap_split_extent_at() parameter.
Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 333f950c
...@@ -5878,8 +5878,7 @@ STATIC int ...@@ -5878,8 +5878,7 @@ STATIC int
xfs_bmap_split_extent_at( xfs_bmap_split_extent_at(
struct xfs_trans *tp, struct xfs_trans *tp,
struct xfs_inode *ip, struct xfs_inode *ip,
xfs_fileoff_t split_fsb, xfs_fileoff_t split_fsb)
xfs_fsblock_t *firstfsb)
{ {
int whichfork = XFS_DATA_FORK; int whichfork = XFS_DATA_FORK;
struct xfs_btree_cur *cur = NULL; struct xfs_btree_cur *cur = NULL;
...@@ -5928,7 +5927,7 @@ xfs_bmap_split_extent_at( ...@@ -5928,7 +5927,7 @@ xfs_bmap_split_extent_at(
if (ifp->if_flags & XFS_IFBROOT) { if (ifp->if_flags & XFS_IFBROOT) {
cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork);
cur->bc_private.b.firstblock = *firstfsb; cur->bc_private.b.firstblock = tp->t_firstblock;
cur->bc_private.b.flags = 0; cur->bc_private.b.flags = 0;
error = xfs_bmbt_lookup_eq(cur, &got, &i); error = xfs_bmbt_lookup_eq(cur, &got, &i);
if (error) if (error)
...@@ -5972,8 +5971,8 @@ xfs_bmap_split_extent_at( ...@@ -5972,8 +5971,8 @@ xfs_bmap_split_extent_at(
int tmp_logflags; /* partial log flag return val */ int tmp_logflags; /* partial log flag return val */
ASSERT(cur == NULL); ASSERT(cur == NULL);
error = xfs_bmap_extents_to_btree(tp, ip, firstfsb, &cur, 0, error = xfs_bmap_extents_to_btree(tp, ip, &tp->t_firstblock,
&tmp_logflags, whichfork); &cur, 0, &tmp_logflags, whichfork);
logflags |= tmp_logflags; logflags |= tmp_logflags;
} }
...@@ -5997,20 +5996,18 @@ xfs_bmap_split_extent( ...@@ -5997,20 +5996,18 @@ xfs_bmap_split_extent(
struct xfs_mount *mp = ip->i_mount; struct xfs_mount *mp = ip->i_mount;
struct xfs_trans *tp; struct xfs_trans *tp;
struct xfs_defer_ops dfops; struct xfs_defer_ops dfops;
xfs_fsblock_t firstfsb;
int error; int error;
error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write,
XFS_DIOSTRAT_SPACE_RES(mp, 0), 0, 0, &tp); XFS_DIOSTRAT_SPACE_RES(mp, 0), 0, 0, &tp);
if (error) if (error)
return error; return error;
xfs_defer_init(tp, &dfops, &firstfsb); xfs_defer_init(tp, &dfops, &tp->t_firstblock);
xfs_ilock(ip, XFS_ILOCK_EXCL); xfs_ilock(ip, XFS_ILOCK_EXCL);
xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
error = xfs_bmap_split_extent_at(tp, ip, split_fsb, error = xfs_bmap_split_extent_at(tp, ip, split_fsb);
&firstfsb);
if (error) if (error)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment