*/
LEFT.br_blockcount += PREV.br_blockcount + RIGHT.br_blockcount;
- xfs_iext_remove(bma->ip, &bma->icur, 2, state);
+ xfs_iext_remove(bma->ip, &bma->icur, state);
+ xfs_iext_remove(bma->ip, &bma->icur, state);
xfs_iext_prev(ifp, &bma->icur);
xfs_iext_update_extent(bma->ip, state, &bma->icur, &LEFT);
(*nextents)--;
old = LEFT;
LEFT.br_blockcount += PREV.br_blockcount;
- xfs_iext_remove(bma->ip, &bma->icur, 1, state);
+ xfs_iext_remove(bma->ip, &bma->icur, state);
xfs_iext_prev(ifp, &bma->icur);
xfs_iext_update_extent(bma->ip, state, &bma->icur, &LEFT);
PREV.br_blockcount += RIGHT.br_blockcount;
xfs_iext_next(ifp, &bma->icur);
- xfs_iext_remove(bma->ip, &bma->icur, 1, state);
+ xfs_iext_remove(bma->ip, &bma->icur, state);
xfs_iext_prev(ifp, &bma->icur);
xfs_iext_update_extent(bma->ip, state, &bma->icur, &PREV);
*/
LEFT.br_blockcount += PREV.br_blockcount + RIGHT.br_blockcount;
- xfs_iext_remove(ip, icur, 2, state);
+ xfs_iext_remove(ip, icur, state);
+ xfs_iext_remove(ip, icur, state);
xfs_iext_prev(ifp, icur);
xfs_iext_update_extent(ip, state, icur, &LEFT);
XFS_IFORK_NEXT_SET(ip, whichfork,
*/
LEFT.br_blockcount += PREV.br_blockcount;
- xfs_iext_remove(ip, icur, 1, state);
+ xfs_iext_remove(ip, icur, state);
xfs_iext_prev(ifp, icur);
xfs_iext_update_extent(ip, state, icur, &LEFT);
XFS_IFORK_NEXT_SET(ip, whichfork,
PREV.br_state = new->br_state;
xfs_iext_next(ifp, icur);
- xfs_iext_remove(ip, icur, 1, state);
+ xfs_iext_remove(ip, icur, state);
xfs_iext_prev(ifp, icur);
xfs_iext_update_extent(ip, state, icur, &PREV);
left.br_startblock = nullstartblock(newlen);
left.br_blockcount = temp;
- xfs_iext_remove(ip, icur, 1, state);
+ xfs_iext_remove(ip, icur, state);
xfs_iext_prev(ifp, icur);
xfs_iext_update_extent(ip, state, icur, &left);
break;
*/
left.br_blockcount += new->br_blockcount + right.br_blockcount;
- xfs_iext_remove(ip, icur, 1, state);
+ xfs_iext_remove(ip, icur, state);
xfs_iext_prev(ifp, icur);
xfs_iext_update_extent(ip, state, icur, &left);
/*
* Matches the whole extent. Delete the entry.
*/
- xfs_iext_remove(ip, icur, 1, state);
+ xfs_iext_remove(ip, icur, state);
xfs_iext_prev(ifp, icur);
break;
case BMAP_LEFT_FILLING:
/*
* Matches the whole extent. Delete the entry.
*/
- xfs_iext_remove(ip, icur, 1, state);
+ xfs_iext_remove(ip, icur, state);
xfs_iext_prev(ifp, icur);
break;
case BMAP_LEFT_FILLING:
/*
* Matches the whole extent. Delete the entry.
*/
- xfs_iext_remove(ip, icur, 1, state);
+ xfs_iext_remove(ip, icur, state);
xfs_iext_prev(ifp, icur);
XFS_IFORK_NEXT_SET(ip, whichfork,
XFS_IFORK_NEXTENTS(ip, whichfork) - 1);
return error;
done:
- xfs_iext_remove(ip, icur, 1, 0);
+ xfs_iext_remove(ip, icur, 0);
xfs_iext_prev(XFS_IFORK_PTR(ip, whichfork), icur);
xfs_iext_update_extent(ip, xfs_bmap_fork_to_state(whichfork), icur,
&new);
kmem_free(ifp->if_u1.if_root);
}
-static void
-__xfs_iext_remove(
- struct xfs_ifork *ifp,
- struct xfs_iext_cursor *cur)
+void
+xfs_iext_remove(
+ struct xfs_inode *ip,
+ struct xfs_iext_cursor *cur,
+ int state)
{
+ struct xfs_ifork *ifp = xfs_iext_state_to_fork(ip, state);
struct xfs_iext_leaf *leaf = cur->leaf;
xfs_fileoff_t offset = xfs_iext_leaf_key(leaf, 0);
int i, nr_entries;
+ trace_xfs_iext_remove(ip, cur, state, _RET_IP_);
+
ASSERT(ifp->if_height > 0);
ASSERT(ifp->if_u1.if_root != NULL);
ASSERT(xfs_iext_valid(ifp, cur));
xfs_iext_free_last_leaf(ifp);
}
-void
-xfs_iext_remove(
- struct xfs_inode *ip,
- struct xfs_iext_cursor *cur,
- int nr_extents,
- int state)
-{
- struct xfs_ifork *ifp = xfs_iext_state_to_fork(ip, state);
- int i;
-
- ASSERT(nr_extents > 0);
-
- for (i = 0; i < nr_extents; i++) {
- trace_xfs_iext_remove(ip, cur, state, _RET_IP_);
- __xfs_iext_remove(ifp, cur);
- }
-}
-
/*
* Lookup the extent covering bno.
*