From: Darrick J. Wong Date: Mon, 31 Jul 2017 20:08:10 +0000 (-0500) Subject: xfs: optimize _btree_query_all X-Git-Tag: v4.13.0-rc1~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f296858dfb17c1f6bde8a0465b1f2c1bab2374e8;p=thirdparty%2Fxfsprogs-dev.git xfs: optimize _btree_query_all Source kernel commit: 5a4c73342ad493c61f19a1406f47dcd35e18030f 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 Reviewed-by: Brian Foster Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c index 33bf0dbe8..3d293520a 100644 --- a/libxfs/xfs_btree.c +++ b/libxfs/xfs_btree.c @@ -4849,12 +4849,14 @@ xfs_btree_query_all( xfs_btree_query_range_fn fn, void *priv) { - union xfs_btree_irec low_rec; - union xfs_btree_irec high_rec; + union xfs_btree_key low_key; + union xfs_btree_key high_key; + + memset(&cur->bc_rec, 0, sizeof(cur->bc_rec)); + memset(&low_key, 0, sizeof(low_key)); + memset(&high_key, 0xFF, sizeof(high_key)); - memset(&low_rec, 0, sizeof(low_rec)); - memset(&high_rec, 0xFF, sizeof(high_rec)); - return xfs_btree_query_range(cur, &low_rec, &high_rec, fn, priv); + return xfs_btree_simple_query_range(cur, &low_key, &high_key, fn, priv); } /*