Patent ID: 8521949

Claim:
A method for deleting data, comprising: detecting, by a file system, a delete request for a target file that is stored on a solid-state disk (SSD); if the delete request is detected, examining a security property of the target file, wherein the security property of a file comprises a secret classified property; if the security property of the target file comprises the secret classified property: executing an overwrite operation on the target file, and executing a delete operation to delete the target file; wherein during the overwrite operation, the method further comprising: sending a write command to the SSD, the write command being a predefined write command which is expanded by adding an immediate scrubbing flag to cause the SSD to invoke a backstage garbage collection program according to the predefined write command, in order to immediately delete the data on garbage blocks corresponding to logical block addresses of the target file, wherein when the delete request for the target file is detected, but before the step of examining a security property of the target file, the method further comprising: setting the security property of the target file to the secret classified property; and storing the target file to the SSD, wherein storing the target file further comprising: changing the security property of the target file to the secret classified property; controlling the SSD to locate the garbage blocks which existed before the target file is changed to include the secret classified property; and controlling the SSD to invoke the backstage garbage collection program to immediately scrub the garbage blocks for satisfying a preset immediate scrubbing condition; wherein when a write operation to the target file is detected, the data is stored to the SSD according to the predefined write command; wherein invocation of the backstage garbage collection program comprising: traversing, according to current logical block addresses of the target file, reverse-mapping tables corresponding to all the garbage blocks to determine if the garbage blocks satisfying the preset immediate scrubbing condition; and invoking the backstage garbage collection program to immediately scrub the garbage blocks that have been determined as satisfying the preset immediate scrubbing condition.