Patent ID: 9047299
Filing Date: 2015-06-02
Classification: G06F

Abstract:
1. A method of managing filesystem blocks of a filesystem, the method comprising: modifying an inode structure which identifies a filesystem directory, the inode structure currently including a set of filesystem blocks which was allocated to the inode structure to hold filesystem data; after modifying the inode structure, performing a directory check operation to determine whether the filesystem directory is empty; and reclaiming, from the inode structure, the set of filesystem blocks which was allocated to the inode structure to hold the filesystem data when a result of the directory check operation indicates that the filesystem directory is empty, and not reclaiming the set of filesystem blocks from the inode structure when the result of the directory check operation indicates that the filesystem directory is not empty; wherein the inode structure includes a type of file field which stores a directory type indicator indicating that the inode structure identifies a filesystem directory; and wherein reclaiming the set of filesystem blocks includes: copying contents of the inode structure to a new inode structure, overwriting, in a type of file field of the new inode structure, a copy of the directory type indicator with an ordinary type indicator to indicate that the new inode structure identifies an ordinary file, and submitting the new inode structure to a cleanup routine which processes the new inode structure as if an ordinary file has been deleted from the filesystem to return the set of filesystem blocks allocated to the inode structure to a pool of free filesystem blocks.