aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Kendall <wkendall@sgi.com>2011-11-07 14:58:30 -0600
committerChristoph Hellwig <hch@lst.de>2011-11-10 10:55:32 +0000
commit54dc99f6f6c3f3c53baa4ab3da82e1ae75219389 (patch)
treec9a2cdc6f3264ec0738b02902e82464f285295f4
parente68fa1417b6538611d222bfcddaedb8ef74e5a72 (diff)
downloadxfsdump-dev-54dc99f6f6c3f3c53baa4ab3da82e1ae75219389.tar.gz
xfsdump: path lookup cache must be thread specific
The xfsrestore path lookup routine (maps an ino + generation number to a pathname) contains a cache for fast lookups of consecutive files in the same parent directory. This cache either needs to be protected by a lock or a cache is needed per thread. I took the latter approach since it doesn't add lock contention and it increases the cache hit rate (it's relatively unlikely that each stream is processing files in the same directory). Signed-off-by: Bill Kendall <wkendall@sgi.com> Reviewed-by: Alex Elder <aelder@sgi.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--restore/tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/restore/tree.c b/restore/tree.c
index 7bddddf8..9e4e83ce 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -3441,7 +3441,7 @@ Node2path( nh_t nh, char *path, char *errmsg )
static intgen_t
Node2path_recurse( nh_t nh, char *buf, intgen_t bufsz, intgen_t level )
{
- static path_cache_t cache = { NH_NULL, 0, "" };
+ static __thread path_cache_t cache = { NH_NULL, 0, "" };
node_t *np;
nh_t parh;
xfs_ino_t ino;