# US 10,372,336 B2 · File access method, system, and host

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 10,372,336 B2
- Document ID: US10372336B2
- Status: Granted
- Kind: B2
- Application number: 15/582,283
- Filed: 2017-04-28
- Published: 2017-08-17
- Granted: 2019-08-06
- Earliest claimed: 2014-10-31
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Jun Xu; Yuangang Wang; Guanyu Zhu
- Web page: https://patentgrep.com/patent/US10372336B2

## CPC

- G06F 3/0608: {Saving storage space on storage systems}
- G06F 3/061: {Improving I/O performance}
- G06F 3/0631: {by allocating resources to storage systems}
- G06F 3/0643: {Management of files}
- G06F 3/0644: {Management of space entities, e.g. partitions, extents, pools}
- G06F 3/067: {Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]}
- G06F 9/5016: {the resource being the memory}
- G06F 12/023: {Free address space management}
- G06F 16/13: File access structures, e.g. distributed indices (arrangements of input from, or output to, record carriers G06F3/06)
- G06F 17/00: Digital computing or data processing equipment or methods, specially adapted for specific functions (information retrieval, database structures or file system structures therefor G06F16/00)
- G06F 16/183: {Provision of network file services by network file servers, e.g. by using NFS, CIFS (network file access protocols H04L67/1097)}
- G06F 2212/1044: Space efficiency improvement
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A file access method, a system, and a host are provided. According to the method, after obtaining information about first virtual space of a target file, a host allocates, in local virtual address space of the host, second virtual space to the target file, where the first virtual space is space allocated in global virtual address space by a management node in a distributed storage system to the target file. The host converts, according to a correspondence between the first virtual space and the second virtual space, a second access request of accessing the second virtual space into a first access request, where an address of the first virtual space in the first access request includes device information of a first storage node. Then, the host sends the first access request to a network device to route the first access request to the first storage node.

## Claims

### Claim 1

A file access method comprises:
obtaining, by a host, information of a first virtual space of a to-be-accessed target file, wherein the first virtual space is space allocated in a global virtual address space by a management node of a distributed storage system to the to-be-accessed target file, the distributed storage system comprising the management node, multiple storage nodes, and a network device, wherein local virtual address space of each storage node in the distributed storage system is corresponding to a part of the global virtual address space of the distributed storage system;
allocating, by the host in a local virtual address space of the host, second virtual space to the to-be-accessed target file according to the information of the first virtual space;
converting, by the host according to a correspondence between the first virtual space and the second virtual space, a second access request of accessing the second virtual space into a first access request of accessing the first virtual space, wherein the first access request comprises an address of the first virtual space, and the address of the first virtual space comprises device information of a first storage node, and the first storage node is a storage node that is in the multiple storage nodes and stores the to-be-accessed target file, and wherein a bit quantity of the address of the first virtual space is 2N, and N is a bit quantity of an address of local virtual address space of the first storage node, and N most significant bits of the address of the first virtual space comprise the device information of the first storage node, and N least significant bits of the address of the first virtual space are the address of the local virtual address space that is in the first storage node and that is used to store the to-be-accessed target file; and
sending, by the host, the first access request to the network device, causing the network device to route the first access request to the first storage node according to the device information of the first storage node in the address of the first virtual space.

### Claim 2 (depends on 1)

The method according to claim 1, wherein obtaining the information of the first virtual space comprises:
obtaining, by the host, the information of the first virtual space of the to-be-accessed target file from metadata of the to-be-accessed target file.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the information of the first virtual space comprises a first start address and a size of the first virtual space.

### Claim 4 (depends on 3)

The method according to claim 3, wherein allocating the second virtual space comprises:
allocating, by the host in the local virtual address space of the host, the second virtual space to the to-be-accessed target file, wherein a second size of the second virtual space equals a first size of the first virtual space.

### Claim 5 (depends on 4)

The method according to claim 4, further comprising:
establishing, by the host, a correspondence between the first virtual space and the second virtual space:
LVA=(GVA−GVA_start)+LVA_start,
wherein GVA_start represents the first start address of the first virtual space, LVA_start represents a second start address of the second virtual space, GVA represents the address of the first virtual space, and LVA represents a corresponding address of the second virtual space corresponding to the address of the first virtual space.

### Claim 6

A system comprising:
a distributed storage system comprising a management node, multiple storage nodes, and a network device, wherein local virtual address space of each storage node in the distributed storage system is corresponding to a part of a global virtual address space of the distributed storage system; and
a host comprising a processor, a memory storing a program to be executed by the processor, the program comprising instructions for:
obtaining information of a first virtual space of a to-be-accessed target file, wherein the first virtual space is space allocated in the global virtual address space by the management node to the to-be-accessed target file;
allocating, in a local virtual address space of the host, second virtual space to the to-be-accessed target file according to the information of the first virtual space;
converting, according to a correspondence between the first virtual space and the second virtual space, a second access request of accessing the second virtual space into a first access request of accessing the first virtual space, wherein the first access request comprises an address of the first virtual space, and the address of the first virtual space comprises device information of a first storage node, and the first storage node is a storage node that is in the multiple storage nodes and stores the to-be-accessed target file, and wherein a bit quantity of the address of the first virtual space is 2N, and N is a bit quantity of an address of local virtual address space of the first storage node, and N most significant bits of the address of the first virtual space comprise the device information of the first storage node, and N least significant bits of the address of the first virtual space are the address of the local virtual address space that is in the first storage node and that is used to store the to-be-accessed target file; and
sending the first access request to the network device, causing the network device to route the first access request to the first storage node according to the device information of the first storage node in the address of the first virtual space.

### Claim 7 (depends on 6)

The system according to claim 6, wherein the program comprises further instructions for:
obtaining the information about of the first virtual space of the to-be-accessed target file from metadata of the to-be-accessed target file.

### Claim 8 (depends on 6)

The system according to claim 6, wherein the information of the first virtual space comprises a first start address and a size of the first virtual space.

### Claim 9 (depends on 8)

The system according to claim 8, wherein the program comprises further instructions for:
allocating, in the local virtual address space of the host, the second virtual space having a same size as the first virtual space to the to-be-accessed target file.

### Claim 10 (depends on 9)

The system according to claim 9, wherein the program comprises further instructions for:
establishing a correspondence between the first virtual space and the second virtual space:
LVA=(GVA−GVA_start)+LVA_start,
wherein GVA_start represents the first start address of the first virtual space, LVA_start represents a second start address of the second virtual space, GVA represents the address of the first virtual space, and LVA represents a corresponding address of the second virtual space corresponding to the address of the first virtual space.

### Claim 11

A host comprising:
a processor;
a memory storing a program to be executed by the processor, the program comprising instructions for:
obtaining information of a first virtual space of a to-be-accessed target file, wherein the first virtual space is space allocated in a global virtual address space of a distributed storage system by a management node in the distributed storage system to the to-be-accessed target file, and local virtual address space of each storage node in the distributed storage system is corresponding to a part of the global virtual address space;
allocating, in a local virtual address space of the host, second virtual space to the to-be-accessed target file according to the information of the first virtual space; and
converting, according to a correspondence between the first virtual space and the second virtual space, a second access request of accessing the second virtual space into a first access request of accessing the first virtual space, wherein the first access request comprises an address of the first virtual space, the address of the first virtual space comprises device information of a first storage node, and the first storage node is a storage node that is in multiple storage nodes and stores the to-be-accessed target file, and wherein a bit quantity of the address of the first virtual space is 2N, and N is a bit quantity of an address of local virtual address space of the first storage node, and N most significant bits of the address of the first virtual space comprise the device information of the first storage node, and N least significant bits of the address of the first virtual space are the address of the local virtual address space that is in the first storage node and that is used to store the to-be-accessed target file; and
a network interface, coupled to the processor and configured to send the first access request to a network device in the distributed storage system, wherein the network device routes the first access request to the first storage node according to the device information of the first storage node in the address of the first virtual space.

### Claim 12 (depends on 11)

The host according to claim 11, wherein the program comprises further instructions for:
obtaining the information of the first virtual space of the to-be-accessed target file from metadata of the to-be-accessed target file.

### Claim 13 (depends on 11)

The host according to claim 11, wherein the information of the first virtual space comprises a first start address and a size of the first virtual space.

### Claim 14 (depends on 13)

The host according to claim 13, wherein the program comprises further instructions for:
allocating, in the local virtual address space of the host, the second virtual space having a same size as the first virtual space to the to-be-accessed target file.

### Claim 15 (depends on 14)

The host according to claim 14, wherein the program comprises further instructions for:
establishing a correspondence between the first virtual space and the second virtual space:
LVA=(GVA−GVA_start)+LVA_start,
wherein GVA_start represents the first start address of the first virtual space, LVA_start represents a second start address of the second virtual space, GVA represents the address of the first virtual space, and LVA represents a corresponding address of the second virtual space corresponding to the address of the first virtual space.
