# US 2025/0165152 A1 · File System-Based Metadata Management Method and Related Device Thereof

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

- Number: US 2025/0165152 A1
- Document ID: US20250165152A1
- Status: Published application
- Kind: A1
- Application number: 19/029,359
- Filed: 2025-01-17
- Published: 2025-05-22
- Earliest claimed: 2022-07-25
- Assignees: Huawei Cloud Computing Technologies Co., Ltd.
- Applicants: Huawei Cloud Computing Technologies Co., Ltd.
- Inventors: Ting Yao; Yiwen Zhang; Tingwei Zhu; Daohui Wang
- Web page: https://patentgrep.com/patent/US20250165152A1

## CPC

- G06F 3/0613: {in relation to throughput}
- G06F 16/14: Details of searching files based on file metadata
- G06F 3/0644: {Management of space entities, e.g. partitions, extents, pools}
- G06F 3/0673: {Single storage device}
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

A file system-based metadata management method, includes: obtaining a metadata obtaining request for M files in a directory, where the metadata obtaining request includes an inode number of the directory, and M≥2; detecting whether a first start address of a first non-volatile memory NVM area corresponding to the inode number of the directory exists, where the first NVM area is a contiguous memory area in an NVM; and when the first start address exists, obtaining M key-value pairs from the first NVM area based on the first start address, where an ith key-value pair in the M key-value pairs includes the inode number of the directory and metadata of an ith file, and i=1, . . . , M.

## Claims

### Claim 1

A method, wherein the method comprising:
obtaining a metadata obtaining request for M files in a directory, wherein the metadata obtaining request comprises an inode number of the directory, and wherein M≥2;
determining whether a first start address of a non-volatile memory (NVM) area corresponding to the inode number of the directory exists, wherein the NVM area is a contiguous memory area in an NVM; and
responsive to the first start address existing, obtaining M key-value pairs from the NVM area based on the first start address,
wherein an ith key-value pair in the M key-value pairs comprises the inode number of the directory and metadata of an ith file, and
wherein i=1, . . . , of M.

### Claim 2 (depends on 1)

The method according to claim 1, wherein in the ith key-value pair, the metadata of the ith file comprises only a name of the ith file and an inode number of the ith file.

### Claim 3 (depends on 2)

The method according to claim 2, further comprising:
obtaining a first metadata addition request for an (M+1)th file in the directory, wherein the first metadata addition request comprises an (M+1)th key-value pair, and wherein the (M+1)th key-value pair comprises the inode number of the directory, a name of the (M+1)th file, and an inode number of the (M+1)th file;
persistently storing the (M+1)th key-value pair in the NVM area based on the first start address of the first NVM area.

### Claim 4 (depends on 3)

The method according to claim 3, further comprising:
obtaining a second metadata addition request for an (M+1)th file in the directory, wherein the second metadata addition request comprises an (M+1)th key-value pair, and wherein the (M+1)th key-value pair comprises the inode number of the directory, a name of the (M+1)th file, and an inode number of the (M+1)th file;
determining the a second start address of a second NVM area corresponding to the inode number of the directory does not exist;
obtaining the second start address, wherein the second NVM area is a contiguous memory area in the NVM; and
persistently storing the ((M+1)th key-value pair in the second NVM area based on the second start address; and
constructing a correspondence between the inode number of the directory and the second start address.

### Claim 5 (depends on 3)

The method according to claim 3, wherein the NVM area comprises a second NVM area, wherein the second NVM area is for storing only the (M+1)th key-value pair, and wherein the method further comprises: constructing a correspondence between a key of the (M+1)th key-value pair and a second start address of the second NVM area, wherein the key of the (M+1)th key-value pair comprises the inode number of the directory and the name of the (M+1)th file.

### Claim 6 (depends on 2)

The method according to claim 2, further comprising:
obtaining a metadata obtaining request for the ith file in the directory, wherein the metadata obtaining request comprises a key of the ith key-value pair, and wherein the key of the ith key-value pair comprises the inode number of the directory and the name of the ith file;
determining a second start address of a second NVM area corresponding to the key of the ith key-value pair exists, wherein the NVM area comprises the second NVM area; and
obtaining the ith key-value pair from the second NVM area based on the second start address.

### Claim 7 (depends on 2)

The method according to claim 2, further comprising:
obtaining a metadata deletion request for the ith file in the directory, wherein the metadata deletion request comprises a key of the ith key-value pair, and wherein the key of the ith key-value pair comprises the inode number of the directory and the name of the ith file;
determining a second start address of a second NVM area corresponding to the key of the ith key-value pair exists, wherein the NVM area comprises the second NVM area; and
setting, based on the second start address, the ith key-value pair stored in the second NVM area to invalid data that cannot be obtained.

### Claim 8

A file system metadata management apparatus comprising:
a memory configured to stores code; and
a processor coupled to the memory and configured to execute the code, to enable the apparatus to:
obtain a metadata obtaining request for M files in a directory, wherein the metadata obtaining request comprises an inode number of the directory, and wherein M≥2;
determine whether a first start address of a non-volatile memory (NVM) area corresponding to the inode number of the directory exists, wherein the NVM area is a contiguous memory area in an NVM; and
responsive to the first start address existing, obtain M key-value pairs from the first NVM area based on the first start address of the NVM area,
wherein an ith key-value pair in the M key-value pairs comprises the inode number of the directory and metadata of an ith file, and
wherein i=1, . . . , M.

### Claim 9 (depends on 8)

The apparatus according to claim 8, wherein in the ith key-value pair, the metadata of the ith file comprises only a name of the ith file and an inode number of the ith file.

### Claim 10 (depends on 9)

The apparatus according to claim 9, wherein the processor is configured to execute the code, to enable the apparatus to:
obtain a first metadata addition request for an (M+1)th file in the directory, wherein the first metadata addition request comprises an (M+1)th key-value pair, and wherein the (M+1)th key-value pair comprises the inode number of the directory, a name of the (M+1)th file, and an inode number of the (M+1)th file;
determine the first start address corresponding to the inode number of the directory exists; and
persistently store the (M+1)th key-value pair in the first NVM area based on the first start address.

### Claim 11 (depends on 10)

The apparatus according to claim 10, wherein the processor is configured to execute the code, to enable the apparatus to:
obtain a second metadata addition request for an (M+1)th file in the directory, wherein the second metadata addition request comprises an (M+1)th key-value pair, and wherein the (M+1)th key-value pair comprises the inode number of the directory, a name of the (M+1)th file, and an inode number of the (M+1)th file;
determine a second start address of a second NVM area corresponding to the inode number of the second directory does not exist;
obtain the second start address, wherein the second NVM area is a contiguous memory area in the NVM; and
persistently store the (M+1)th key-value pair in the second NVM area based on the second start address, and constructing a correspondence between the inode number of the directory and the second start address.

### Claim 12 (depends on 10)

The apparatus according to claim 10, wherein the NVM area comprises a second NVM area, the second NVM area is for storing only the (M+1)th key-value pair, and wherein the processor is configured to execute the code, to enable the apparatus to construct a correspondence between a key of the (M+1)th key-value pair and a second start address of the second NVM area, wherein the key of the (M+1)th key-value pair comprises the inode number of the directory and the name of the (M+1)th file.

### Claim 13 (depends on 9)

The apparatus according to claim 9, wherein the processor is configured to execute the code, to enable the apparatus to:
obtain a metadata obtaining request for the ith file in the directory, wherein the metadata obtaining request comprises a key of the (ith key-value pair, and wherein the key of the ith key-value pair comprises the inode number of the directory and the name of the ith file;
determine a second start address of a second NVM area corresponding to the key of the ith key-value pair exists, wherein the NVM area comprises the second NVM area; and
obtain the ith key-value pair from the second NVM area based on the second start address.

### Claim 14 (depends on 9)

The apparatus according to claim 9, wherein the processor is configured to execute the code, to enable the apparatus to:
obtain a metadata deletion request for the ith file in the directory, wherein the metadata deletion request comprises a key of the ith key-value pair, and wherein the key of the ith key-value pair comprises the inode number of the directory and the name of the ith file;
determine a second start address of a second NVM area corresponding to the key of the ith key-value pair exists, wherein the NVM area comprises the second NVM area; and
set, based on the second start address, the ith key-value pair stored in the second NVM area to invalid data that cannot be obtained.

### Claim 15

A computer program product comprising computer-executable instructions stored in a non-transitory medium, the instructions executable by a processor to cause the processor to:
obtain a metadata obtaining request for M files in a directory, wherein the metadata obtaining request comprises an inode number of the directory, and wherein M≥2;
determine whether a first start address of a non-volatile memory (NVM) area corresponding to the inode number of the directory exists, wherein the NVM area is a contiguous memory area in an NVM; and
responsive to the first start address existing, obtain M key-value pairs from the NVM area based on the first start address,
wherein an ith key-value pair in the M key-value pairs comprises the inode number of the directory and metadata of an ith file, and
wherein i=1, . . . , M.

### Claim 16 (depends on 15)

The computer program product according to claim 15, wherein the instructions are executable by the processor to cause the processor to:
obtain a first metadata addition request for an (M+1)th file in the directory, wherein the first metadata addition request comprises an (M+1)th key-value pair, and the (M+1)th key-value pair comprises the inode number of the directory, a name of the (M+1)th file, and an inode number of the (M+1)th file; and
persistently store the (M+1)th key-value pair in the first NVM area based on the first start address.

### Claim 17 (depends on 16)

The computer program product according to claim 16, wherein the instructions are executable by the processor to cause the processor to:
obtain a second metadata addition request for an (M+1)th file in the directory, wherein the second metadata addition request comprises an (M+1)th key-value pair, and the (M+1)th key-value pair comprises the inode number of the directory, a name of the (M+1)th file, and an inode number of the (M+1)th file;
determine a second start address of a second NVM area corresponding to the inode number of the second directory does not exist;
obtain a second start address of the second NVM area provided by the NVM, wherein the second NVM area is a contiguous memory area in the NVM; and
persistently store the (M+1)th key-value pair in the second NVM area based on the second start address, and constructing a correspondence between the inode number of the directory and the second start address.

### Claim 18 (depends on 16)

The computer program product according to claim 16, wherein the NVM area comprises a second NVM area, the second NVM area is for storing only the (M+1)th key-value pair, and wherein the instructions are executable by the processor to cause the processor to construct a correspondence between a key of the (M+1)th key-value pair and a second start address of the second NVM area, wherein the key of the (M+1)th key-value pair comprises the inode number of the directory and the name of the (M+1)th file.

### Claim 19 (depends on 15)

The computer program product according to claim 15, wherein the instructions are executable by the processor to cause the processor to:
obtain a metadata obtaining request for the ith file in the directory, wherein the metadata obtaining request comprises a key of the ith key-value pair, and the key of the ith key-value pair comprises the inode number of the directory and the name of the ith file;
determine a second start address of a second NVM area corresponding to the key of the ith key-value pair exists, wherein the NVM area comprises the second NVM area; and
obtain the ith key-value pair from the second NVM area based on the second start address.

### Claim 20 (depends on 15)

The computer program product according to claim 15, wherein the instructions are executable by the processor to cause the processor to:
obtain a metadata deletion request for the ith file in the directory, wherein the metadata deletion request comprises a key of the ith key-value pair, and the key of the ith key-value pair comprises the inode number of the directory and the name of the ith file;
determine a second start address of a second NVM area corresponding to the key of the ith key-value pair exists, wherein the NVM area comprises the second NVM area; and
set, based on the second start address, the ith key-value pair stored in the second NVM area to invalid data that cannot be obtained.
