Partial block allocation for file system block compression using virtual block metadata
First Claim
1. A method of operating a file server, the file server having data storage storing a file system, a data processor coupled to the data storage for access to files in the file system, and non-transitory computer readable storage medium coupled to the data processor and storing computer instructions, and the computer instructions, when executed by the data processor, perform a method of writing a new block of data to a first file in the file system by the steps of:
- (a) compressing the new block of data to produce compressed data for the first file;
(b) finding a file system data block containing compressed data of a second file in the file system and having sufficient free space for storage of the compressed data for the first file;
(c) writing the compressed data for the first file to the free space of the file system data block; and
(d) linking the compressed data for the first file to the first file;
wherein step (d) includes allocating storage for virtual block metadata about the compressed data for the first file, setting a pointer the file system data block in the virtual block metadata, and setting a pointer to the storage for the virtual block metadata in file mapping metadata of the first file; and
further includes incrementing a reference count for the file system data block, and setting a reference count in the virtual block metadata.
9 Assignments
0 Petitions
Accused Products
Abstract
A file server has a data compression facility and also a snapshot copy facility or a data de-duplication facility that shares data blocks among files. Compression of the file data on a file system block basis leads to a problem of partially used file system data blocks when the data blocks are shared among files. This problem is solved by partial block allocation so that file system data blocks are shared among files that do not share identical data. Block pointers in the file mapping metadata point to virtual blocks representing the compressed data blocks, and associated virtual block metadata identifies portions of file system data blocks that store the compressed data. For example, a portion of a file system data block is identified by a sector bitmap, and the virtual block metadata also includes a reference count to indicate sharing of a compressed data block among files.
58 Citations
14 Claims
-
1. A method of operating a file server, the file server having data storage storing a file system, a data processor coupled to the data storage for access to files in the file system, and non-transitory computer readable storage medium coupled to the data processor and storing computer instructions, and the computer instructions, when executed by the data processor, perform a method of writing a new block of data to a first file in the file system by the steps of:
-
(a) compressing the new block of data to produce compressed data for the first file; (b) finding a file system data block containing compressed data of a second file in the file system and having sufficient free space for storage of the compressed data for the first file; (c) writing the compressed data for the first file to the free space of the file system data block; and (d) linking the compressed data for the first file to the first file; wherein step (d) includes allocating storage for virtual block metadata about the compressed data for the first file, setting a pointer the file system data block in the virtual block metadata, and setting a pointer to the storage for the virtual block metadata in file mapping metadata of the first file; and
further includes incrementing a reference count for the file system data block, and setting a reference count in the virtual block metadata. - View Dependent Claims (2, 3, 4)
-
-
5. A file server comprising:
-
data storage storing a file system, a data processor coupled to the data storage for access to files in the file system, and non-transitory computer readable storage medium coupled to the data processor and storing computer instructions, wherein the computer instructions, when executed by the data processor, perform a method of writing a new block of data to a first file in the file system by the steps of; (a) compressing the new block of data to produce compressed data for the first file; (b) finding a file system data block containing compressed data of a second file in the file system and having sufficient free space for storage of the compressed data for the first file; (c) writing the compressed data for the first file to the free space of the file system data block; and (d) linking the compressed data for the first file to the first file; wherein step (d) includes allocating storage for virtual block metadata about the compressed data for the first file, setting a pointer to the file system data block in the virtual block metadata, and setting a pointer to the storage for the virtual block metadata in the mapping metadata of the first file; wherein the computer instructions, when executed by the data processor, increment a reference count for the file system data block, and set a reference count in the virtual block metadata. - View Dependent Claims (6, 7, 8, 9)
-
-
10. A computer program product comprising non-transitory computer readable storage medium containing computer instructions that, when executed by a
data processor of a file server, perform a method of writing a new block of data to a first file in a file system by the steps of: -
(a) compressing the new block of data to produce compressed data for the first file; (b) finding a file system data block containing compressed data of a second file in the file system and having sufficient free space for storage of the compressed data for the first file; (c) writing the compressed data for the first file to the free space of the file system data block; and (d) linking the compressed data for the first file to the first file; wherein step (d) includes allocating storage for virtual block metadata about the compressed data for the first file, setting a pointer to the file system data block in the virtual block metadata, and setting a pointer to the storage for the virtual block metadata in file mapping metadata of the first file; wherein the computer instructions, when executed by the data processor, increment a reference count for the file system data block, and set a reference count in the virtual block metadata. - View Dependent Claims (11, 12, 13, 14)
-
Specification