Methods for caching directory structure of a file system
AssigneeMediatek Inc.
InventorJung-Chih LIU
Life of this patent
Estimating the term…
Abstract
A file system cache method for a device accessing a file system is provided, wherein the device has a processing unit and a cache buffer. The method comprises accessing a folder in the file system, caching information of child folders of a currently accessed folder when accessing a root folder, caching information of parent folders of the current accessed folder when accessing a leaf folder, caching information of at least one parent folder and at least one child folder of the currently accessed folder when accessing a child folder not classified as a leaf folder, and removing cache buffer entries of sibling folders of the currently accessed folder.
Claims20
A file system cache method for a device accessing a file system having M folders, wherein the device comprises a processing unit and a cache buffer, the method comprising:
- accessing one of the M folders;
- caching information of a plurality of child folder of a currently accessed folder into the cache buffer when accessing a root folder, wherein the root folder has no parent folder;
- caching information of a plurality of parent folders of the currently accessed folder into the cache buffer when accessing a leaf folder;
- wherein the leaf folder has no child folder;
- caching information of at least one parent folder and at least one child folder of the currently accessed folder into the cache buffer when accessing a child folder not classified as a leaf folder;
- and
- removing a cache buffer entry of a sibling folder of the currently accessed folder from the cache buffer;
- wherein the sibling folder has a parent folder which is the same as the currently accessed folder.
A scan method for performing a disk scan procedure to obtain a disk scan result by accessing a file system by a device having a processor and a cache buffer, the scan method comprising:
- accessing a root folder for obtaining information for disk scan result;
- caching information of child folders of the root folder into the cache buffer;
- subsequently accessing each of the child folders of the root folder for obtaining information for disk scan result, wherein a next child folder of the root folder is accessed when all leaf folders of a current child folder of the root folder have been accessed;
- caching information of child folders of the currently accessed folder and removing a cache buffer entry of a sibling folder of the currently accessed folder, wherein the sibling folders have a parent folder which is the same as the entered child folder;
- and
- obtaining disk scan result of the file system when all folders are accessed.
A device for accessing a file system, comprising:
- a cache buffer, caching information of folders in the file system as cache buffer entries;
- and
- a processor, accessing the file system by referring to the cache buffer entries in the cache buffer,
- wherein the cache buffer caches child folders of a currently accessed folder and the processor removes sibling folders of the currently accessed folder when accessing a folder in the file system, and the sibling folder has a parent folder which is the same as the currently accessed folder.
Dependencies are inferred from the claim text.