Inode Allocation via In-Core Cache for File Creation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current file system methods for inode allocation are inefficient, either wasting space with static allocation or slowing down file creation with dynamic allocation, due to the need to search through large data structures for available inodes, leading to increased time and resource utilization during file creation processes.
Innovation Solution
Implement a method where previously-occupied inodes are marked as available in an in-core data structure, allowing for faster inode assignment during file creation, while maintaining the inode's availability for future use, and utilizing a separate maintenance thread to manage the size and freshness of the in-core data structure.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If static inode allocation is used, then inode space is allocated efficiently at system creation, but space is wasted when fewer files are created than anticipated
Solution Approach 1:
The system pre-allocates inodes in advance and maintains a cache of previously occupied inodes that are marked as available. This preliminary action allows the system to have ready-to-assign inodes without having to search through the entire file system, resolving the contradiction between having enough inodes for maximum files and avoiding waste when fewer files are created.
2Quantity of substance
If dynamic inode allocation is used, then inode space is optimized, but file creation time increases due to searching through large data structures
Solution Approach 1:
The system performs preliminary actions by pre-allocating inodes and maintaining them in an in-core data structure. When a file needs to be created, the system can immediately assign from this pre-prepared cache rather than searching through the entire inode table, dramatically reducing file creation time while maintaining space optimization.
Solution Approach 2:
The patent introduces an in-core data structure as an intermediary between the file creation process and the on-disk inode storage. This intermediary cache of previously occupied inodes allows fast access without repeatedly reading from or writing to the on-disk bitmap, resolving the time optimization contradiction.
3Reliability
If on-disk bitmap data structure is used to track inodes, then inode availability is accurately tracked, but search time through the bitmap increases with file system size
Solution Approach 1:
The patent segments the inode tracking into two parts: an in-core data structure that maintains a simplified cache of previously occupied inodes for fast access, and the on-disk bitmap that provides complete but slower access. This segmentation allows the system to use the fast in-core structure for most operations while relying on the complete on-disk structure only when necessary, resolving the time contradiction.
Solution Approach 2:
The in-core data structure serves as an intermediary layer between the file creation process and the on-disk bitmap. It provides fast access to inode availability information without requiring direct access to the large on-disk bitmap, thus maintaining reliability while reducing search time.
Data Source
AI summary
Various systems and methods are provided for using various in-core and on-disk data structures to improve the file creation process through the use of previously-occupied inodes. For example, one method involves updating an in-core data structure in response to receiving a command to delete a first file, such that a first node is assigned to the first file, the in-core data structure is stored in a non-persistent computer-readable storage medium, the in-core data structure comprises a plurality of entries, each of the entries comprises information identifying a respective inode of a plurality of inodes as being available, and the updating the in-core data structure comprises storing information regarding the first inode in a first entry of the plurality of entries; and creating a second file, where the creating comprises assigning the first inode to the second file using the information regarding the first inode stored in the first entry.


