From dbbf89756257ca1b2bed2e7debb290e88da831fa Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 12 Dec 2003 05:41:29 +0000 Subject: (FTS) [fts_dir_signatures]: Add comment. --- lib/fts_.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/fts_.h b/lib/fts_.h index ed0cb1c25..b6ba1b481 100644 --- a/lib/fts_.h +++ b/lib/fts_.h @@ -69,8 +69,18 @@ typedef struct { # define FTS_NAMEONLY 0x0100 /* (private) child names only */ # define FTS_STOP 0x0200 /* (private) unrecoverable error */ int fts_options; /* fts_open options, global flags */ - /* Data structure in which to store the fingerprint - of each directory we've encountered. */ + + /* This data structure records the directories between a starting + point and the current directory. I.e., a directory is recorded + here IFF we have visited it once, but we have not yet completed + processing of all its entries. Every time we visit a new directory, + we add that directory to this set. When we finish with a directory + (usually by visiting it a second time), we remove it from this + set. Each entry in this data structure is a device/inode pair. + This data structure is used to detect directory cycles efficiently + and promptly even when the depth of a hierarchy is in the tens + of thousands. Lazy checking, as done by GNU rm via cycle-check.c, + wouldn't be appropriate for du. */ void *fts_dir_signatures; } FTS; -- cgit v1.2.3-54-g00ecf