summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_iext_tree.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-11-03 10:34:46 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2017-11-06 11:53:41 -0800
commit0254c2f253d6fe11ea2ce5046ed6acfddbe4ee17 (patch)
treefd4aa8d9631e9a149e3b535893c8ab9b2486f053 /fs/xfs/libxfs/xfs_iext_tree.c
parent6bdcf26ade8825ffcdc692338e715cd7ed0820d8 (diff)
downloadlinux-stable-0254c2f253d6fe11ea2ce5046ed6acfddbe4ee17.tar.gz
linux-stable-0254c2f253d6fe11ea2ce5046ed6acfddbe4ee17.tar.bz2
linux-stable-0254c2f253d6fe11ea2ce5046ed6acfddbe4ee17.zip
xfs: remove the nr_extents argument to xfs_iext_insert
We only have two places that insert 2 extents at the same time, so unroll the loop there. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_iext_tree.c')
-rw-r--r--fs/xfs/libxfs/xfs_iext_tree.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/fs/xfs/libxfs/xfs_iext_tree.c b/fs/xfs/libxfs/xfs_iext_tree.c
index b15f85b80d92..3b5280ec7967 100644
--- a/fs/xfs/libxfs/xfs_iext_tree.c
+++ b/fs/xfs/libxfs/xfs_iext_tree.c
@@ -619,16 +619,20 @@ xfs_iext_realloc_root(
cur->leaf = new;
}
-static void
-__xfs_iext_insert(
- struct xfs_ifork *ifp,
+void
+xfs_iext_insert(
+ struct xfs_inode *ip,
struct xfs_iext_cursor *cur,
- struct xfs_bmbt_irec *irec)
+ struct xfs_bmbt_irec *irec,
+ int state)
{
+ struct xfs_ifork *ifp = xfs_iext_state_to_fork(ip, state);
xfs_fileoff_t offset = irec->br_startoff;
struct xfs_iext_leaf *new = NULL;
int nr_entries, i;
+ trace_xfs_iext_insert(ip, cur, state, _RET_IP_);
+
if (ifp->if_height == 0)
xfs_iext_alloc_root(ifp, cur);
else if (ifp->if_height == 1)
@@ -656,25 +660,6 @@ __xfs_iext_insert(
xfs_iext_insert_node(ifp, xfs_iext_leaf_key(new, 0), new, 2);
}
-void
-xfs_iext_insert(
- struct xfs_inode *ip,
- struct xfs_iext_cursor *cur,
- xfs_extnum_t nr_extents,
- struct xfs_bmbt_irec *new,
- int state)
-{
- struct xfs_ifork *ifp = xfs_iext_state_to_fork(ip, state);
- int i;
-
- ASSERT(nr_extents > 0);
-
- for (i = nr_extents - 1; i >= 0; i--) {
- __xfs_iext_insert(ifp, cur, new + i);
- trace_xfs_iext_insert(ip, cur, state, _RET_IP_);
- }
-}
-
static struct xfs_iext_node *
xfs_iext_rebalance_node(
struct xfs_iext_node *parent,