summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2011-03-16 08:58:09 +0000
committerpjd <pjd@FreeBSD.org>2011-03-16 08:58:09 +0000
commit18c497939abd17b5b1a7c20b41c1e778e9894668 (patch)
treebe90d9abb16c370bb5980934715811bb1edcb310
parent67b7c6cf191c0e44cee8b101db10858edf82bf7b (diff)
downloadFreeBSD-src-18c497939abd17b5b1a7c20b41c1e778e9894668.zip
FreeBSD-src-18c497939abd17b5b1a7c20b41c1e778e9894668.tar.gz
From fts.c comment:
The "FTS_NOSTAT" option can avoid a lot of calls to stat(2) if it knows that a directory could not possibly have subdirectories. This is decided by looking at the link count: a subdirectory would increment its parent's link count by virtue of its own ".." entry. This assumption only holds for UFS-like filesystems that implement links and directories this way, so we must punt for others. It looks like ZFS is a UFS-like file system, as the above also holds for ZFS. Add ZFS to the list of file systems that allow for such optimization. MFC after: 1 month
-rw-r--r--lib/libc/gen/fts-compat.c1
-rw-r--r--lib/libc/gen/fts.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/libc/gen/fts-compat.c b/lib/libc/gen/fts-compat.c
index 3afb87d..a6ddde4 100644
--- a/lib/libc/gen/fts-compat.c
+++ b/lib/libc/gen/fts-compat.c
@@ -110,6 +110,7 @@ struct _fts_private {
static const char *ufslike_filesystems[] = {
"ufs",
+ "zfs",
"nfs",
"nfs4",
"ext2fs",
diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
index 1c547a1..f727003 100644
--- a/lib/libc/gen/fts.c
+++ b/lib/libc/gen/fts.c
@@ -100,6 +100,7 @@ struct _fts_private {
static const char *ufslike_filesystems[] = {
"ufs",
+ "zfs",
"nfs",
"nfs4",
"ext2fs",
OpenPOWER on IntegriCloud