Patent ID: 8285687

Claim:
A method for writing compressed data to storage devices of a storage system, the method comprising: receiving write data at the storage system comprising a processor and a memory; compressing the write data using a compression technique; determining whether the compressed data meets a predefined compression threshold, wherein the predefined compression threshold is met when a number of storage blocks used to store the compressed data is less than a predefined number of storage blocks; in response to determining that the compressed data meets the predefined compression threshold, generating a compression group comprising a header having a magic value indicating that the compression group comprises the compressed data, one or more pointers to the compressed data, and a footer; in response to determining that the compressed data does not meet the predefined compression threshold, generating the compression group comprising one or more pointers to the write data without compression; writing the compression group to the storage devices; receiving a read request, associated with data, at the storage system from a client; determining that the read request is directed to the compression group of a plurality of compression groups stored on the storage devices; determining if the magic value is in the header of the compression group; in response to determining that the magic value is in the header of the compression group, determining that the compression group contains the compressed data, decompressing the compressed data in the compression group, and returning the data, obtained from decompressing the compressed data, to the client; and in response to determining that the magic value is not in the header of the compression group, determining that the compression group does not contain the compressed data, and returning the data from the compression group to the client without performing a decompression operation.