Method and apparatus for compressing data in a file system
First Claim
Patent Images
1. A method for storing a file comprising:
- receiving a request to store the file in a storage pool,obtaining and compressing a first portion of the file to obtain a first compressed data block;
obtaining and compressing a second portion of the file to a second compressed data block;
generating a first compressing header for the first compressed data block;
generating a second compression header for the second compressed data block;
combining the first compressed data block and the first compression header to obtain a first compressed data block package;
storing the first compressed data block package in a storage pool at a first location;
combining the second compressed data block and the second compression header to obtain a second compressed data block package;
storing the second compressed data block package in the storage pool at a second location;
calculating a first checksum for the first compressed data block;
calculating a second checksum for the second compressed data block; and
building a first indirect block comprising the first location, the first checksum, the second location, and the second checksum, a first set compression flag indicating that the first location comprises the first compressed data block, and a second set compression flag indicating that the second location comprises the second compressed data block;
storing the first indirect block in the storage pool at a third location;
building a second indirect block comprising the third location and a first non-set compression flag indicating that the third location includes an uncompressed first indirect block; and
storing the second indirect block in the storage pool at a fourth location,wherein the first location, second location, third location, and fourth location are separate physical locations in the storage pool,wherein the first indirect block and the second indirect block are used to obtain the first compressed data block and the second compressed data block during a read operation.
2 Assignments
0 Petitions
Accused Products
Abstract
A method for storing a data block, comprising compressing the data block using a first compression algorithm to obtain a compressed data block, generating a data block compression header, combining the compressed data and the data compression header to obtain a compressed data block package, storing the compressed data block package in a storage pool, obtaining a compressed data block package location, calculating a data block checksum for the compressed data block, and storing a first indirect block in the storage pool, wherein the first indirect block comprises the compressed data block package location, the data block checksum, and a compression flag.
98 Citations
12 Claims
-
1. A method for storing a file comprising:
-
receiving a request to store the file in a storage pool, obtaining and compressing a first portion of the file to obtain a first compressed data block; obtaining and compressing a second portion of the file to a second compressed data block; generating a first compressing header for the first compressed data block; generating a second compression header for the second compressed data block; combining the first compressed data block and the first compression header to obtain a first compressed data block package; storing the first compressed data block package in a storage pool at a first location; combining the second compressed data block and the second compression header to obtain a second compressed data block package; storing the second compressed data block package in the storage pool at a second location; calculating a first checksum for the first compressed data block; calculating a second checksum for the second compressed data block; and building a first indirect block comprising the first location, the first checksum, the second location, and the second checksum, a first set compression flag indicating that the first location comprises the first compressed data block, and a second set compression flag indicating that the second location comprises the second compressed data block; storing the first indirect block in the storage pool at a third location; building a second indirect block comprising the third location and a first non-set compression flag indicating that the third location includes an uncompressed first indirect block; and storing the second indirect block in the storage pool at a fourth location, wherein the first location, second location, third location, and fourth location are separate physical locations in the storage pool, wherein the first indirect block and the second indirect block are used to obtain the first compressed data block and the second compressed data block during a read operation. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A computer system for storing a file comprising:
-
a processor; a memory; a storage device; and software instructions stored in the memory for enabling the computer system under control of the processor, to; receive a request to store the file in the storage pool, obtain and compress a first portion of the file to obtain a first compressed data block; obtain and compress a second portion of the file to a second compressed data block; generate a first compression header for the first compressed data block; generate a second compression header for the compressed data block; combine the first compressed data block and the first compression header to obtain a first compressed data block package; store the first compressed data block package in a storage pool at a first location; combine the second compressed data block and the second compression header to obtain a second compressed data block package; store the second compressed data block package in the storage pool at a second location; calculate a first checksum for the first compressed data block; calculate a second checksum for the second compressed data block; and build a first indirect block comprising the first location, the first checksum, the second location, and the second checksum, a first set compression flag indicating the first location comprises the first compressed data block, and a second set compression flag indicating that the second location comprises the second compressed data block; store the first indirect block in the storage pool at a third location; build a second indirect block comprising the third location and a first non-set compression flag indicating that the third location includes an uncompressed first indirect block; and store the second indirect block in the storage pool at a fourth location, wherein the first location, second location, third location, and fourth location are separate physical locations in the storage pool, wherein the first indirect block and the second indirect block are used to obtain the first compressed data block and the second compressed data block during a read operation. - View Dependent Claims (8, 9, 10, 11, 12)
-
Specification