Direct or indirect mapping policy for data blocks of a file in a file system
First Claim
1. A method of operating a file server for read or write access to data of a file, the file including multiple data blocks containing data of the file, and the file further including an inode containing metadata of the file, said method comprising:
- reading or writing to the file when the file is organized in a direct mapping state in which a logical extent of the file is mapped to the multiple data blocks of the file without access to any indirect block of the file;
converting the file from the direct mapping state to an indirect mapping state by converting mapping information for the file in the direct mapping state to mapping information for the file in the indirect mapping state, the mapping information for the file in the indirect mapping state including at least one indirect block of the file, said at least one indirect block of the file mapping a portion of the logical extent of the file to some of the multiple data blocks of the file; and
thenreading or writing to the file once the file has been converted from the direct mapping state to the indirect mapping state by accessing said at least one indirect block to obtain mapping information for reading data from or writing data to at least one of the data blocks of the file;
wherein the inode of the file includes a mapping flag indicating whether the file is organized in the direct mapping state or the indirect mapping state, and wherein the method further includes the file server responding to a request for access to a specified offset in the file by accessing the mapping flag to select either a direct mapping procedure for mapping the specified offset to a respective one of the data blocks containing data of the file or an indirect mapping procedure for mapping the specified offset to a respective one of the data blocks containing data of the file.
9 Assignments
0 Petitions
Accused Products
Abstract
A file is initially created to have metadata and a data block allocation for direct mapping without access to any indirect blocks. Therefore file access performance is increased because the direct mapping eliminates delay otherwise caused by fetching one or more indirect blocks. When needed, the functionality enabled by indirect mapping is provided by creating an indirect mapping for the file and then accessing the file using the indirect mapping. When the functionality enabled by the indirect mapping is no longer needed, the file is reorganized to a direct mapping and then accessed using the direct mapping. For example, a container file for a network attached SCSI LUN is created and accessed without a performance degradation until conversion to an indirect mapping occurs automatically and seamlessly upon activation of a supplementary storage service such as a file-based snapshot copy and replication facility.
44 Citations
6 Claims
-
1. A method of operating a file server for read or write access to data of a file, the file including multiple data blocks containing data of the file, and the file further including an inode containing metadata of the file, said method comprising:
-
reading or writing to the file when the file is organized in a direct mapping state in which a logical extent of the file is mapped to the multiple data blocks of the file without access to any indirect block of the file; converting the file from the direct mapping state to an indirect mapping state by converting mapping information for the file in the direct mapping state to mapping information for the file in the indirect mapping state, the mapping information for the file in the indirect mapping state including at least one indirect block of the file, said at least one indirect block of the file mapping a portion of the logical extent of the file to some of the multiple data blocks of the file; and
thenreading or writing to the file once the file has been converted from the direct mapping state to the indirect mapping state by accessing said at least one indirect block to obtain mapping information for reading data from or writing data to at least one of the data blocks of the file; wherein the inode of the file includes a mapping flag indicating whether the file is organized in the direct mapping state or the indirect mapping state, and wherein the method further includes the file server responding to a request for access to a specified offset in the file by accessing the mapping flag to select either a direct mapping procedure for mapping the specified offset to a respective one of the data blocks containing data of the file or an indirect mapping procedure for mapping the specified offset to a respective one of the data blocks containing data of the file.
-
-
2. A method of operating a file server for read or write access to data of a file, the file including multiple data blocks containing data of the file, and the file further including an inode containing metadata of the file, said method comprising:
-
reading or writing to the file when the file is organized in a direct mapping state in which a logical extent of the file is mapped to the multiple data blocks of the file without access to any indirect block of the file; converting the file from the direct mapping state to an indirect mapping state by converting mapping information for the file in the direct mapping state to mapping information for the file in the indirect mapping state, the mapping information for the file in the indirect mapping state including at least one indirect block of the file, said at least one indirect block of the file mapping a portion of the logical extent of the file to some of the multiple data blocks of the file; and
thenreading or writing to the file once the file has been converted from the direct mapping state to the indirect mapping state by accessing said at least one indirect block to obtain mapping information for reading data from or writing data to at least one of the data blocks of the file; which further includes the file server responding to a request for a snapshot copy of the file by checking whether the file is in the direct mapping state, and upon finding that the file is in the direct mapping state, converting the file from the direct mapping state to the indirect mapping state, and then initiating a snapshot copy of the file in the indirect mapping state.
-
-
3. A method of operating a file server for read or write access to data of a file, the file including multiple data blocks containing data of the file, and the file further including an inode containing metadata of the file, said method comprising:
-
reading or writing to the file when the file is organized in a direct mapping state in which a logical extent of the file is mapped to the multiple data blocks of the file without access to any indirect block of the file; converting the file from the direct mapping state to an indirect mapping state by converting mapping information for the file in the direct mapping state to mapping information for the file in the indirect mapping state, the mapping information for the file in the indirect mapping state including at least one indirect block of the file, said at least one indirect block of the file mapping a portion of the logical extent of the file to some of the multiple data blocks of the file; and
thenreading or writing to the file once the file has been converted from the direct mapping state to the indirect mapping state by accessing said at least one indirect block to obtain mapping information for reading data from or writing data to at least one of the data blocks of the file; which further includes the file server responding to a request to terminate a process of making snapshot copies of the file when the file is in the indirect mapping state by checking whether the file is of a type that should be converted back to the direct mapping state upon termination of the process of making snapshot copies of the file when the file is in the indirect mapping state, and upon finding that the file is of a type that should be converted back to the direct mapping state upon termination of the process of making snapshot copies of the file when the file is in the indirect mapping state, converting the file back to the direct mapping state upon termination of the process of making snapshot copies of the file when the file is in the indirect mapping state.
-
-
4. A file server comprising:
-
data storage for storing a file system; and at least one central processing unit coupled to the data storage for providing a client with access to at least one file in the file system, the file including multiple data blocks containing data of the file, and the file further including an inode containing metadata of the file; wherein said at least one central processing unit is programmed for reading or writing to the file when the file is organized in a direct mapping state in which a logical extent of the file is mapped to the multiple data blocks of the file without access to any indirect block of the file; wherein said at least one central processing unit is further programmed for converting the file from the direct mapping state to an indirect mapping state by converting the mapping information for the file in the direct mapping state to mapping information for the file in the indirect mapping state, the mapping information for the file in the indirect mapping state including at least one indirect block of the file, said at least one indirect block of the file mapping a portion of the logical extent of the file to some of the multiple data blocks of the file when the file is in the indirect mapping state; wherein said at least one central processing unit is further programmed for reading or writing to the file once the file has been converted to the indirect mapping state by accessing said at least one indirect block to obtain mapping information for reading data from or writing data to at least one of the data blocks of the file; and wherein the inode of the file includes a mapping flag indicating whether the file is organized either in the direct mapping state or in the indirect mapping state, and wherein said at least one central processing unit is further programmed for responding to a request for access to a specified offset in the file by accessing the mapping flag to select either a direct mapping procedure for mapping the specified offset to a respective one of the data blocks containing data of the file or an indirect mapping procedure for mapping the specified offset to a respective one of the data blocks containing data of the file.
-
-
5. A file server comprising:
-
data storage for storing a file system; and at least one central processing unit coupled to the data storage for providing a client with access to at least one file in the file system, the file including multiple data blocks containing data of the file, and the file further including an inode containing metadata of the file; wherein said at least one central processing unit is programmed for reading or writing to the file when the file is organized in a direct mapping state in which a logical extent of the file is mapped to the multiple data blocks of the file without access to any indirect block of the file; wherein said at least one central processing unit is further programmed for converting the file from the direct mapping state to an indirect mapping state by converting the mapping information for the file in the direct mapping state to mapping information for the file in the indirect mapping state, the mapping information for the file in the indirect mapping state including at least one indirect block of the file, said at least one indirect block of the file mapping a portion of the logical extent of the file to some of the multiple data blocks of the file when the file is in the indirect mapping state; wherein said at least one central processing unit is further programmed for reading or writing to the file once the file has been converted to the indirect mapping state by accessing said at least one indirect block to obtain mapping information for reading data from or writing data to at least one of the data blocks of the file; and wherein said at least one central processing unit is further programmed for responding to a request for a snapshot copy of the file by checking whether the file is in the direct mapping state, and upon finding that the file is in the direct mapping state, converting the file from the direct mapping state to the indirect mapping state, and then initiating a snapshot copy of the file in the indirect mapping state.
-
-
6. A file server comprising:
-
data storage for storing a file system; and at least one central processing unit coupled to the data storage for providing a client with access to at least one file in the file system, the file including multiple data blocks containing data of the file, and the file further including an inode containing metadata of the file; wherein said at least one central processing unit is programmed for reading or writing to the file when the file is organized in a direct mapping state in which a logical extent of the file is mapped to the multiple data blocks of the file without access to any indirect block of the file; wherein said at least one central processing unit is further programmed for converting the file from the direct mapping state to an indirect mapping state by converting the mapping information for the file in the direct mapping state to mapping information for the file in the indirect mapping state, the mapping information for the file in the indirect mapping state including at least one indirect block of the file, said at least one indirect block of the file mapping a portion of the logical extent of the file to some of the multiple data blocks of the file when the file is in the indirect mapping state; wherein said at least one central processing unit is further programmed for reading or writing to the file once the file has been converted to the indirect mapping state by accessing said at least one indirect block to obtain mapping information for reading data from or writing data to at least one of the data blocks of the file; and wherein said at least one central processing unit is further programmed for responding to a request to terminate a process of making snapshot copies of the file when the file is in the indirect mapping state by checking whether the file is of a type that should be converted back to the direct mapping state upon termination of the process of making snapshot copies of the file when the file is in the indirect mapping state, and upon finding that the file is of a type that should be converted back to the direct mapping state upon termination of the process of making snapshot copies of the file when the file is in the indirect mapping state, converting the file back to the direct mapping state upon termination of the process of making snapshot copies of the file when the file is in the indirect mapping state.
-
Specification