Patent ID: 7822791

Claim:
A system, comprising: a flash memory comprising a plurality of flash memory blocks; and a managing logic to manage a file operation related to the flash memory, wherein during a foreground reclaim of the flash memory which is triggered by the file operation, the managing logic is further to: select a foreground reclaim block from the plurality of flash memory blocks; search the foreground reclaim block for valid data; and copy the valid data from the foreground reclaim block to a flash memory block of the plurality of flash memory blocks, if the valid data is found, and wherein during a next reclaim of the flash memory, the managing logic is further to erase the foreground reclaim block; wherein, the managing logic is further to determine whether the next reclaim of the flash memory is a background reclaim or a next foreground reclaim, wherein the background reclaim is not triggered by any file operations; and if the next reclaim is the background reclaim, then during the background reclaim and after the erasing of the foreground reclaim block, the managing logic is further to: select a background reclaim block from the plurality of flash memory blocks, search the background reclaim block for valid data, copy the valid data from the background reclaim block to the foreground reclaim block if the valid data is found, and erase the background reclaim block.