This article relies excessively on references to primary sources. Please improve this article by adding secondary or tertiary sources. Find sources: "HTree" – news · newspapers · books · scholar · JSTOR (September 2013) (Learn how and when to remove this template message)

An HTree is a specialized tree data structure for directory indexing, similar to a B-tree. They are constant depth of either one or two levels, have a high fanout factor, use a hash of the filename, and do not require balancing.[1] The HTree algorithm is distinguished from standard B-tree methods by its treatment of hash collisions, which may overflow across multiple leaf and index blocks. HTree indexes are used in the ext3 and ext4 Linux filesystems, and were incorporated into the Linux kernel around 2.5.40.[2] HTree indexing improved the scalability of Linux ext2 based filesystems from a practical limit of a few thousand files, into the range of tens of millions of files per directory.


The HTree index data structure and algorithm were developed by Daniel Phillips in 2000 and implemented for the ext2 filesystem in February 2001. A port to the ext3 filesystem by Christopher Li and Andrew Morton in 2002 during the 2.5 kernel series added journal based crash consistency. With minor improvements, HTree continues to be used in ext4 in the Linux 3.x.x kernel series.



PHTree (Physically stable HTree) is a derivation intended as a successor.[3][unreliable source?] It fixes all the known issues with HTree except for write multiplication.[citation needed] It is used in the Tux3 filesystem.[4]


  1. ^ Mingming Cao. "Directory indexing" (PDF). Features found in Linux 2.6.
  2. ^ "Add ext3 indexed directory (htree) support".
  3. ^ "PHTree design refresh". 4 January 2013.
  4. ^ "Tux3 Versioning Filesystem". Archived from the original on 13 January 2015. Retrieved 28 December 2014.