CN115543224B - ZNS SSD-based file system control method, device and equipment - Google Patents

ZNS SSD-based file system control method, device and equipment Download PDF

Info

Publication number
CN115543224B
CN115543224B CN202211519308.8A CN202211519308A CN115543224B CN 115543224 B CN115543224 B CN 115543224B CN 202211519308 A CN202211519308 A CN 202211519308A CN 115543224 B CN115543224 B CN 115543224B
Authority
CN
China
Prior art keywords
zns
ssd
target
file system
partition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211519308.8A
Other languages
Chinese (zh)
Other versions
CN115543224A (en
Inventor
齐武波
刘汉龙
赵阳
许春
赵伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202211519308.8A priority Critical patent/CN115543224B/en
Publication of CN115543224A publication Critical patent/CN115543224A/en
Application granted granted Critical
Publication of CN115543224B publication Critical patent/CN115543224B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to the technical field of storage, and particularly discloses a ZNS SSD file system control method, a device, equipment and a computer readable storage medium, wherein a user state management module for realizing a ZNS SSD flash memory conversion layer and a ZNS SSD partitioned storage management function is written in advance and is used for calling a user space file system interface of the user state management module, so that a creation command for creating a ZNS SSD-based file system can be received from the user space file system interface, and the user state management module is called to complete the creation of a target file system; when a system calling command for a target file system is received, the user mode management module is called to execute the system calling command according to the metadata of the target file system, and the user does not need to upgrade to the kernel version supporting the partition block drive, so that the customized file system can be flexibly customized by using the ZNS SSD, the development period is shortened, and the product delivery efficiency is improved.

Description

ZNS SSD-based file system control method, device and equipment
Technical Field
The present application relates to the field of storage technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for controlling a file system based on a ZNS SSD.
Background
A Zoned Name Space Solid State disk (ZNS SSD) is developed on the basis of an Open Channel Solid State disk (Open Channel SSD), and a Flash Translation Layer (FTL) is moved to an upper Layer from the inside of the SSD, so that a user can flexibly customize the Flash Translation Layer according to different requirements.
However, currently, a file system is built based on a ZNS SSD, and a user is required to use a kernel version supporting partition Block Drive (ZBD), but a mature ZBD property requires a higher kernel version or a specially customized kernel version, which is not suitable for some users (property users are sensitive to exclusion of kernel version upgrade).
Disclosure of Invention
The application aims to provide a file system control method, a device, equipment and a computer readable storage medium based on a ZNS SSD, so that a user mode file system based on the ZNS SSD is realized, kernel adaptation development work is avoided, and the requirement that a user who does not support kernel version upgrading flexibly customizes the file system is met.
In order to solve the above technical problem, the present application provides a method for controlling a file system based on a ZNS SSD, including:
when a creation command for creating a file system based on a ZNS SSD is received from a preset user space file system interface, a preset flash memory conversion layer for realizing the ZNS SSD and a user state management module for realizing a ZNS SSD partitioned storage management function are called, so that metadata of a target file system are loaded according to the creation command, mounting points of the target file system and the target ZNS SSD are determined, and the target ZNS SSD is mounted on the target file system to complete the creation command;
and after receiving a system call command of the target file system based on the user space file system interface, calling the user mode management module to execute the system call command according to the metadata of the target file system.
Optionally, the metadata of the target file system specifically includes:
directory information of the target file system, information of files in the target file system, corresponding logical block addresses of the files in the target file system in the target ZNS SSD, partition information of the target ZNS SSD, and association relations between partitions of the target ZNS SSD and the logical block addresses of the target ZNS SSD.
Optionally, loading the metadata of the target file system according to the creation command specifically includes:
invoking a non-relational database to load the file system metadata according to the create command.
Optionally, the non-relational database is specifically a remote dictionary service database.
Optionally, the invoking the user mode management module executes the system invocation command according to the metadata of the target file system, which specifically includes:
reading target metadata according to the system calling command;
verifying the validity of the system call command according to the target metadata;
if the system calling command is legal, executing the system calling command;
and if the system call command is illegal, returning the information of system call failure.
Optionally, the checking the validity of the system call command according to the target metadata specifically includes:
judging whether the partition state of a target access partition of the system calling command in the target ZNS SSD accords with the partition state for executing the system calling command according to the target metadata;
if so, confirming that the system call is legal;
and if the system call is not legal, confirming that the system call is illegal.
Optionally, the determining, according to the target metadata, whether the partition state of the target access partition of the system call command in the target ZNS SSD meets the partition state of executing the system call command specifically includes:
analyzing to obtain the address of a target file to be accessed by the system calling command;
determining a logical block address corresponding to the target file address in the target ZNS SSD and the corresponding target access partition according to the target metadata;
inquiring to obtain the partition state of the target access partition;
and judging whether the partition state of the target access partition meets the partition state for executing the system call command.
Optionally, when the system call command is a write command, the determining whether the partition state of the target access partition meets the partition state for executing the system call command specifically includes:
judging whether the partition state of the target access partition is a non-writable state or not;
if so, determining that the partition state of the target access partition does not conform to the partition state for executing the system call command;
and if not, determining that the partition state of the target access partition meets the partition state of the system calling command.
Optionally, the method further includes:
judging whether the system calling command contains an operation user data command or not;
if not, returning the information of successful system call;
and if so, entering the step of checking the legality of the system call command according to the target metadata.
Optionally, the executing the system call command specifically includes:
and executing the operation user data command to a target access subarea of the target ZNS SSD according to the system calling command.
Optionally, after executing the system call command, the method further includes:
judging whether the system calling command is executed successfully or not;
if so, returning user data corresponding to the system calling command and information of successful system calling;
if not, returning the information of system call failure.
In order to solve the above technical problem, the present application further provides a ZNS SSD-based file system control method, including:
when a creating request for creating a ZNS SSD-based file system is received, a creating command for calling a user mode management module pre-deployed by a file system server based on a preset user space file system interface is generated according to the creating request, so that the file system server loads metadata of a target file system according to the creating command, determines mounting points of the target file system and a target ZNS SSD, and mounts the target ZNS SSD on the target file system to complete the creating command;
after receiving a user operation request to the target file system, generating a system calling command based on the user space file system interface according to the user operation request, so as to call the user mode management module to execute the system calling command based on the user space file system interface;
the user mode management module is used for achieving a flash translation layer of the ZNS SSD and a partitioned storage management function of the ZNS SSD.
In order to solve the above technical problem, the present application further provides a file system control apparatus based on a ZNS SSD, including:
the file system creating method comprises a first creating unit, a second creating unit and a third creating unit, wherein the first creating unit is used for calling a preset user state management module for realizing a flash memory conversion layer of the ZNS SSD and a partitioned storage management function of the ZNS SSD when a creating command for creating a file system based on the ZNS SSD is received from a preset user space file system interface, so as to load metadata of a target file system according to the creating command, determine mounting points of the target file system and the target ZNS SSD, and mount the target ZNS SSD on the target file system to finish the creating command;
and the first calling unit is used for calling the user mode management module to execute the system calling command according to the metadata of the target file system after receiving the system calling command of the target file system based on the user space file system interface.
In order to solve the above technical problem, the present application further provides a ZNS SSD-based file system control apparatus, including:
the second creating unit is used for generating a creating command for calling a user state management module pre-deployed by a file system server based on a preset user space file system interface according to the creating request when the creating request for creating the file system based on the ZNS SSD is received, so that the file system server loads metadata of a target file system according to the creating command, determines mounting points of the target file system and the target ZNS SSD, and mounts the target ZNS SSD on the target file system to finish the creating command;
the second calling unit is used for generating a system calling command based on the user space file system interface according to the user operation request after receiving the user operation request to the target file system, so as to call the user mode management module to execute the system calling command based on the user space file system interface;
the user mode management module is used for achieving a flash memory conversion layer of the ZNS SSD and a partitioned storage management function of the ZNS SSD.
In order to solve the above technical problem, the present application further provides a ZNS SSD-based file system control apparatus, including:
a memory for storing a computer program;
a processor for executing the computer program, the computer program when executed by the processor implementing the steps of the ZNS SSD based file system control method as described in any one of the above.
To solve the above technical problem, the present application further provides a computer readable storage medium having a computer program stored thereon, where the computer program is executed by a processor to implement the steps of the ZNS SSD based file system control method as described in any one of the above.
According to the file system control method based on the ZNS SSD, a flash memory conversion layer of the target ZNS SSD, a user mode management module with the partitioned storage management function of the target ZNS SSD and a user space file system interface for calling the user mode management module are deployed in advance, so that a creation command for creating the file system based on the ZNS SSD can be received from the user space file system interface, and the user mode management module is called to complete creation of the target file system; and when receiving a system call command of the target file system, calling the user mode management module to execute the system call command according to the metadata of the target file system. Therefore, the method for realizing the user-mode file system based on the ZNS SSD is provided, a user does not need to upgrade to the kernel version supporting the partition block drive, kernel adaptation development work is avoided, the customized file system can be flexibly customized by using the ZNS SSD, the development period is shortened, the product delivery efficiency is improved, and even data migration is facilitated.
The application also provides a ZNS SSD-based file system control device, equipment and a computer-readable storage medium, which have the beneficial effects and are not described herein again.
Drawings
For a clearer explanation of the embodiments or technical solutions of the prior art of the present application, the drawings needed for the description of the embodiments or prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flowchart of a first ZNS SSD-based file system control method according to an embodiment of the present application;
FIG. 2 is a flowchart of a second ZNS SSD-based file system control method according to an embodiment of the present application;
FIG. 3 is a flowchart of a third ZNS SSD based file system control method according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a ZNS SSD-based file system control device according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of another ZNS SSD-based file system control device according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a first ZNS SSD-based file system control device according to an embodiment of the present application;
FIG. 7 is a schematic structural diagram of a second ZNS SSD-based file system control device according to an embodiment of the present application.
Detailed Description
The core of the application is to provide a file system control method, device and equipment based on ZNS SSD and a computer readable storage medium, so that a user mode file system based on the ZNS SSD is realized, kernel adaptation development work is avoided, and the requirement that a user who does not support kernel version upgrading flexibly customizes the file system is made up.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Example one
Fig. 1 is a flowchart of a first method for controlling a file system based on a ZNS SSD according to an embodiment of the present application.
As shown in fig. 1, a method for controlling a file system based on a ZNS SSD according to an embodiment of the present application specifically includes:
s101: the method comprises the steps of deploying a flash memory conversion layer called based on a user space file system (FUSE) interface and used for achieving a target ZNS SSD and a user state management module used for achieving a partitioned storage management function of the target ZNS SSD in advance.
S102: when a creation command for creating a ZNS SSD-based file system is received from a user space file system interface, a user mode management module is called to load metadata of a target file system according to the creation command, determine a mounting point of the target file system and the target ZNS SSD, and mount the target ZNS SSD on the target file system to complete the creation command.
S103: and when a system calling command for the target file system is received from the user space file system interface, calling the user mode management module to execute the system calling command according to the metadata of the target file system.
The file system control method based on the ZNS SSD provided by the embodiment of the application can be applied to a storage server or a storage cluster which is hung with the ZNS SSD.
For S101, compared with a general SSD, the difference of the ZNS SSD is that the ZNS SSD migrates the flash translation layer from inside the SSD to the upper layer, so that a user can flexibly customize the flash translation layer according to different needs, but the user device wants to build a file system or call the file system, which both needs a kernel supporting partition block driving, in other words, when the user device does not have the partition block driving kernel, the file system based on the ZNS SSD cannot be created. The ZNS SSD-based file system control method provided by the embodiment of the application provides another method for creating and calling the ZNS SSD-based file system, and can bypass kernel development and adaptation work. Specifically, according to the file system control method based on the ZNS SSD provided in the embodiment of the present application, the user space file system interface and the user mode management module are deployed in advance, and the user mode management module is called through the user space file system interface, so that the kernel version does not support the user equipment driven by the partition block, and the data of the ZNS SSD can be operated in the user mode, thereby implementing basic functions such as creation, reading, writing, and the like of the file system of the ZNS SSD.
In a conventional SSD, a flash translation layer is located between a file system and a flash memory, and a virtual disk is provided for the file system, so that the SSD can exhibit a behavior similar to a disk, and an application program (e.g., a database application) developed for the disk can be directly run on a storage system using the SSD as a storage medium without any modification. In the file system control method based on the ZNS SSD provided by the embodiment of the application, in order to realize user mode operation on the ZNS SSD, the pre-deployed user mode management module needs to realize the function of a flash memory conversion layer of the target ZNS SSD, so that the functions of controlling address mapping from the file system to the ZNS SSD and the like are realized.
It should be noted that, because the corresponding relationship from the Logical Block Address (LBA) to the Physical Block Address (PBA) in the ZNS SSD is fixed, the user mode management module provided in the embodiment of the present application only needs to manage the mapping relationship between the target file system file address and the external logical block address provided by the target ZNS SSD.
Meanwhile, the ZNS of a ZNS SSD, which represents a new functional division between host software and flash-based SSDs, divides its capacity into partitions (zones), each of which can be read in any order but must be written in order, these features allow the ZNS SSD to improve its internal data placement, thereby achieving higher performance through higher write throughput, lower QoS, and larger capacity. The partition management in the ZNS SSD includes, in addition to a fixed logical block address for each partition, a status value for each partition, which generally includes: empty (ZSE: empty), implicit open (ZSiO: implicitly open), read Only (ZRO: read Only), offline (ZSO: offline), explicit open (ZEO: explicit open), closed (ZSC: closed), full (ZSF: full), i.e. a partition on a ZNS SSD will be in one of these seven states. In these seven states, the Empty (ZSE: empty) and Full (ZSF: full) states will be clearly identified; the Read-Only state (ZRO: read Only) and the off-line state (ZSO: offline) are error states used when the flash memory of the current hard disk fails, and can Only appear when the life cycle of the whole hard disk is over, and many software which takes the partition storage as the target can not do anything to the states, and once one partition enters one of the states, the whole equipment can be simply regarded as dead halt; partitions that are in one of three states, implicit open (ZSIO), explicit open (ZSEO), and Closed (ZSC Closed), are considered active, and at any given time the hard disk tends to limit the number of regions that can be open (explicit or implicit) or active. These limitations arise because the active or open areas require some additional tracking information. For each active area, the hard disk needs to keep track of a write pointer that indicates how much capacity has been used for that area and where the next write operation to that area will be done. The write pointer is not needed for the full area or the empty area, which will be written from the beginning of the area because the full area cannot accept more write operations.
Therefore, in the file system control method based on the ZNS SSD provided in the embodiment of the present application, the pre-deployed user mode management module further needs to implement a partitioned storage management function of the target ZNS SSD to obtain a partitioned state of the ZNS SSD, implement partitioned management of the ZNS SSD, determine which partition to write data into when calling the file system, or determine which partition to obtain data from when reading data.
In addition, in the partitioned storage management function of the target ZNS SSD, the metadata of the target ZNS SSD needs to be maintained. The metadata of the target ZNS SSD is usually maintained using a database function. In this embodiment, the metadata of the target file system may specifically include: directory information of a target file system, file information of the target file system, directory item information of the target file system, corresponding relation between a file in the target file system and a logical block address of a ZNS disk in a target ZNS SSD, corresponding relation between a partition logical block address and the file, ZNS disk information of the target ZNS SSD, partition information of the target ZNS SSD, information of invalid logical block addresses in partitions of the target ZNS SSD, information of reserved partitions for garbage recovery in the target ZNS SSD, and information of available partitions in the target ZNS SSD.
Therefore, the user mode management module provided by the embodiment of the application replaces the function of partition block driving which needs to be realized in a kernel originally, and the user mode management of the ZNS SSD is realized.
After the deployment is completed, for S102, a user may select to create a file system based on a ZNS SSD based on a user device whose kernel version does not support block driving, and the user device invokes a pre-deployed user space file system interface according to a creation request of the user, and further invokes a user mode management module of a storage system provided in the target ZNS SSD to load metadata of a target file system that the user needs to create (when the file system is created for the first time, metadata such as a file directory needs to be generated, and when the file system exists, metadata of the existing file system is loaded in association), determine a target ZNS SSD that may be allocated to the target file system, mount the target ZNS SSD to the target file system, and complete creation of the target file system.
For S103, when the user needs to access the target file system to perform operations such as reading and writing data, the user device generates a system call command according to the call request of the user, calls the user space file system interface, and further calls the user mode management module to convert the system call command into an operation on the target ZNS SSD, thereby completing the operation on the target file system required by the user.
According to the file system control method based on the ZNS SSD, a flash memory conversion layer of the target ZNS SSD, a user mode management module with a partitioned storage management function of the target ZNS SSD and a user space file system interface for calling the user mode management module are deployed in advance, so that a creation command for creating the file system based on the ZNS SSD can be received from the user space file system interface, and the user mode management module is called to complete creation of the target file system; and when receiving a system call command of the target file system, calling the user mode management module to execute the system call command according to the metadata of the target file system. Therefore, the embodiment of the application provides a user mode file system implementation method based on the ZNS SSD, a user does not need to upgrade to a kernel version supporting block driving, kernel adaptation development work is avoided, the customized file system can be flexibly customized by using the ZNS SSD, the development period is shortened, the product delivery efficiency is improved, and even data migration is facilitated.
Example two
On the basis of the foregoing embodiments, in the file system control method based on the ZNS SSD provided in the embodiment of the present application, in order to improve performance when accessing the target file system, it is preferable to maintain metadata of the target file system by using a non-relational database (Not Only SQL, noSQL). By generating and managing metadata of the file system based on the non-relational database in advance, the step S102 of loading the metadata of the target file system according to the creation command may specifically be: the non-relational database is invoked to load file system metadata according to the create command.
Further, the selected non-relational database may be a Remote Dictionary service database (Redis), and the related information of the file and the directory is maintained by taking the file and the directory as the center by using the structural characteristics of the Key-Value of the Remote Dictionary service database.
It will be appreciated that depending on the functionality of the user-customized file system, different types of databases may be selected to meet the need for efficient management of metadata.
Taking the remote dictionary service database as an example, the data structure plan provided by the embodiment of the present application is shown in table 1.
TABLE 1 metadata database Structure for target ZNS SSD
Figure 286541DEST_PATH_IMAGE001
/>
Figure 406944DEST_PATH_IMAGE002
EXAMPLE III
On the basis of the above embodiments, the present embodiment further describes a user mode management module.
The user state management module is a multi-process program, and the configuration parameters required by the starting program at least comprise connection information with a database, a directory path for mounting a file system, equipment information of a target ZNS SSD and the like.
In the file system control method based on the ZNS SSD provided in the embodiment of the application, S101: the method includes the steps that a user state management module which is called based on a user space file system interface and is used for achieving a flash translation layer of a target ZNS SSD and a partitioned storage management function of the target ZNS SSD is deployed in advance, and the user state management module specifically comprises the following steps:
checking the available state of the target ZNS SSD, the available state of a database for storing metadata, the available state of a file system mounting directory and the file state contained in the file system mounting directory, and checking the information of the target ZNS SSD;
if the target ZNS SSD is available, the database is available, the file system mounting directory contains file information, and the target ZNS SSD passes information verification, starting a garbage recovery thread, a partition monitoring thread and a file service process;
the garbage collection thread is used for executing a partition collection task of the target ZNS SSD; the partition monitoring thread is used for executing a partition identification updating task of the target ZNS SSD; and the file service process is used for executing the service logic of the ZNS SSD file system externally provided by the user space file system interface.
In a specific implementation, the starting process of the user mode management module may include: initializing, checking ZNS SSD disk information, starting a garbage collection thread, starting a partition monitoring thread and starting a file service process.
The method comprises the steps of firstly carrying out an initialization process of a user mode management module, initializing relevant equipment and relevant files of a target ZNS SSD, and judging whether the equipment and the files are available. And inquiring whether the equipment is available or not according to the equipment information of the target ZNS SSD, and if the equipment is not available, exiting the program. It is checked whether the database storing the metadata (remote dictionary service database) is normally connected, and if not, the program exits. And judging whether the file system mounting directory is available or not, and if not, exiting the program. If the file system mounting directory is available, judging whether the information such as files and the like is contained under the file system mounting directory, if not, prompting that the information is wrong, and exiting the program.
And then, information verification of the target ZNS SSD is carried out, specifically, the information of the ZNS disk in the target ZNS SSD is verified. The information verification is carried out on the target ZNS SSD, and the method specifically comprises the following steps:
querying ZNS disk information of a target ZNS SSD from a database;
if the ZNS disk information cannot be obtained, constructing the ZNS disk information based on the target ZNS SSD;
if the ZNS disk information is obtained, carrying out information verification on the ZNS disk information;
if the ZNS disk information passes the information verification, confirming that the target ZNS SSD passes the information verification;
and if the ZNS disk information fails to pass the information verification or the ZNS disk information construction fails, confirming that the target ZNS SSD does not pass the information verification.
In the remote dictionary service database, a keyword Key corresponding to ZNS disk information of a target ZNS SSD is ZNS. If the ZNS disk information can not be inquired, prompting the user whether to initialize the disk information, and if the user does not agree with the initialization, exiting the program; if the user agrees to the initialization, the step of constructing the ZNS disk information is performed. Constructing ZNS disk information based on the target ZNS SSD specifically comprises the following steps:
according to the preset ZNS disk information in the preset configuration parameters, issuing an identification (identity) instruction to a target ZNS SSD to obtain a ZNS disk serial number of the target ZNS SSD so as to construct ZNS disk serial number data (a corresponding Key word Key: ZNS: sn in a database);
issuing a report-zone instruction to a target ZNS SSD to acquire the zone information of the ZNS disk of the target ZNS SSD according to the preset ZNS disk information so as to construct zone identification data (Key: zone: id corresponding to a database);
and taking the ZNS disk serial number data and the partition identification data as ZNS disk information.
The preset configuration parameters are derived from a program written in advance in the user mode management module.
If the ZNS disk information is queried or constructed, a step of information verification for the ZNS disk information is performed.
The information verification is carried out on the ZNS disk information, and the method specifically comprises the following steps:
issuing an identification (identity) instruction to a target ZNS SSD to obtain a ZNS disk serial number of the target ZNS SSD according to preset ZNS disk information in preset configuration parameters;
issuing a report-zone instruction to a target ZNS SSD to acquire ZNS disk zone information of the target ZNS SSD according to preset ZNS disk information;
if the ZNS disk serial number data (corresponding Key word Key: ZNS: sn in the database) in the ZNS disk information is consistent with the ZNS disk serial number and the subarea identification data (corresponding Key word Key: zone: id in the database) in the ZNS disk information is consistent with the ZNS disk subarea information, confirming that the ZNS disk information passes the information verification;
and if the ZNS disk serial number data (the corresponding Key word Key: ZNS: sn in the database) in the ZNS disk information is inconsistent with the ZNS disk serial number and/or the subarea identification data (the corresponding Key word Key: zone: id in the database) in the ZNS disk information is inconsistent with the ZNS disk subarea information, confirming that the ZNS disk information does not pass the information verification.
And verifying the ZNS disk information, namely firstly acquiring real ZNS disk information from the target ZNS SSD, then comparing the real ZNS disk information with the ZNS disk information inquired from the database, if the real ZNS disk information is consistent with the ZNS disk information, the ZNS disk information of the target ZNS SSD passes the information verification, and if the real ZNS disk information is inconsistent with the ZNS disk information, the ZNS disk information of the target ZNS SSD does not pass the information verification.
When the initialization process of the target ZNS SSD is executed and the information verification of the target ZNS SSD is passed, the steps of starting the garbage collection thread, starting the partition monitoring thread and starting the file service process can be executed in sequence or respectively.
The garbage collection thread executes a partition collection task on the target ZNS SSD, and specifically may include:
judging whether the subareas need to be recovered or not according to the usable data volume of the ZNS disk in the target ZNS SSD and the number of the usable subareas in the target ZNS SSD every interval of a first designated time period;
if the partitions need to be recovered, selecting the partitions to be recovered according to the information of the invalid logical block addresses in the partitions of the target ZNS SSD and the number of the logical block addresses in each invalid partition;
and after the data migration operation of the effective data of the partition to be recovered is executed, initializing and updating the state of the partition to be recovered.
And starting a garbage recovery thread, firstly starting a timer, and judging whether the partition needs to be recovered or not by combining the available data volume of the ZNS disk in the target ZNS SSD, the number of the available partitions in the target ZNS SSD and other information every a first specified time period. If the partition needs to be recovered, the partition with the large number of invalid logical block addresses can be selected for data recovery according to the information (corresponding Key: zone: id: discard) of the invalid logical block addresses in the partition of the target ZNS SSD, and the partition is the partition to be recovered. And selecting a new partition from a candidate partition list (corresponding Key: op: zone in a database) of the partition to be recovered, wherein the partition is a target partition of the partition to be recovered. And moving the effective data in the partition to be recovered to a target partition, and updating the corresponding relation between the Key file in the remote dictionary service database and the logical block address LBA of the ZNS disk (the corresponding Key: l2p: the file path in the database) and the corresponding relation between the logical block address LBA of the Key partition and the file (the corresponding Key: zoneid: LBA: offset: size in the database). After the effective data of the partition to be recovered is moved to the target partition, the partition to be recovered is initialized and put into a candidate partition list, and the partition state information (the corresponding Key in the database: zone: id) is updated.
The partition monitoring thread executes a partition identification updating task for the target ZNS SSD, and specifically may include:
issuing a report-zone instruction to the target ZNS SSD every a second designated time period to acquire the latest zone state of the target ZNS SSD and updating zone identification data (Key: zone: id corresponding to the database) in the database according to the latest zone state;
and issuing a log (logpage) acquisition command to the target ZNS SSD to acquire ZNS disk information in the hard disk log of the target ZNS SSD and updating partition identification data (Key: zone: id corresponding to the database) in the database according to the ZNS disk information.
Specifically, information such as a smart field, an error (error) field, an updated partition List (Changed Zone List) and the like is obtained from a hard disk log of the target ZNS SSD, and corresponding partition identification data (a Key: zone: id corresponding to the Key: zone: id in the database) in the database is updated according to the obtained information.
And starting a file service process to realize the business logic of providing service for the outside by a user space file system (FUSE) interface, and performing addition, deletion, modification and check on files and directories of a target file system based on the target ZNS SSD.
The method specifically includes updating a corresponding file or directory path (a corresponding Key in a database: file or directory path), directory entry information (a corresponding Key in a database: set: directory path), and the like.
The method for adding, deleting, modifying and checking the files in the target file system specifically comprises the following steps:
the method comprises the steps of performing file reading operation, inquiring the corresponding relation between a file and a logical block address LBA (a Key word Key: l2p: a file path in a database) of a ZNS disk, issuing reading operation to a target ZNS SSD in sequence, and returning an error if reading fails, or returning corresponding user data if reading fails;
the file is newly built or data is added for operation, 1 available partition is obtained from a currently available partition list (corresponding Key in a database: active: zone), a corresponding wp is inquired, namely a new logical block address is obtained, and the file data is issued to the corresponding logical block address on a ZNS disk of a target ZNS SSD; and updating the corresponding relation between the file and the logical block address LBA of the ZNS disk (the corresponding Key in the database: l2p: file path), and the corresponding relation between the partition logical block address LBA and the file (the corresponding Key in the database: zoneid: LBA: offset: size); if the capacity of the current partition is used up, 1 piece of new partition information needs to be obtained from a currently available partition list (corresponding Key word Key: active: zone in a database) again, the state Key word Key 'partition identification' (zone: id) of the previous partition is updated, the data and the corresponding relation between the upper operation update file and the logical block address LBA of the ZNS disk (corresponding Key word Key: l2p: file path in the database), and the corresponding relation between the partition logical block address LBA and the file (corresponding Key word Key: zoneid: offset: size in the database) are updated, and the above operations are repeated until all user data are issued; if the partition list (the Key word Key corresponding to the Key word in the database: active: zone) available at present has no data, acquiring a new partition from the candidate partition list (the Key word Key corresponding to the Key word in the database: op: zone), and putting the new partition into the partition list (the Key word Key corresponding to the Key word in the database: active: zone) available at present;
file modification operation, namely firstly inquiring the corresponding relation between a file and a logical block address LBA of a ZNS disk (corresponding Key word Key: l2p: file path in a database) to obtain a modified logical block address LBA A; applying for a new logical block address LBA B for storing new data, sending the new data to a corresponding LBA B on a target ZNS SSD disk, updating the corresponding relation between the file and the logical block address LBA of the ZNS disk by using the LBA B (the corresponding Key in the database: l2p: file path), partitioning the corresponding relation between the logical block address and the file (the corresponding Key in the database: zoneid: offset: size), and adding the address of the LBA A to the information of the invalid logical block address LBA in the partition (the corresponding Key in the database: zone: id: disc);
inquiring file information, and returning data corresponding to file information or directory information (a corresponding Key in a database: a file or directory path).
It should be noted that, the above steps are to describe the principle that the user mode management module performs the addition, deletion, modification and check on the file in the target file system, and no order relationship exists between the steps.
Example four
FIG. 2 is a flowchart of a second ZNS SSD-based file system control method according to an embodiment of the present application.
Based on the foregoing embodiment, in the zn SSD-based file system control method provided in the embodiment of the present application, the invoking the user mode management module in S102 executes the system call command according to the metadata of the target file system, which may specifically include:
reading target metadata according to a system calling command;
verifying the validity of the system call command according to the target metadata;
if the system calling command is legal, executing the system calling command;
and if the system call command is illegal, returning the information of system call failure.
Please refer to the first embodiment of the present application, in order to implement the user-mode file system based on the ZNS SSD, partition allocation for write operation and partition query for read operation need to be performed according to the partition information of the target ZNS SSD, that is, the state values of the partitions of the target ZNS SSD and the association relationship between the partitions of the target ZNS SSD and the logical block addresses are needed. When the user state management module manages the partition information of the target ZNS SSD, the metadata of the target ZNS SSD, namely the target metadata, is maintained through the database.
And after receiving a system calling command sent by the user equipment, calling the user mode management module to identify the system calling command and determine the operation to be executed on the target file system, determining the partition information associated with the system calling command in the current target ZNS SSD according to the loaded target metadata, further checking the legality of the system calling command according to the information, executing the system calling command if the system calling command is legal, and feeding back information of system calling failure to the user equipment if the system calling command is illegal.
The verifying the validity of the system call command according to the target metadata may specifically include:
judging whether the partition state of a target access partition of the system call command in the target ZNS SSD accords with the partition state of the system call command according to the target metadata;
if the answer is yes, the system call is confirmed to be legal;
if not, the system call is confirmed to be illegal.
Referring to the first embodiment of the present application, different state values of partitions in a ZNS SSD represent what operation the current partition can receive. Therefore, the required target metadata can adopt the partition state of the target access partition, and whether the system call command is legal or not is determined by judging whether the partition state accords with the partition state of the execution system call command or not.
Since the system call command of the user equipment is usually a call to a file, at this time, the logical block address in the target ZNS SSD corresponding to the target file needs to be queried, and even the target partition where the logical block address is located needs to be determined, so that the data on the target ZNS SSD can be operated. Judging whether the partition state of the target access partition of the system call command in the target ZNS SSD conforms to the partition state of the system call command according to the target metadata, wherein the judging step specifically comprises the following steps:
analyzing to obtain the address of a target file to be accessed by the system calling command;
determining a logical block address corresponding to the target file address in the target ZNS SSD and a corresponding target access partition according to the target metadata;
inquiring to obtain the partition state of the target access partition;
and judging whether the partition state of the target access partition accords with the partition state of the execution system call command.
Specifically, a target file address which needs to be accessed by a user is obtained by analyzing a system calling command based on the user mode management module, and then a logical block address corresponding to the target file address in a target ZNS SSD and a target access partition where the logical block address is located are determined according to target metadata which is obtained by inquiring in metadata of a target file system maintained by a database and is related to the target file address. And then, determining the state value of the target access partition in the target ZNS SSD at the current moment in a mode of accessing the target ZNS SSD or analyzing the target metadata, and judging that the target access partition in the state can execute a system call command. For example, when the target access partition is in a non-writable state and a system call command to the target access partition is a write operation, the system call command is considered to be illegal. That is, when the system call command is a write command, determining whether the partition state of the target access partition meets the partition state of the system call command, which may specifically include:
judging whether the partition state of the target access partition is a non-writable state or not;
if so, determining that the partition state of the target access partition does not conform to the partition state of the execution system call command;
if not, determining that the partition state of the target access partition conforms to the partition state of the executing system call command.
Specifically, the non-writable state of the target access partition in the target ZNS SSD may include a Read-Only state (ZRO: read Only), a Full zone (ZSF: full), a Closed state (ZSC: closed), and the like. And when the logical block address corresponding to the target file address in the target ZNS SSD is in the non-writable state currently, prohibiting the system call for writing data.
In order to speed up the response, the method for controlling the file system based on the ZNS SSD according to the embodiment of the present application may further include:
judging whether the system calling command contains an operation user data command or not;
if not, returning the information of successful system call;
if yes, the step of checking the validity of the system call command according to the target metadata is entered.
That is, before checking the validity of the system call command, it is checked whether the system call command includes an operation user data command, that is, whether the target ZNS SSD needs to be accessed, if so, the validity of the system call command is checked, and if not, the target ZNS SSD does not need to be accessed. For example, when the user only needs to access the metadata of the target file system, the step of judging whether the system call command is legal is not needed.
And when the system calling command comprises a user data operation command, further accessing the target ZNS SSD to operate the user data after the legality of the system calling command is confirmed. Executing a system call command in S102, specifically: and executing an operation user data command to a target access subarea of the target ZNS SSD according to the system calling command.
Further, in order to make the operation smooth, in the file system control method based on the ZNS SSD provided in the embodiment of the present application, after the system call command is executed, the method further includes:
judging whether the system calling command is executed successfully or not;
if so, returning the user data corresponding to the system calling command and the information of successful system calling;
if not, returning the information of system call failure.
After the system calling command is checked whether to be successfully executed or not, corresponding system calling success information or system calling failure information is fed back to the user equipment, and therefore the user can conveniently check calling results of the target file system based on the ZNS SSD.
On the basis of the above optional implementation manner, an embodiment of the present application provides a preferable ZNS SSD based file system control method, as shown in fig. 2, including:
s201: and when a creation command for creating the ZNS SSD-based file system is received from a preset user space file system interface, starting the database and loading the metadata of the target file system.
S202: and calling a user state management module, determining a mounting point of the target file system and the target ZNS SSD, and mounting the target ZNS SSD on the target file system to complete the creation command.
S203: and circularly waiting for the system call.
S204: after a system calling command for a target file system based on a user space file system interface is received, calling a user mode management module to read metadata of the target file system and judging whether the metadata of the target file system is successfully read; if yes, go to S205; if not, the process proceeds to S212.
S205: judging whether the system calling command contains an operation user data command or not; if yes, the process proceeds to S206, and if no, the process proceeds to S207;
s206: and querying the database to obtain the information of the target access partition and the corresponding logical block address in the target ZNS SSD, and entering S208.
S207: and returning the metadata of the target file system and the information of successful system call.
S208: judging whether an operation user data command (a system call command) is legal or not according to the partition state of the target access partition; if yes, go to S209; if not, the process proceeds to S212.
S209: an operate user data command is executed to a target access partition of the target ZNS SSD.
S210: judging whether the system calling command is executed successfully or not; if yes, go to S211; if not, the process proceeds to S212.
S211: and returning the user data corresponding to the system calling command and the information of successful system calling.
S212: and returning the information of the system call failure.
The above description may be referred to for a specific implementation of the preferred ZNS SSD-based file system control method, and details are not repeated herein.
EXAMPLE five
FIG. 3 is a flowchart of a third ZNS SSD-based file system control method according to an embodiment of the present application.
Based on the foregoing embodiments, it can be seen that the implementation method for providing a user-mode file system based on a ZNS SSD for a user device without a partition driving kernel based on a storage server is provided, and the embodiment of the present application provides a file system control method based on a ZNS SSD, which is implemented based on the user device, as shown in fig. 3, including:
s301: when a creating request for creating the ZNS SSD-based file system is received, a creating command for calling a user mode management module pre-deployed by a file system server based on a preset user space file system interface is generated according to the creating request, so that the file system server loads metadata of a target file system according to the creating command, determines mounting points of the target file system and the target ZNS SSD, and mounts the target ZNS SSD on the target file system to complete the creating command.
S302: and after receiving a user operation request for the target file system, generating a system calling command based on the user space file system interface according to the user operation request, and calling the user mode management module to execute the system calling command based on the user space file system interface.
The user mode management module is used for achieving a flash memory conversion layer of the target ZNS SSD and a partitioned storage management function of the target ZNS SSD.
In the specific implementation, when a user operates a file system which is based on the ZNS SSD and is desired to be created or accessed on user equipment, a creating request is converted into a creating command through a pre-deployed conversion script, a user operation request is converted into a system calling command, and a pre-deployed user mode management module of a file system server is called through a pre-deployed user space file system interface, so that the user mode file system based on the ZNS SSD is realized, and the technical blank that the user equipment which does not have a partition driving kernel in the prior art can not provide the file system based on the ZNS SSD is made up.
On the basis of the above detailed description of various embodiments corresponding to the ZNS SSD-based file system control method, the application also discloses a ZNS SSD-based file system control device, equipment and a computer-readable storage medium corresponding to the method.
EXAMPLE six
FIG. 4 is a schematic structural diagram of a ZNS SSD-based file system control device according to an embodiment of the present application.
As shown in fig. 4, a ZNS SSD based file system control apparatus according to an embodiment of the present application includes:
the system comprises a deployment unit 401, a storage management unit and a management unit, wherein the deployment unit is used for deploying a flash translation layer called based on a user space file system interface and used for realizing a target ZNS SSD and a user mode management module with a partitioned storage management function of the target ZNS SSD in advance;
a first creating unit 402, configured to, when a creating command for creating a ZNS SSD-based file system is received from a user space file system interface, invoke a user mode management module to load metadata of a target file system according to the creating command, determine a mount point of the target file system and a target ZNS SSD, and mount the target ZNS SSD to the target file system to complete the creating command;
the first calling unit 403 is configured to, when a system call command for the target file system is received from the user space file system interface, call the user mode management module to execute the system call command according to the metadata of the target file system.
Since the sixth embodiment of the apparatus portion corresponds to the first to fourth embodiments of the method portion, please refer to the description of the embodiments of the method portion for the embodiments of the apparatus portion, and details will not be repeated here.
EXAMPLE seven
FIG. 5 is a schematic structural diagram of another ZNS SSD-based file system control device according to an embodiment of the present application.
As shown in fig. 5, a ZNS SSD based file system control apparatus according to an embodiment of the present application includes:
a second creating unit 501, configured to, when a creating request for creating a file system based on the ZNS SSD is received, generate, according to the creating request, a creating command for calling a user mode management module, which is pre-deployed by the file system server, based on a preset user space file system interface, so that the file system server loads metadata of a target file system according to the creating command, determines a mount point of the target file system and the target ZNS SSD, and mounts the target ZNS SSD on the target file system to complete the creating command;
a second calling unit 502, configured to generate a system calling command based on the user space file system interface according to the user operation request after receiving the user operation request for the target file system, so as to call the user mode management module to execute the system calling command based on the user space file system interface;
the user mode management module is used for achieving a flash memory conversion layer of the target ZNS SSD and a partitioned storage management function of the target ZNS SSD.
Since the seventh embodiment of the apparatus portion corresponds to the fifth embodiment of the method portion, please refer to the description of the method portion for the embodiment of the apparatus portion, which is not repeated here.
Example eight
FIG. 6 is a schematic structural diagram of a first ZNS SSD-based file system control device according to an embodiment of the present application.
As shown in fig. 6, applied to a storage system mounted with a ZNS SSD, a first file system control device based on a ZNS SSD provided in an embodiment of the present application includes:
a memory 610 for storing a computer program 611;
a processor 620 for executing the computer program 611, wherein the computer program 611 when executed by the processor 620 implements the steps of the ZNS SSD based file system control method as provided in any of the first to fourth embodiments.
Processor 620 may include one or more processing cores, such as a 3-core processor, an 8-core processor, and so forth. The processor 620 may be implemented in at least one hardware form of a Digital Signal Processing (DSP), a Field-Programmable Gate Array (FPGA), and a Programmable Logic Array (PLA). Processor 620 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in the wake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 620 may be integrated with a Graphics Processing Unit (GPU) which is responsible for rendering and drawing the content that the display screen needs to display. In some embodiments, processor 620 may also include an Artificial Intelligence (AI) processor for processing computational operations related to machine learning.
Memory 610 may include one or more computer-readable storage media, which may be non-transitory. Memory 610 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 610 is at least used for storing the computer program 611, wherein after the computer program 611 is loaded and executed by the processor 620, the relevant steps of the ZNS SSD based file system control method disclosed in any of the foregoing embodiments can be implemented. In addition, the resources stored by the memory 610 may also include an operating system 612, data 613, and the like, and the storage manner may be a transient storage or a permanent storage. The operating system 612 may be Windows, among others. The data 613 may include, but is not limited to, data involved in the above-described methods.
In some embodiments, the ZNS SSD based file system control device may also include a display 630, a power supply 640, a communication interface 650, an input output interface 660, sensors 670, and a communication bus 680.
Those skilled in the art will appreciate that the configuration shown in FIG. 6 does not constitute a limitation of the ZNS SSD based file system controlling device and may include more or less components than those shown.
The file system control device based on the ZNS SSD provided by the embodiment of the application comprises the memory and the processor, and the processor can realize the file system control method based on the ZNS SSD when executing the program stored in the memory, and the effect is the same as the effect.
Example nine
FIG. 7 is a schematic structural diagram of a second ZNS SSD-based file system control device according to an embodiment of the present application.
As shown in fig. 7, the second ZNS SSD based file system control device according to the embodiment of the present application, applied to the user device side, includes:
a memory 710 for storing a computer program 711;
a processor 720 for executing a computer program 711, wherein the computer program 711 when executed by the processor 720 realizes the steps of the ZNS SSD based file system control method as provided in the fifth embodiment.
Processor 720 may include one or more processing cores, such as a 3-core processor, an 8-core processor, and so forth. The processor 720 may be implemented in at least one hardware form of a Digital Signal Processing (DSP), a Field-Programmable Gate Array (FPGA), and a Programmable Logic Array (PLA). Processor 720 may also include a main processor, which is a processor for Processing data in the wake state, also referred to as a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 720 may be integrated with a Graphics Processing Unit (GPU) that is responsible for rendering and drawing the content that the display screen needs to display. In some embodiments, processor 720 may also include an Artificial Intelligence (AI) processor for processing computational operations related to machine learning.
Memory 710 may include one or more computer-readable storage media, which may be non-transitory. Memory 710 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 710 is at least used for storing the following computer program 711, wherein after the computer program 711 is loaded and executed by the processor 720, the relevant steps in the ZNS SSD based file system control method disclosed in any of the foregoing embodiments can be implemented. In addition, the resources stored by the memory 710 may also include an operating system 712 and data 713, and the storage may be transient storage or permanent storage. Operating system 712 may be Windows, among others. Data 713 may include, but is not limited to, data involved in the above-described methods.
In some embodiments, the ZNS SSD based file system control device may also include a display screen 730, a power supply 740, a communication interface 750, an input output interface 760, sensors 770, and a communication bus 780.
Those skilled in the art will appreciate that the configuration shown in FIG. 7 does not constitute a limitation of the ZNS SSD based file system controlling device and may include more or less components than those shown.
The file system control device based on the ZNS SSD provided by the embodiment of the application comprises the memory and the processor, and the processor can realize the file system control method based on the ZNS SSD when executing the program stored in the memory, and the effect is the same as the effect.
Example ten
It should be noted that the above-described embodiments of the apparatus and device are merely illustrative, for example, the division of modules is only one division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some interfaces, indirect coupling or communication connection between devices or modules, and may be in an electrical, mechanical or other form. Modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the methods described in the embodiments of the present application, or all or part of the technical solutions.
To this end, the embodiment of the present application further provides a computer readable storage medium, which is applied to a storage system mounted with a ZNS SSD, where the computer readable storage medium stores thereon a computer program, and the computer program, when executed by a processor, implements the steps of the method for controlling a file system based on a ZNS SSD, as provided in any of the first to fourth embodiments of the present application.
Alternatively, an embodiment of the present application further provides a computer-readable storage medium, which is applied to a user equipment side, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for controlling a file system based on a ZNS SSD, as provided in the fifth embodiment of the present application, are implemented.
The computer-readable storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory ROM (Read-Only Memory), a Random Access Memory RAM (Random Access Memory), a magnetic disk, or an optical disk.
The computer program contained in the computer readable storage medium provided in the present embodiment is capable of implementing the steps of the ZNS SSD based file system control method as described above when executed by the processor, and the same effect is obtained.
The above details a method, an apparatus, a device and a computer readable storage medium for controlling a file system based on a ZNS SSD provided by the present application. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device, the apparatus and the computer-readable storage medium disclosed in the embodiments correspond to the method disclosed in the embodiments, so that the description is simple, and the relevant points can be referred to the description of the method. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.

Claims (24)

1. A file system control method based on ZNS SSD is characterized by comprising the following steps:
the method comprises the steps that a flash memory conversion layer called based on a user space file system interface and used for achieving a target ZNS SSD and a user mode management module with a partition storage management function of the target ZNS SSD are deployed in advance;
when a creation command for creating a ZNS SSD-based file system is received from the user space file system interface, the user state management module is called to load metadata of a target file system according to the creation command, determine mounting points of the target file system and the target ZNS SSD and mount the target ZNS SSD on the target file system to complete the creation command;
and when a system call command for the target file system is received from the user space file system interface, calling the user mode management module to execute the system call command according to the metadata of the target file system.
2. The ZNS SSD-based file system control method as claimed in claim 1, wherein the pre-deploying a user-mode management module invoked based on a user-space file system interface for implementing a flash translation layer of a target ZNS SSD and a partitioned storage management function of the target ZNS SSD specifically comprises:
checking the available state of the target ZNS SSD, the available state of a database for storing metadata, the available state of a file system mounting directory and the file state contained in the file system mounting directory, and performing information verification on the target ZNS SSD;
if the target ZNS SSD is available, the database is available, the file system mount directory contains file information, and the target ZNS SSD passes information verification, a garbage recovery thread, a partition monitoring thread and a file service process are started;
the garbage collection thread is used for executing a partition collection task of the target ZNS SSD; the partition monitoring thread is used for executing a partition identification updating task of the target ZNS SSD; the file service process is used for executing the service logic of the ZNS SSD file system provided by the user space file system interface.
3. The ZNS SSD-based file system control method as defined in claim 2, wherein the information verification of the target ZNS SSD specifically comprises:
querying, from the database, ZNS disk information for the target ZNS SSD;
if the ZNS disk information cannot be acquired, constructing the ZNS disk information based on the target ZNS SSD;
if the ZNS disk information is obtained, carrying out information verification on the ZNS disk information;
if the ZNS disk information passes the information verification, confirming that the target ZNS SSD passes the information verification;
and if the ZNS disk information fails to pass the information verification or the ZNS disk information construction fails, confirming that the target ZNS SSD does not pass the information verification.
4. The ZNS SSD-based file system control method as defined in claim 3, wherein the constructing the ZNS disk information based on the target ZNS SSD specifically comprises:
issuing an identification instruction to the target ZNS SSD to acquire a ZNS disk serial number of the target ZNS SSD according to preset ZNS disk information in preset configuration parameters so as to construct ZNS disk serial number data;
issuing a report partition instruction to the target ZNS SSD to acquire ZNS disk partition information of the target ZNS SSD according to the preset ZNS disk information so as to construct partition identification data;
and taking the ZNS disk serial number data and the partition identification data as the ZNS disk information.
5. The ZNS SSD-based file system control method as defined in claim 3, wherein the information verification for the ZNS disk information specifically comprises:
issuing an identification instruction to the target ZNS SSD to obtain a ZNS disk serial number of the target ZNS SSD according to preset ZNS disk information in preset configuration parameters;
issuing a report partition instruction to the target ZNS SSD to acquire ZNS disk partition information of the target ZNS SSD according to the preset ZNS disk information;
if the ZNS disk serial number data in the ZNS disk information is consistent with the ZNS disk serial number and the subarea identification data in the ZNS disk information is consistent with the ZNS disk subarea information, confirming that the ZNS disk information passes information verification;
and if the ZNS disk serial number data in the ZNS disk information is inconsistent with the ZNS disk serial number and/or the subarea identification data in the ZNS disk information is inconsistent with the ZNS disk subarea information, confirming that the ZNS disk information does not pass the information verification.
6. The ZNS SSD based file system controlling method of claim 2, wherein the garbage collection thread performs a partitioned collection task on the target ZNS SSD, comprising:
judging whether the partitions need to be recovered or not according to the usable data volume of the ZNS disk in the target ZNS SSD and the number of usable partitions in the target ZNS SSD every first designated time period;
if the partitions need to be recovered, selecting the partitions to be recovered according to the information of the invalid logical block addresses in the partitions of the target ZNS SSD and the number of the logical block addresses in each invalid partition;
and after the data migration operation of the effective data of the partition to be recovered is executed, initializing and updating the state of the partition to be recovered.
7. The ZNS SSD-based file system control method as defined in claim 2, wherein the partition supervisor thread performs the task of updating the partition identity of the target ZNS SSD, specifically comprising:
issuing a report partition instruction to the target ZNS SSD every second designated time period to acquire the latest partition state of the target ZNS SSD and updating the partition identification data in the database according to the latest partition state;
and issuing a log obtaining command to the target ZNS SSD to obtain ZNS disk information in a hard disk log of the target ZNS SSD, and updating the partition identification data in the database according to the ZNS disk information.
8. The ZNS SSD-based file system control method as defined in claim 1, wherein the metadata of the target file system specifically comprises:
directory information of the target file system, file information of the target file system, directory item information of the target file system, a corresponding relation between a file in the target file system and a logical block address of a ZNS disk in the target ZNS SSD, a corresponding relation between a partition logical block address and a file, ZNS disk information of the target ZNS SSD, partition information of the target ZNS SSD, information of an invalid logical block address in a partition of the target ZNS SSD, information of a reserved partition for garbage recovery in the target ZNS SSD, and information of an available partition in the target ZNS SSD.
9. The ZNS SSD-based file system control method as defined in claim 1, wherein the loading of metadata of the target file system according to the create command is specifically:
invoking a non-relational database to load the file system metadata according to the create command.
10. The ZNS SSD based file system control method according to claim 9, wherein the non-relational database is embodied as a remote dictionary service database.
11. The ZNS SSD-based file system control method according to claim 1, wherein the invoking the user-mode management module to execute the system call command according to the metadata of the target file system comprises:
reading target metadata according to the system calling command;
verifying the validity of the system call command according to the target metadata;
if the system calling command is legal, executing the system calling command;
and if the system call command is illegal, returning the information of system call failure.
12. The ZNS SSD-based file system control method of claim 11, wherein the verifying the validity of the system call command based on the target metadata comprises:
judging whether the partition state of a target access partition of the system calling command in the target ZNS SSD accords with the partition state for executing the system calling command according to the target metadata;
if so, confirming that the system call is legal;
and if not, confirming that the system call is illegal.
13. The ZNS SSD-based file system controlling method as claimed in claim 12, wherein the determining whether the partitioning status of the target access partition of the system call command in the target ZNS SSD according to the target metadata corresponds to the partitioning status of the target access partition executing the system call command comprises:
analyzing to obtain the address of a target file to be accessed by the system calling command;
determining a logical block address corresponding to the target file address in the target ZNS SSD and the corresponding target access partition according to the target metadata;
inquiring to obtain the partition state of the target access partition;
and judging whether the partition state of the target access partition meets the partition state for executing the system call command.
14. The ZNS SSD-based file system control method according to claim 13, wherein when the system call command is a write command, the determining whether the partition status of the target access partition matches the partition status of the system call command, specifically comprises:
judging whether the partition state of the target access partition is a non-writable state or not;
if so, determining that the partition state of the target access partition does not conform to the partition state for executing the system call command;
and if not, determining that the partition state of the target access partition meets the partition state of the system calling command.
15. The ZNS SSD-based file system control method of claim 11, further comprising:
judging whether the system calling command comprises an operation user data command or not;
if not, returning the information of successful system call;
and if so, entering the step of checking the legality of the system calling command according to the target metadata.
16. The ZNS SSD based file system control method according to claim 15, wherein the executing the system call command specifically is:
and executing the operation user data command to a target access partition of the target ZNS SSD according to the system call command.
17. The ZNS SSD-based file system control method of claim 1, further comprising, after executing the system call command:
judging whether the system calling command is executed successfully or not;
if so, returning the user data corresponding to the system calling command and the information of successful system calling;
if not, returning the information of system call failure.
18. A file system control method based on ZNS SSD is characterized by comprising the following steps:
when a creating request for creating a ZNS SSD-based file system is received, a creating command for calling a user mode management module pre-deployed by a file system server based on a preset user space file system interface is generated according to the creating request, so that the file system server loads metadata of a target file system according to the creating command, determines mounting points of the target file system and a target ZNS SSD, and mounts the target ZNS SSD on the target file system to complete the creating command;
after receiving a user operation request to the target file system, generating a system calling command based on the user space file system interface according to the user operation request, so as to call the user mode management module to execute the system calling command based on the user space file system interface;
the user mode management module is used for realizing a flash translation layer of the target ZNS SSD and a partitioned storage management function of the target ZNS SSD.
19. A file system control device based on ZNS SSD is characterized by comprising:
the deployment unit is used for deploying a flash memory conversion layer called based on a user space file system interface and used for realizing a target ZNS SSD and a user mode management module with a partitioned storage management function of the target ZNS SSD in advance;
the file system comprises a first creation unit, a user state management module and a second creation unit, wherein the first creation unit is used for calling the user state management module when a creation command for creating a ZNS SSD-based file system is received from the user space file system interface, so that metadata of a target file system is loaded according to the creation command, a mounting point of the target file system and the target ZNS SSD is determined, and the target ZNS SSD is mounted on the target file system to complete the creation command;
the first calling unit is used for calling the user mode management module to execute the system calling command according to the metadata of the target file system when the system calling command of the target file system is received from the user space file system interface.
20. A ZNS SSD-based file system control apparatus, comprising:
the second creating unit is used for generating a creating command for calling a user state management module pre-deployed by a file system server based on a preset user space file system interface according to the creating request when the creating request for creating the file system based on the ZNS SSD is received, so that the file system server loads metadata of a target file system according to the creating command, determines mounting points of the target file system and the target ZNS SSD, and mounts the target ZNS SSD on the target file system to finish the creating command;
the second calling unit is used for generating a system calling command based on the user space file system interface according to the user operation request after receiving the user operation request to the target file system, so as to call the user mode management module to execute the system calling command based on the user space file system interface;
the user mode management module is used for realizing a flash translation layer of the target ZNS SSD and a partitioned storage management function of the target ZNS SSD.
21. A ZNS SSD-based file system control apparatus, comprising:
a memory for storing a computer program;
a processor for executing the computer program, the computer program when executed by the processor implementing the steps of the ZNS SSD based file system control method as claimed in any of claims 1 to 17.
22. A ZNS SSD-based file system control apparatus, comprising:
a memory for storing a computer program;
a processor for executing the computer program, the computer program when executed by the processor implementing the steps of the ZNS SSD based file system control method as claimed in claim 18.
23. A computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, performs the steps of the ZNS SSD based file system control method as claimed in any of claims 1 to 17.
24. A computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor performs the steps of the ZNS SSD based file system control method as claimed in claim 18.
CN202211519308.8A 2022-11-30 2022-11-30 ZNS SSD-based file system control method, device and equipment Active CN115543224B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211519308.8A CN115543224B (en) 2022-11-30 2022-11-30 ZNS SSD-based file system control method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211519308.8A CN115543224B (en) 2022-11-30 2022-11-30 ZNS SSD-based file system control method, device and equipment

Publications (2)

Publication Number Publication Date
CN115543224A CN115543224A (en) 2022-12-30
CN115543224B true CN115543224B (en) 2023-03-24

Family

ID=84722093

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211519308.8A Active CN115543224B (en) 2022-11-30 2022-11-30 ZNS SSD-based file system control method, device and equipment

Country Status (1)

Country Link
CN (1) CN115543224B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116301669B (en) * 2023-05-25 2023-08-11 成都凯天电子股份有限公司 High-speed storage system partitioning method and system based on FPGA

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104639658A (en) * 2015-03-12 2015-05-20 浪潮集团有限公司 Realization method for accessing object storage by file system mounting
US11340987B1 (en) * 2021-03-04 2022-05-24 Netapp, Inc. Methods and systems for raid protection in zoned solid-state drives
US20220382668A1 (en) * 2021-05-28 2022-12-01 Advantest Corporation Systems and methods for concurrent and automated testing of zoned namespace solid state drives
CN114138193B (en) * 2021-11-25 2024-03-26 郑州云海信息技术有限公司 Data writing method, device and equipment for partition naming space solid state disk
CN114546296B (en) * 2022-04-25 2022-07-01 武汉麓谷科技有限公司 ZNS solid state disk-based full flash memory system and address mapping method

Also Published As

Publication number Publication date
CN115543224A (en) 2022-12-30

Similar Documents

Publication Publication Date Title
CN106227579B (en) Docker container construction method and Docker management console
EP3764237B1 (en) System startup method and apparatus, electronic device and storage medium
US10089119B2 (en) API namespace virtualization
US8370835B2 (en) Method for dynamically generating a configuration for a virtual machine with a virtual hard disk in an external storage device
CN101650660B (en) Booting a computer system from central storage
US7558804B1 (en) Method, apparatus, and computer-readable medium for space-efficient storage of variables in a non-volatile computer memory
US20090307292A1 (en) Dynamically changing a garbage collector in a managed runtime system
KR102434170B1 (en) hybrid memory system
EP2718823A1 (en) Dual flash translation layer
WO2013090135A1 (en) Mount-time reconciliation of data availability
TW201945961A (en) Optimization of log-structured merge (LSM) tree-based databases using object solid state drive (SSD) devices
KR101059633B1 (en) Heap configuration for multitasking virtual machines
CN110362301B (en) Processing method for terminal application behavior reflection
US20140047222A1 (en) Method and device for recombining runtime instruction
CN106708627A (en) Multi-virtual-machine mapping and multipath fuse acceleration method and system based on kvm
CN115543224B (en) ZNS SSD-based file system control method, device and equipment
CN112988060A (en) Key value storage device and method for operating key value storage device
US11249853B2 (en) System and method for creating a snapshot of a subset of a database
CN103617133A (en) Method and device for compressing virtual memory in Windows system
CN110659248A (en) User mode file system design method and system based on nonvolatile memory
CN113326078A (en) Method, equipment and storage medium for dynamically updating software development kit
US11055184B2 (en) In-place garbage collection of a sharded, replicated distributed state machine based on supersedable operations
CN112948336B (en) Data acceleration method, cache unit, electronic device and storage medium
US20230147878A1 (en) Implementing heterogeneous memory within a programming environment
CN110347448B (en) Method for constructing runtime model of terminal application behavior

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant