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.
2 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.
-
Citations
22 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. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. 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. - View Dependent Claims (8, 9, 10, 11, 12, 13)
-
-
14. 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. - View Dependent Claims (15, 16, 17, 18, 19, 20)
-
-
21. 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 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, and which further includes setting in the virtual block metadata an indication of a portion of the file system data block that stores the compressed data for the first file, and wherein the setting of the indication of the portion of the file system data block that stores the compressed data for the first file is performed by setting bits in a sector bitmap in the virtual block metadata so that the sector bitmap indicates sectors of the file system data block that store the compressed data for the first file, and wherein the compressed data for the first file has a number of sectors, and step (b) includes searching for a file system data block that is partially filled with file data and has a number of free sectors of at least the number of sectors of the compressed data for the first file.
-
-
22. 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 the compressed data for the first file has a number of sectors; step (b) includes searching for a file system data block that is partially filled with file data and has a number of free sectors of at least the number of sectors of the compressed data for the first file; and 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 bits in a sector bitmap in the virtual block metadata so that the sector bitmap indicates sectors of the file system data block that store the compressed data for the first file.
-
Specification