From owner-cvs-all@FreeBSD.ORG Sat May 8 08:09:02 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D1D9F16A4CE; Sat, 8 May 2004 08:09:02 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F88943D49; Sat, 8 May 2004 08:09:02 -0700 (PDT) (envelope-from peadar@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i48F92Ge007545; Sat, 8 May 2004 08:09:02 -0700 (PDT) (envelope-from peadar@repoman.freebsd.org) Received: (from peadar@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i48F92Ha007544; Sat, 8 May 2004 08:09:02 -0700 (PDT) (envelope-from peadar) Message-Id: <200405081509.i48F92Ha007544@repoman.freebsd.org> From: Peter Edwards Date: Sat, 8 May 2004 08:09:02 -0700 (PDT) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/include fts.h src/lib/libc/gen fts.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 May 2004 15:09:03 -0000 peadar 2004/05/08 08:09:02 PDT FreeBSD src repository Modified files: include fts.h lib/libc/gen fts.c Log: 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@) Revision Changes Path 1.8 +3 -0 src/include/fts.h 1.24 +75 -3 src/lib/libc/gen/fts.c