Method, device and system for transferring file layout in user mode of file service system

By creating a file layout transfer device and using the ioctl function in the NFS-Ganesha system, the problem that the user state cannot directly obtain and submit the file layout is solved, the pNFS function of the user state is realized, and the file reading and writing performance is improved.

CN118012839BActive Publication Date: 2024-09-20HUNAN GUOKE YICUN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410050788.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-12
Publication Date
2024-09-20
Estimated Expiration
2044-01-12

AI Technical Summary

Technical Problem

The NFS-Ganesha system cannot directly obtain and submit the file layout in the user mode, resulting in the inability to implement the pNFS function.

Method used

By creating a file layout transfer device during kernel state initialization, the user state opens the device and constructs a file layout request, and uses the ioctl function to pass the request to the kernel state. After receiving it, the kernel state calls the corresponding file layout function through the file pointer, and sends the information back User mode implements the acquisition and submission of file layout.

Benefits of technology

The acquisition and submission of file layout in user mode enables the NFS-Ganesha system to have pNFS functionality, improving the efficiency and performance of file reading and writing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118012839B
    Figure CN118012839B
Patent Text Reader

Abstract

The present invention discloses a method and system for transferring file layout in user state of a file service system, the method comprising the following steps: creating a file layout transfer device when the kernel state is initialized so as to be used for transferring file layout request from the user state to the kernel state; opening the file layout transfer device in the user state and constructing a file layout request, the file layout request comprising any one of a file layout acquisition request, a file layout submission request and a file system device information acquisition request; transferring the file layout request to the kernel state by calling an ioctl function, and transferring the file layout request to the kernel state; when the kernel state receives the file layout request transferred from the user state, determining the request type and obtaining a file pointer, calling a file layout function corresponding to the request type through the obtained file pointer, and sending the obtained file layout information to the user state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an NFS-Ganesha file service system, and in particular to a method, device and system for transferring file layout in a user state of the file service system. Background Art

[0002] NFS-Ganesha is a NFS (Network File System) server program that runs in Linux user mode and supports nfsv3, nfsv4, nfsv4.1 and nfsv4.2 protocols. NFS-Ganesha has a file system abstraction layer (FSAL) design, which can connect to various file systems through the file system abstraction layer module. The FSAL (File System Abstraction Layer) module can connect to various server-side local file systems, such as the XFS file system. FSAL supports various file reads, writes and metadata operations of nfsv4, but does not support pNFS (Parallel Network File System) functions. The main reason is that the user-mode FSAL module cannot call the file layout-related functions in the kernel mode, and therefore cannot directly obtain and submit the file layout.

[0003] Specifically, in the prior art, in the NFS-Ganesha system, the file layout function can only be called in the kernel state, so the file layout function to be called, the parameters required by the function, and the memory address for storing the file layout must be passed to the kernel state. After the kernel state obtains the passed information, it calls the corresponding function and passes the obtained information to the user state. The VFS module in the user state cannot directly obtain and submit the file layout, that is, it does not have the pNFS function. Summary of the invention

[0004] The technical problem to be solved by the present invention is: in response to the technical problems existing in the prior art, the present invention provides a method, device and system for transmitting file layout in user state of a file service system, which can obtain file layout and submit file layout in user state, so that NFS-Ganesha in user state can realize pNFS function.

[0005] In order to solve the above technical problems, the technical solution proposed by the present invention is:

[0006] A method for transferring file layout in a user mode by a file service system, the steps comprising:

[0007] When the kernel state is initialized, a file layout transfer device is created to be used by the user state to transfer the file layout request to the kernel state;

[0008] Opening the file layout delivery device in user mode and constructing a file layout request, wherein the file layout request includes any one of a file layout acquisition request, a file layout submission request, and a file system device information acquisition request;

[0009] The file layout transfer device transfers the file layout request to the kernel state by calling an ioctl (input / output control) function;

[0010] When the kernel state receives a file layout request transmitted by the user state, it determines the request type and obtains the file pointer, calls the file layout function corresponding to the request type through the obtained file pointer, and sends the obtained file layout information to the user state.

[0011] Furthermore, before opening the file layout transfer device in the user state, it also includes defining the file layout request type in the file layout transfer kernel module, corresponding each file layout request type to a file layout request processing interface, loading the file layout transfer kernel module in the user state, creating a character device in the kernel state, and registering the file layout request processing interface to the character device.

[0012] Furthermore, the file layout acquisition request includes any one or more parameters of a file descriptor, a file read / write mode, a requested file layout offset, a requested file layout length, and a variable storing a file layout address; the file layout submission request includes any one or more parameters of a file descriptor, a flag indicating whether to modify a time attribute, a required modification time, a file's last written length, and a number of file layouts that need to be submitted for the file; each file layout includes a file layout address, a file offset, and a write length; the file system device information acquisition request includes a file descriptor and a variable storing a file system block device UUID (Universally Unique Identifier).

[0013] Further, calling a file layout function of a corresponding request type through the acquired file pointer includes:

[0014] If the file layout request is a file layout acquisition request, the file layout acquisition function in the output operation set of the file system is called to acquire the file layout, and then the file layout data is saved in the memory;

[0015] If the file layout request is a file layout submission request, call the file layout submission function in the output operation set of the file system to submit all file layouts;

[0016] If the file layout request is a file system device information acquisition request, the file system device information acquisition function in the file system output operation set is called to acquire and save the file system device information into the memory.

[0017] Furthermore, sending the acquired file layout information to the user state includes: when the user state receives the kernel state execution result, the user state determines whether the file layout request command is executed successfully according to the return value of the received ioctl function, and if the execution is successful, copies the file layout and file system device information from the file layout request.

[0018] Furthermore, it also includes pre-creating multiple file layout delivery devices to provide multiple file layout request delivery channels, and establishing a file layout request processing thread pool in user mode according to the number of channels to concurrently process file layout requests.

[0019] Further, the step of obtaining a file pointer, calling a file layout function corresponding to the request type through the obtained file pointer, and sending the obtained file layout information to the user state includes:

[0020] First, use the ioctl function to get the file pointer from the kernel-mode module through the user-mode file descriptor, and save the file pointer mapped by the file descriptor in the shared memory;

[0021] The user state then asynchronously sends the file layout request through the NetLink socket;

[0022] After receiving the file layout request through the NetLink socket, the kernel-mode module obtains the file pointer corresponding to the file descriptor through the shared memory;

[0023] Call the corresponding file layout function and send the execution result to the user state through the NetLink socket.

[0024] A device for implementing the method of transferring file layout in user mode in the file service system, comprising:

[0025] The file layout transfer user state module is used to provide an interactive interface, switch the file layout transfer device, call the ioctl function to transfer the file layout request to the kernel state, and construct the file layout request according to the file layout interface parameters;

[0026] The file layout transfer kernel module is used to create character devices, manage character device deregistration, and return execution results according to the file layout request type.

[0027] Furthermore, the file layout transfer user state module includes:

[0028] A file layout interface management unit, used to provide an interactive interface for obtaining and submitting file layout;

[0029] Character device operation unit, the user opens and closes the file layout transfer device, and calls the ioctl function to transfer the file layout request to the kernel state;

[0030] A file layout request generating unit, used for constructing different file layout requests according to file layout interface parameters;

[0031] The file layout transfer kernel module includes:

[0032] A character device creation unit, used for generating a device number, registering a file layout request processing interface to a character device, registering a character device, and creating a character device file;

[0033] A file layout request management unit, used to determine the file layout request type, execute the corresponding request according to the file layout request type and return the execution result;

[0034] The character device deregistration unit is used to delete character device files, deregister character devices, and release device numbers.

[0035] A file service system includes a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to perform the above method.

[0036] Compared with the prior art, the advantages of the present invention are as follows: the present invention creates a file layout transfer device for transferring file layout requests to the kernel state. After the user state opens the file layout transfer device, the file layout request is constructed, and the user state parameters are transferred to the kernel state by calling the ioctl function. The kernel state then obtains the file pointer through the file descriptor, and then calls the corresponding file layout function, and sends the obtained file layout information to the user state. The file layout can be obtained and submitted in the user state, so that the NFS-Ganesha in the user state can realize the pNFS function. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a flowchart of a method for transferring file layout in user mode by the file service system of this embodiment.

[0038] Figure 2 It is a schematic diagram of the structural principle of the device for transferring file layout in user mode in the file service system according to this embodiment. DETAILED DESCRIPTION

[0039] The present invention is further described below in conjunction with the accompanying drawings and specific preferred embodiments, but the protection scope of the present invention is not limited thereby.

[0040] When the FSAL module of NFS-Ganesha is in user mode, the file layout function can only be called in kernel mode. When calling the file layout function in kernel mode, it is necessary not only to pass the required file layout function, the required parameters of the function and the memory address of the file layout to the kernel mode, but also because the user mode uses file descriptors to operate on files, while the kernel mode uses file pointers to operate on files, the kernel mode also needs to be able to convert file descriptors into corresponding file pointers, making the FSAL module of NFS-Ganesha not have pNFS function. The ioctl function can be used in the device driver to send various control commands to the device, such as using the ioctl function to obtain device status information, set device properties, etc.

[0041] In order to enable the FSAL module of NFS-Ganesha to quickly obtain and submit file layout in user state, the present invention creates a file layout transfer device for transferring file layout requests to kernel state. After the user state opens the file layout transfer device, the file layout request is constructed, and the user state parameters are transferred to the kernel state by calling the ioctl function. The kernel state then obtains the file pointer through the file descriptor, and then calls the corresponding file layout function. The memory copy can copy the kernel state data to the user state memory, and the obtained file layout information is sent to the user state. The file layout can be obtained and submitted in the user state, so that the NFS-Ganesha in the user state can realize the pNFS function.

[0042] like Figure 1 As shown, the steps of the method for transferring file layout in user mode by the file service system of this embodiment include:

[0043] When the kernel state is initialized, a file layout transfer device is created to transfer the file layout request from the user state to the kernel state. The file layout transfer device mainly provides an interface for the user state module to transfer the file layout request, and transfers the file layout request from the user state to the file layout acquisition and submission kernel module, and returns the result of the kernel module executing the request to the user state module;

[0044] Open the file layout transfer device in user mode and construct a file layout request, where the file layout request includes any one of a file layout acquisition request, a file layout submission request, and a file system device information acquisition request;

[0045] The file layout transfer device transfers the file layout request to the kernel state by calling the ioctl function;

[0046] When the kernel state receives a file layout request transmitted by the user state, it determines the request type and obtains the file pointer, calls the file layout function corresponding to the request type through the obtained file pointer, and sends the obtained file layout information to the user state.

[0047] In this embodiment, before opening the file layout transfer device in the user state, it also includes defining the file layout request type in the file layout transfer kernel module, corresponding each file layout request type to a file layout request processing interface, loading the file layout transfer kernel module in the user state, and registering the file layout request processing interface to the character device by creating a character device in the kernel state. The file layout transfer kernel module is mainly used to provide the user state with a device and command that can transfer the file layout request, and then execute the file layout function according to the request of the user state, and return the execution result. When the kernel state module is initialized, a file layout transfer device is created, which is a character device, so that the user state can transfer the file layout request to the kernel state through the device.

[0048] In this embodiment, the file layout acquisition request specifically includes parameters such as the file descriptor, the file read / write mode, the requested file layout offset, the requested file layout length, and the variable storing the file layout address. The file layout submission request includes parameters such as the file descriptor, the flag indicating whether to modify the time attribute, the required modification time, the file's last written length, and the number of file layouts required to be submitted. Each file layout includes the file layout address, file offset, and write length. The file system device information acquisition request includes a file descriptor, a variable storing the file system block device UUID, etc. It can be understood that the parameter types in various requests can be specifically configured according to actual needs.

[0049] In this embodiment, when the kernel state receives the file layout request transmitted by the user state, the kernel state obtains the file pointer of the corresponding file according to the file descriptor by obtaining the file descriptor, and obtains the output operation set pointer of the file system according to the obtained file pointer. Specifically, the kernel state can use the fget function to obtain the file pointer through the file descriptor, and then use the file pointer to obtain the output operation set pointer of the file system and call the file layout function of the corresponding request type.

[0050] In this embodiment, calling a file layout function corresponding to the request type through the obtained file pointer includes:

[0051] If the file layout request is a file layout acquisition request, the file layout acquisition function in the output operation set of the file system is called to acquire the file layout, and then the file layout data is saved in the memory;

[0052] If the file layout request is a file layout submission request, call the file layout submission function in the output operation set of the file system to submit all file layouts;

[0053] If the file layout request is a file system device information acquisition request, the file system device information acquisition function in the file system output operation set is called to acquire and save the file system device information into the memory.

[0054] In this embodiment, sending the acquired file layout information to the user state includes: when the user state receives the kernel state execution result, the user state determines whether the file layout request command is executed successfully based on the return value of the received ioctl function, and if the execution is successful, sends the file layout and file system device information from the file layout request.

[0055] In this embodiment, it also includes:

[0056] If you do not need to obtain or submit the file layout anymore, close the opened file layout obtaining and submitting device;

[0057] If you need to uninstall the file layout acquisition and submission kernel module, use the rmmod (remove module) command to uninstall it. The kernel module deletes the created character device and releases the resources occupied by the device.

[0058] Through the above steps, this embodiment can pass the file layout request to the kernel state with the help of the created file layout transfer device. After the user state opens the file layout transfer device, the user state parameters are passed to the kernel state by constructing the file layout request and calling the ioctl function. The kernel state obtains the file pointer through the file descriptor and calls the corresponding file layout function, and sends the file layout information to the user state, so that the file layout can be obtained and submitted in the user state, that is, the user state of NFS-Ganesha can also have the pNFS function.

[0059] Since ioctl is not a thread-safe function, data confusion will occur when multiple clients read and write multiple files concurrently. Although using a mutex lock directly before calling the ioctl function can ensure data security, due to the competition of the mutex lock and the blocking execution of ioctl, a large number of file layout operations will be blocked and some file layout operations will not be executed, which will seriously affect the reading and writing performance of the file. This embodiment further creates multiple file layout transmission devices to provide multiple file layout request transmission channels when the kernel module is initialized, and establishes a file layout request processing thread pool in the user state according to the number of channels to concurrently process file layout requests, so as to further improve the efficiency of file reading and writing.

[0060] Considering that the switching overhead and processing capacity of the file layout request processing thread pool will also become the processing bottleneck of the file layout request during large-scale concurrent reading and writing. This embodiment further introduces NetLink (inter-process communication), a higher-performance user-state and kernel-state information interaction technology, to realize the interaction between the user state and the kernel state. NetLink's user-state message sending and kernel-state message receiving are two independent processes, resulting in the kernel state being unable to obtain the file pointer through the user-state file descriptor. This embodiment obtains the file pointer, calls the file layout function of the corresponding request type through the obtained file pointer, and sends the obtained file layout information to the user state. The steps include:

[0061] First, use the ioctl function to let the kernel-mode module obtain the file pointer through the user-mode file descriptor, and save the file pointer mapped by the file descriptor in the shared memory;

[0062] User mode sends file layout requests asynchronously through NetLink sockets;

[0063] After the kernel-mode module receives the file layout request through the NetLink socket, it obtains the file pointer corresponding to the file descriptor through the shared memory, then calls the corresponding file layout function, and finally sends the execution result to the user mode through the NetLink socket.

[0064] Through the above steps, this embodiment can give full play to the advantages of ioctl function and NetLink technology, and can further improve the file layout request processing capability while realizing the pNFS function in user mode.

[0065] This embodiment also provides an apparatus for implementing the method for transferring file layout in user mode in the file service system, including:

[0066] The file layout transfer user state module is used to provide an interactive interface, switch the file layout transfer device, call the ioctl function to transfer the file layout request to the kernel state, and construct the file layout request according to the file layout interface parameters;

[0067] The file layout transfer kernel module is used to create character devices, manage character device deregistration, and return execution results according to the file layout request type.

[0068] The above-mentioned file layout transfer kernel module mainly provides the user state with devices and commands that can transfer file layout requests, and then executes the file layout function according to the user state request and returns the execution result. In a specific application embodiment, the file layout transfer kernel module configuration has the following functions:

[0069] 1. Define the file layout request command, so that different file layout requests can be passed from user state to kernel state through ioctl function;

[0070] 2. Wait to receive the file layout request transmitted by the user state, determine the request type, obtain the file pointer according to the file descriptor, call the file layout function corresponding to the request type through the file pointer, and send the obtained file layout related information to the user state.

[0071] 3. When the kernel state module is initialized, a file layout acquisition and submission device is created so that the user state can pass the file layout request to the kernel state through this device.

[0072] 4. When the kernel-mode module is unloaded, the file layout acquisition and submission devices are deleted to release device resources.

[0073] The above-mentioned file layout transfer user state module is mainly used to generate and send file layout requests and receive the results of request execution. In a specific application embodiment, the file layout transfer user state module configuration has the following functions:

[0074] 1. Load file layout to obtain and submit kernel module;

[0075] 2. Open the file layout to obtain and submit the device and obtain the device descriptor;

[0076] 3. Prepare file layout request;

[0077] 4. Call the ioctl function to pass the file layout request to the kernel state;

[0078] 5. Wait for the kernel state to execute the file layout function and then get the return value and file layout information.

[0079] To achieve the above functions, Figure 2 As shown, the file layout transfer user state module in this embodiment specifically includes:

[0080] A file layout interface management unit, used to provide an interactive interface for obtaining and submitting file layout;

[0081] Character device operation unit, the user opens and closes the file layout transfer device, and calls the ioctl function to transfer the file layout request to the kernel state;

[0082] A file layout request generating unit, used for constructing different file layout requests according to file layout interface parameters;

[0083] The file layout transfer kernel module in this embodiment specifically includes:

[0084] A character device creation unit, used for generating a device number, registering a file layout request processing interface to a character device, registering a character device, and creating a character device file;

[0085] A file layout request management unit, used to determine the file layout request type, execute the corresponding request according to the file layout request type and return the execution result, including executing a file layout acquisition (layoutget), a file layout submission (layoutcommit) or a file system device information acquisition (getdeviceinfo) request;

[0086] The character device deregistration unit is used to delete character device files, deregister character devices, and release device numbers.

[0087] In a specific application embodiment, the steps of using the above device to transfer file layout in user mode are:

[0088] Step 1: File layout transfer kernel module defines file layout request commands including file layout acquisition command, file layout submission command and file system device information acquisition command, each command corresponds to a file layout request processing interface;

[0089] Step 2: The user state uses a command to load the file layout transfer kernel module, the kernel state creates a character device, registers the file layout request processing interface to the character device, and creates multiple file layout transfer devices in the kernel module initialization phase to provide multiple file layout request transfer channels, and establishes a file layout request processing thread pool in the user state according to the number of channels to concurrently process file layout requests;

[0090] Step 3: Open the file layout transfer device in user mode.

[0091] Step 4: The user mode generates a file layout request.

[0092] Step 5: There are three types of file layout requests: file layout acquisition (layoutget), file layout submission (layoutcommit) or file system device information acquisition (getdeviceinfo).

[0093] Step 6: The user state sends the file descriptor to the kernel state. The kernel state obtains the file pointer based on the file descriptor and saves the file descriptor and file pointer in the shared memory so that the file layout can be transferred in the future in combination with the Netlink technology. The user state sends the file layout request to the kernel state.

[0094] Step 7: The kernel state receives the file layout acquisition request transmitted by the user state, obtains the file descriptor in the file layout request parameter, obtains the file pointer of the corresponding file according to the file descriptor, and obtains the output operation set pointer of the file system according to the file pointer.

[0095] Step 8: In kernel mode, determine the file layout request command type and perform corresponding operations based on the command type:

[0096] If the file layout request command is a file layout acquisition command (layoutget), the file layout acquisition function in the output operation set of the file system is called to acquire the file layout, and then the file layout data is saved in the memory;

[0097] If the file layout request command is a file layout commit command (layoutcommit), the file layout commit function in the output operation set of the file system is called to commit all file layouts;

[0098] If the file layout request command is a file system device information acquisition command (getdeviceinfo), the file system device information acquisition function in the file system output operation set is called to acquire and save the file system device information into the memory.

[0099] Step 9: File layout transfer The kernel state sends the execution result of file layout acquisition (layoutget), file layout submission (layoutcommit) or file system device information acquisition (getdeviceinfo) to the user state.

[0100] First, the kernel-mode module uses the ioctl function to obtain the file pointer through the user-mode file descriptor, and saves the file pointer mapped by the file descriptor in the shared memory; the user-mode asynchronously sends the file layout request through the NetLink socket; after the kernel-mode module receives the file layout request through the NetLink socket, it obtains the file pointer corresponding to the file descriptor through the shared memory, and then calls the corresponding file layout function, and finally sends the execution result to the user-mode through the NetLink socket.

[0101] Step 10: The user state receives the kernel state execution result, and the user state obtains the file layout and file system device information from the file layout request.

[0102] Step 11: Get or submit the file layout, and close the opened file layout acquisition and submission device.

[0103] Step 12: Uninstall the file layout acquisition and submission kernel module. When the kernel module is uninstalled, the created character device is deleted to release the resources occupied by the device.

[0104] This embodiment also provides a file service system, including a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to perform the above method.

[0105] It is understandable that the above method of this embodiment can be executed by a single device, such as a computer or server, etc., and can also be applied to a distributed scenario and completed by multiple devices in cooperation with each other. In the case of a distributed scenario, one of the multiple devices can only execute one or more steps in the above method of this embodiment, and multiple devices interact to complete the above method. The processor can be implemented in the form of a general-purpose CPU, a microprocessor, an application-specific integrated circuit, or one or more integrated circuits, etc., for executing related programs to implement the above method of this embodiment. The memory can be implemented in the form of a read-only memory ROM, a random access memory RAM, a static storage device, and a dynamic storage device. The memory can store an operating system and other applications. When the above method of this embodiment is implemented by software or firmware, the relevant program code is stored in the memory and called and executed by the processor.

[0106] The above is only a preferred embodiment of the present invention, and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment, it is not intended to limit the present invention. Therefore, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the content of the technical solution of the present invention shall fall within the scope of protection of the technical solution of the present invention.

Claims

1. A method for transferring file layout in user mode in a file service system, characterized in that the steps include: When the kernel state is initialized, a file layout transfer device is created to be used by the user state to transfer the file layout request to the kernel state; Opening the file layout delivery device in user mode and constructing a file layout request, wherein the file layout request includes any one of a file layout acquisition request, a file layout submission request, and a file system device information acquisition request; The file layout transfer device transfers the file layout request to the kernel state by calling the ioctl function; When the kernel receives a file layout request from the user state, it determines the request type and obtains a file pointer. It then calls the file layout function corresponding to the request type through the obtained file pointer and sends the obtained file layout information to the user state. Before opening the file layout transfer device in the user state, the method further includes defining a file layout request type in the file layout transfer kernel module, corresponding each file layout request type to a file layout request processing interface, loading the file layout transfer kernel module in the user state, creating a character device in the kernel state, and registering the file layout request processing interface to the character device; The file layout acquisition request includes any one or more parameters of a file descriptor, a file read / write mode, a requested file layout offset, a requested file layout length, and a variable storing a file layout address. The file layout submission request includes any one or more parameters of a file descriptor, a flag indicating whether to modify a time attribute, a required modification time, a file's last written length, and the number of file layouts required to be submitted. Each file layout includes a file layout address, a file offset, and a write length. The file system device information acquisition request includes a file descriptor and a variable storing a file system block device UUID. The invention also includes pre-creating multiple file layout delivery devices to provide multiple file layout request delivery channels, and establishing a file layout request processing thread pool in user mode according to the number of channels to concurrently process file layout requests; The steps of obtaining a file pointer, calling a file layout function corresponding to the request type through the obtained file pointer, and sending the obtained file layout information to the user state include: First, use the ioctl function to get the file pointer from the kernel-mode module through the user-mode file descriptor, and save the file pointer mapped by the file descriptor in the shared memory; The user state then asynchronously sends the file layout request through the NetLink socket; After receiving the file layout request through the NetLink socket, the kernel-mode module obtains the file pointer corresponding to the file descriptor through shared memory; Call the corresponding file layout function and send the execution result to the user state through the NetLink socket.

2. The method for transferring file layout in user mode of a file service system according to claim 1, characterized in that: The calling of the file layout function of the corresponding request type by the obtained file pointer includes: If the file layout request is a file layout acquisition request, the file layout acquisition function in the output operation set of the file system is called to acquire the file layout, and then the file layout data is saved in the memory; If the file layout request is a file layout submission request, call the file layout submission function in the output operation set of the file system to submit all file layouts; If the file layout request is a file system device information acquisition request, the file system device information acquisition function in the file system output operation set is called to acquire and save the file system device information into the memory.

3. The method for transferring file layout in user mode of a file service system according to claim 1, characterized in that: The sending of the acquired file layout information to the user state includes: when the user state receives the kernel state execution result, the user state determines whether the file layout request command is executed successfully according to the return value of the received ioctl function, and if the execution is successful, sends the file layout and file system device information from the file layout request.

4. A device for implementing the method of transferring file layout in user mode in a file service system according to any one of claims 1 to 3, characterized in that: include: The file layout transfer user-mode module is used to provide an interactive interface, switch the file layout transfer device, call the ioctl function to transfer the file layout request to the kernel mode, and construct the file layout request according to the file layout interface parameters; The file layout transfer kernel module is used to create character devices, manage character device deregistration, and return execution results based on the file layout request type.

5. The device according to claim 4, characterized in that The file layout transfer user state module includes: A file layout interface management unit, used to provide an interactive interface for obtaining and submitting file layouts; Character device operation unit, the user opens and closes the file layout transfer device, and calls the ioctl function to transfer the file layout request to the kernel state; A file layout request generating unit, configured to construct different file layout requests according to file layout interface parameters; The file layout transfer kernel module includes: A character device creation unit is used to generate a device number, register a file layout request processing interface to the character device, register the character device, and create a character device file; A file layout request management unit, configured to determine the file layout request type, execute the corresponding request according to the file layout request type, and return the execution result; The character device deregistration unit is used to delete character device files, deregister character devices, and release device numbers.

6. A file service system comprising a processor and a memory, wherein the memory is used to store a computer program, wherein: The processor is configured to execute the computer program to perform the method according to any one of claims 1 to 3.