mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-07 00:59:06 +00:00
xfs: optimize _btree_query_all
Don't bother wandering our way through the leaf nodes when the caller issues a query_all; just zoom down the left side of the tree and walk rightwards along level zero. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
This commit is contained in:
parent
3d4b4a3e30
commit
5a4c73342a
1 changed files with 7 additions and 5 deletions
|
@ -4849,12 +4849,14 @@ xfs_btree_query_all(
|
||||||
xfs_btree_query_range_fn fn,
|
xfs_btree_query_range_fn fn,
|
||||||
void *priv)
|
void *priv)
|
||||||
{
|
{
|
||||||
union xfs_btree_irec low_rec;
|
union xfs_btree_key low_key;
|
||||||
union xfs_btree_irec high_rec;
|
union xfs_btree_key high_key;
|
||||||
|
|
||||||
memset(&low_rec, 0, sizeof(low_rec));
|
memset(&cur->bc_rec, 0, sizeof(cur->bc_rec));
|
||||||
memset(&high_rec, 0xFF, sizeof(high_rec));
|
memset(&low_key, 0, sizeof(low_key));
|
||||||
return xfs_btree_query_range(cur, &low_rec, &high_rec, fn, priv);
|
memset(&high_key, 0xFF, sizeof(high_key));
|
||||||
|
|
||||||
|
return xfs_btree_simple_query_range(cur, &low_key, &high_key, fn, priv);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue