Inode Allocation via Hash-Based Sub-Regions for Directory Traversal
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing file systems face inefficiencies in directory traversal due to the random distribution of inodes across a large storage space, leading to slow processing speeds, especially when dealing with large directories and extensive metadata like extended attributes and access control lists, which often require additional inodes and result in wasted storage space.
Innovation Solution
The method involves allocating a range of consecutive inodes to a directory and dividing them into sub-regions based on hash values, allowing for efficient allocation and retrieval of inodes during directory traversal by sorting files according to their hash values, thereby improving the spatial correlation of inodes within directories.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of manufacture
If inodes are allocated consecutively according to file creation time, then inode allocation is simple and sequential, but inodes of files in the same directory become widely distributed and directory traversal speed decreases
Solution Approach 1:
The patent segments the inode address space into multiple inode tables, each corresponding to a specific directory. When a directory is created, a dedicated inode table is allocated for it. This segmentation allows files within the same directory to have their inodes located in the same inode table, improving spatial correlation and directory traversal efficiency while maintaining simple sequential allocation within each table.
Solution Approach 2:
The patent introduces a new dimension of organization by mapping directories to specific inode tables rather than using a single flat inode space. This dimensional change allows the system to maintain both sequential allocation simplicity and improved spatial correlation by organizing inodes in a two-level structure: directories map to inode tables, and files map to inodes within those tables.
2Quantity of substance
If inodes are enlarged to store extended attributes and access control lists, then storage space utilization improves, but the distribution range of inodes expands and random scattering worsens
Solution Approach 1:
The patent segments metadata storage into two parts: essential metadata is stored in the inode header, while extended attributes and access control lists are stored in separate data blocks. This segmentation allows the inode structure to remain compact, limiting the distribution range of inodes, while still providing ample space for metadata through the separate data blocks.
Solution Approach 2:
The patent implements a nested structure where the inode contains pointers to additional data blocks that hold extended attributes and access control lists. This nested organization allows metadata to be stored hierarchically, with the compact inode serving as the container that references larger metadata structures, thereby maintaining tight inode distribution while accommodating extensive metadata.
3Speed
If hash algorithm is used for file lookup, then metadata retrieval speed improves, but directory traversal becomes inefficient due to poor distribution characteristics
Solution Approach 1:
The patent segments the directory structure into multiple inode tables, each serving a specific directory. This segmentation allows the system to maintain hash-based lookup efficiency within each table while improving directory traversal by limiting the search scope to relevant tables only, rather than scanning the entire inode space.
Solution Approach 2:
The patent applies local quality by optimizing the inode distribution characteristics within each inode table specifically for directory traversal. Each inode table is organized to facilitate sequential access patterns typical of directory traversal, while still supporting hash-based lookup for individual file retrieval, thereby achieving both efficiency modes locally within each table.
Data Source
AI summary
An index node (inode) allocation method, a corresponding data processing device and a corresponding computer-readable medium are provided. The method is applicable to a file system and includes the following steps: allocating a range including a plurality of consecutive inodes to a directory in the file system when a directory order mode is already activated, wherein files in the directory are sorted according to hash values of the files; dividing the range of inodes into a plurality of sub-regions; and when a new file is created in the directory, selecting one of the sub-regions according to a hash value of the new file, so as to allocate an inode in the selected sub-region to the new file.


