摘要 |
A mechanism for saving a snapshot of free space of a file system on persistent storage is disclosed. A method of the invention includes determining whether generation numbers stored in each of a free space cache inode of an on-disk free space cache of a block group, a free space cache item, and a free space cache header are valid, determining whether a checksum generated for a first page of the free space cache matches a checksum stored in the file system and associated with the free space cache, and adding entries stored in the on-disk free space cache to an in-memory free space cache for the block group kept in volatile memory of a computing device, wherein the on-disk free space cache is stored in persistent data storage indexed by a file system of the computing device. |
主权项 |
1. A method, comprising:
determining, by a processing device of a computing device, that a free space cache inode generation number stored in a free space cache inode of an on-disk free space cache of a block group is valid, wherein the on-disk free space cache is stored in persistent data storage indexed by a file system of the computing device; determining, by the processing device in view of determining that the free space cache inode generation number is valid, that a free space cache item generation number stored in a free space cache item of the on-disk free space cache is valid by comparing the free space cache item generation number to the free space cache inode generation number; determining, by the processing device in view of determining that the free space cache item generation number is valid, that a free space cache header generation number stored in a free space cache header of the on-disk free space cache is valid by comparing the free space cache header generation number to the free space cache item generation number; determining, by the processing device in view of determining that the free space cache header generation number is valid, that a checksum generated for a first page of the on-disk free space cache matches a stored checksum corresponding to the on-disk free space cache, wherein the stored checksum is stored in the file system; and adding, by the processing device, entries stored in the on-disk free space cache to an in-memory free space cache for the block group stored in volatile memory of the computing device. |