Hard Link Database for Fast Reverse Lookup
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional file systems face difficulties in efficiently performing reverse lookups to find all pathnames for files with multiple hard links, as the directory structure is not optimized for this purpose, leading to challenges in error recovery and exception handling.
Innovation Solution
A hard link database is implemented, maintaining a one-to-one correspondence between regular files with multiple hard links and hard link database files, allowing for efficient reverse lookups by storing addressing information and using this information to address hard links, thereby facilitating the retrieval of all pathnames for a specified regular file.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If conventional file system directory structure is used, then the file system is simple to implement, but reverse lookup efficiency deteriorates when files have multiple hard links
Solution Approach 1:
The patent segments the file system by introducing a separate hard link database that is distinct from the conventional directory structure. This database specifically handles hard link relationships, allowing reverse lookups to be performed efficiently without complicating the overall file system architecture. The hard link database stores inode numbers and their corresponding pathnames separately, enabling targeted optimization for multi-hard link scenarios.
Solution Approach 2:
The patent introduces a hard link database as an intermediary component between the file system manager and the directory structure. This intermediary stores and manages hard link information, acting as a mediator that facilitates efficient reverse lookups without requiring modifications to the core directory hierarchy. The database serves as a lookup table that maps inodes to pathnames, decoupling the reverse lookup function from the directory traversal process.
2Loss of time
If directory hierarchy traversal is used for reverse lookup, then the implementation is straightforward, but the time required for reverse lookup increases with file system size
Solution Approach 1:
The patent applies preliminary action by pre-computing and storing the relationships between inodes and pathnames in the hard link database before reverse lookups are needed. When hard links are created or modified, the database is updated in advance, so that subsequent reverse lookups can retrieve pathnames immediately without traversing the directory hierarchy. This pre-positioning of data eliminates the time-consuming traversal process.
Solution Approach 2:
The patent creates a copy of the essential hard link information (inode numbers and pathnames) in a separate database structure. Instead of traversing the original directory hierarchy to find pathnames, the system queries this copied representation which is optimized for reverse lookups. The hard link database contains duplicate copies of pathname information that can be retrieved directly without accessing the parent directory structure.
3Reliability
If conventional directory structure is used, then the system is easy to maintain, but reliability of error recovery deteriorates when files have multiple hard links
Solution Approach 1:
The patent implements feedback mechanisms by maintaining the hard link database in sync with the file system state. When files are created, deleted, or have hard links added or removed, the database is automatically updated to reflect current relationships. This feedback loop ensures that the database always contains accurate information about hard link associations, enabling reliable error recovery even in complex multi-hard link scenarios.
Solution Approach 2:
The patent replaces the mechanical process of directory hierarchy traversal with a database query mechanism. Instead of systematically searching through parent directories to find pathnames, the system uses the hard link database which stores pre-processed mapping information. This substitution of the lookup mechanism with a dedicated database structure improves reliability by ensuring consistent and accurate retrieval of pathname information for error recovery operations.
Data Source
AI summary
For enabling a fast reverse lookup of parent directories storing records of hard links to a specified regular file, a file system manager maintains a hard link database (HLDB) storing information for addressing hard links to the regular files having multiple hard links. The HLDB contains a corresponding HLDB file for each regular file having multiple hard links. In a preferred implementation, the inode of each regular file stores the addressing information for one hard link to the regular file, a corresponding HLDB file stores the addressing information for other hard links to the regular file, each HLDB file is a directory accessed by invoking file system manager directory access routines, and the HLDB has a directory tree providing a multi-level hash index for searching the HLDB given the inode number of a regular file.


