summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-postgresql.py
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2024-12-28 20:55:21 +0300
committerChristian Brauner <brauner@kernel.org>2025-01-04 12:15:52 +0300
commitb9b588f22a0c049a14885399e27625635ae6ef91 (patch)
tree246f9f9cb0646838ba355e865244579e3dd65178 /tools/perf/scripts/python/export-to-postgresql.py
parent68a3a65003145644efcbb651e91db249ccd96281 (diff)
downloadlinux-b9b588f22a0c049a14885399e27625635ae6ef91.tar.xz
libfs: Use d_children list to iterate simple_offset directories
The mtree mechanism has been effective at creating directory offsets that are stable over multiple opendir instances. However, it has not been able to handle the subtleties of renames that are concurrent with readdir. Instead of using the mtree to emit entries in the order of their offset values, use it only to map incoming ctx->pos to a starting entry. Then use the directory's d_children list, which is already maintained properly by the dcache, to find the next child to emit. One of the sneaky things about this is that when the mtree-allocated offset value wraps (which is very rare), looking up ctx->pos++ is not going to find the next entry; it will return NULL. Instead, by following the d_children list, the offset values can appear in any order but all of the entries in the directory will be visited eventually. Note also that the readdir() is guaranteed to reach the tail of this list. Entries are added only at the head of d_children, and readdir walks from its current position in that list towards its tail. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Link: https://lore.kernel.org/r/20241228175522.1854234-6-cel@kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions