aboutsummaryrefslogtreecommitdiffstats
path: root/include/fts.h
diff options
context:
space:
mode:
authorPeter Edwards <peadar@FreeBSD.org>2004-05-08 15:09:02 +0000
committerPeter Edwards <peadar@FreeBSD.org>2004-05-08 15:09:02 +0000
commit99ca5b8804cbf2070494a76a700801c9842399ad (patch)
tree2f49bc03634a311b4d94a860efa4cb4d6c939cff /include/fts.h
parent66a79ac95d028683db9065cc84c9204dcca7e707 (diff)
downloadsrc-99ca5b8804cbf2070494a76a700801c9842399ad.tar.gz
src-99ca5b8804cbf2070494a76a700801c9842399ad.zip
The FTS_NOSTAT option is an optimisation that reduces the number
of stat(2) calls by keeping an eye of the number of links a directory has. It assumes that each subdirectory will have a hard link to its parent, to represent the ".." node, and stops calling stat(2) when all links are accounted for in a given directory. This assumption is really only valid for UNIX-like filesystems: A concrete example is NTFS. The NTFS "i-node" does contain a link count, but most/all directories have a link count between 0 and 2 inclusive. The end result is that find on an NTFS volume won't actually traverse the entire hierarchy of the directories passed to it. (Those with a link count of two are not traversed at all) The fix checks the "UFSness" of the filesystem before enabling the optimisation. Reviewed By: Tim Kientzle (kientzle@)
Notes
Notes: svn path=/head/; revision=129052
Diffstat (limited to 'include/fts.h')
-rw-r--r--include/fts.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/fts.h b/include/fts.h
index 09c4600a1072..dbf82c99167f 100644
--- a/include/fts.h
+++ b/include/fts.h
@@ -37,6 +37,8 @@
#ifndef _FTS_H_
#define _FTS_H_
+struct _fts_private; /* implementation data */
+
typedef struct {
struct _ftsent *fts_cur; /* current node */
struct _ftsent *fts_child; /* linked list of children */
@@ -63,6 +65,7 @@ typedef struct {
#define FTS_STOP 0x200 /* (private) unrecoverable error */
int fts_options; /* fts_open options, global flags */
void *fts_clientptr; /* thunk for sort function */
+ struct _fts_private *fts_priv; /* Implementation data */
} FTS;
typedef struct _ftsent {