Method for on-demand block map generation for direct mapped LUN
AssigneeEMC Corporation
InventorsSairam Veeraswamy, Morgan A. Clark
Life of this patent
Estimating the term…
Abstract
This invention is a system and a method for operating a storage server in a data network using a new architecture. The method of creating the partial block map allows the snapshot writes on a direct mapped file. The method of reading data or writing data to the file created in direct mapping state and later converted to partial mapping state responsive to a copy on first write request by a client allocates new indirect block when needed to store the reference to newly allocated data block. The method of reading data from or writing data to the file in partial mapping state involves checking the mapping bit to find if the indirect block is in direct mapping state.
Claims14
A method of operating a storage server in a data network for read or write access to data of a file, the file including a set of data blocks containing data of the file, and the file further including an inode containing metadata of the file, the method comprising the steps of:
- creating the file in a direct mapped mode, wherein the direct mapped mode indicates that an address of each data block of the set of data blocks of the file is arithmetically computed by using a pre-defined function, wherein each data block of the set of data blocks is allocated on the storage server at the time the file is created;
- responsive to a write request directed to the file in the direct mapped mode by a client of the storage server to write to a new data block, converting the file from the direct mapped mode to a partial mapped mode by allocating a new indirect block, wherein the new indirect block includes a set of data block pointers, wherein an address of the new data block is stored in a data block pointer of the set of data block pointers of the new indirect block;
- and
- performing an I/O request on the file in the partial mapped mode, wherein the I/O request includes reading to the file and writing to the file, wherein the partial mapped mode indicates that a first portion of the file is in an indirect mapped mode and a second portion of the file is in the direct mapped mode, wherein data of the first portion of the file in the indirect mapped mode is accessed by performing an address lookup operation;
- wherein the inode of the file includes an inode mapping flag, wherein the inode mapping flag indicates whether the file is in the direct mapped mode, wherein the inode mapping flag of the file in the direct mapped mode indicates that an address of each data block of the set of data blocks of the file is arithmetically computed by using the pre-defined function;
- wherein the inode of the file includes a set of indirect block pointers, wherein each indirect block pointer of the set of indirect block pointers includes an indirect block mapping flag and a set of data block pointers, wherein the indirect block mapping flag of each indirect block pointer of the set of indirect block pointers indicates whether the indirect block pointer is in a direct mapped state, wherein the direct mapped state indicates that each data block pointer of the set of data block pointers of the indirect block pointer is arithmetically computed by using the pre-defined function.
A method of operating a storage server in a data network for read or write access to data of a file, the file including a set of data blocks containing data of the file, and the file further including an inode containing metadata of the file, the method comprising the steps of:
- creating the file in a direct mapped mode, wherein the direct mapped mode indicates that an address of each data block of the set of data blocks of the file is arithmetically computed by using a pre-defined function, wherein each data block of the set of data blocks is allocated on the storage server at the time the file is created;
- responsive to a write request directed to the file in the direct mapped mode by a client of the storage server to write to a new data block, converting the file from the direct mapped mode to a partial mapped mode by allocating a new indirect block, wherein the new indirect block includes a set of data block pointers, wherein an address of the new data block is stored in a data block pointer of the set of data block pointers of the new indirect block;
- and
- performing an I/O request on the file in the partial mapped mode, wherein the I/O request includes reading to the file and writing to the file, wherein the partial mapped mode indicates that a first portion of the file is in an indirect mapped mode and a second portion of the file is in the direct mapped mode, wherein data of the first portion of the file in the indirect mapped mode is accessed by performing an address lookup operation;
- and
- converting the file from the partial mapped mode to the direct mapped mode by performing an unwinding operation, wherein the unwinding operation includes processing each indirect pointer of a set of indirect block pointers stored in the inode of the file and converting each indirect block pointer of the set of indirect block pointers from a partial mapped state to a direct mapped state;
- wherein the inode of the file includes an inode mapping flag, wherein the inode mapping flag indicates whether the file is in the direct mapped mode, wherein the inode mapping flag of the file in the direct mapped mode indicates that an address of each data block of the set of data blocks of the file is arithmetically computed by using the pre-defined function;
- wherein the inode of the file includes a set of indirect block pointers, wherein each indirect block pointer of the set of indirect block pointers includes an indirect block mapping flag and a set of data block pointers, wherein the indirect block mapping flag of each indirect block pointer of the set of indirect block pointers indicates whether the indirect block pointer is in a direct mapped state, wherein the direct mapped state indicates that each data block pointer of the set of data block pointers of the indirect block pointer is arithmetically computed by using the pre-defined function.
A computer program product for operating on a storage server in a data network for read or write access to data of a file, wherein the file includes a set of data block that contain data of the file and an inode containing metadata of the file, wherein the program product includes computer-executable logic which is in communication with the storage server and the secondary storage, and which is encoded on a non-transitory computer-readable medium, for executing the following steps:
- creating the file in a direct mapped mode, wherein the direct mapped mode indicates that an address of each data block of the set of data blocks of the file is arithmetically computed by using a pre-defined function, wherein each data block of the set of data blocks is allocated on the storage server at the time the file is created;
- responsive to a write request directed to the file in the direct mapped mode by a client of the storage server to write to a new data block, converting the file from the direct mapped mode to a partial mapped mode by allocating a new indirect block, wherein the new indirect block includes a set of data block pointers, wherein an address of the new data block is stored in a data block pointer of the set of data block pointers of the new indirect block;
- and
- performing an I/O request on the file in the partial mapped mode, wherein the I/O request includes reading to the file and writing to the file, wherein the partial mapped mode indicates that a first portion of the file is in an indirect mapped mode and a second portion of the file is in the direct mapped mode, wherein data of the first portion of the file in the indirect mapped mode is accessed by performing an address lookup operation;
- wherein the inode of the file includes an inode mapping flag, wherein the inode mapping flag indicates whether the file is in the direct mapped mode, wherein the inode mapping flag of the file in the direct mapped mode indicates that an address of each data block of the set of data blocks of the file is arithmetically computed by using the pre-defined function;
- wherein the inode of the file includes a set of indirect block pointers, wherein each indirect block pointer of the set of indirect block pointers includes an indirect block mapping flag and a set of data block pointers, wherein the indirect block mapping flag of each indirect block pointer of the set of indirect block pointers indicates whether the indirect block pointer is in a direct mapped state, wherein the direct mapped state indicates that each data block pointer of the set of data block pointers of the indirect block pointer is arithmetically computed by using the pre-defined function.
Dependencies are inferred from the claim text.