From 681ff708cf3a746531ecbd80b04733acc50b890b Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Wed, 16 Mar 2011 08:58:09 +0000 Subject: [PATCH] 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 --- lib/libc/gen/fts-compat.c | 1 + lib/libc/gen/fts.c | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/libc/gen/fts-compat.c b/lib/libc/gen/fts-compat.c index 3afb87d7b73e..a6ddde4f265d 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 1c547a10722c..f727003c13d5 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",