Ultra-long filename implementation method based on FUSE technology in Linux system

By adopting the intermediate layer of virtual file system based on FUSE technology in Linux systems, the ext4 file system's limitation on file name length is solved, and the support for long file names is realized, which improves user experience and system practicality.

CN119884046AInactive Publication Date: 2025-04-25KYLIN CORP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510379045.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-04-25
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The ext4 file system in the existing Linux operating system has limitations on file name length and cannot meet the needs of long file names in some professional applications, resulting in limited user experience and increased technical complexity.

Method used

The ultra-long file name implementation method based on FUSE technology is adopted, and the virtual file system intermediate layer that supports long file names is designed between the user interface layer and the kernel driver layer to support ultra-long file names. The method includes a user configuration management module, a file management module, a virtual file system intermediate layer that supports long file names and a driver adapter module. It uses the DBus communication protocol and the FUSE driver module to realize the bidirectional mapping of long file names and the underlying short file names.

Benefits of technology

It realizes the support of long file names with file names exceeding 255 bytes in Linux systems, which improves user freedom of use and system practicality, reduces user operation difficulty and system maintenance costs, and maintains compatibility with existing operating systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119884046A_ABST
    Figure CN119884046A_ABST
Patent Text Reader

Abstract

The invention provides an ultra-long filename implementation method based on a FUSE technology under a Linux system, and belongs to the field of computer file systems, the implementation system designs a virtual file system middle layer supporting a long filename between a user interface layer and a driving layer of a kernel based on the FUSE technology so as to support the ultra-long filename. Comprising the following modules: a user configuration management module, a file management module, a virtual file system intermediate layer supporting a long file name, and a drive adaptation module. According to the method, an enhancement function exceeding the limitation of a standard file system is provided for a user, the user is allowed to customize a plurality of directories and supported lengths, and the convenience of effective isolation and automatic mounting among users is realized. Meanwhile, compatibility with an existing system and use habits of a user are kept.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an extra-long file name of a computer file, and in particular to an implementation method of an extra-long file name based on FUSE technology, and belongs to the field of computer file systems. Background Art

[0002] As the amount of data surges, users' demands for file systems have also grown accordingly. The Linux operating system is widely used in a variety of scenarios, such as servers, embedded systems, and personal computers, due to its stability and flexibility. The ext4 file system dominates Linux, and its conventional limit on file name length is 255 bytes, which is sufficient in most cases. However, in some special application areas, such as scientific research, legal document management, or multimedia content production, users often need to create file names that contain a lot of descriptive information, or use non-ASCII characters such as Chinese characters, and face file name lengths exceeding 255 bytes. In these scenarios, this limitation of ext4 may result in the inability to save complete information, thereby failing to meet the specific needs of professional users.

[0003] In the current technical environment, the design of Linux's ext4 file system relies on kernel support, which limits the expansion of its functions and increases the complexity of development and maintenance, especially when it is necessary to support file names longer than 255 bytes.

[0004] In the existing Linux operating system's ext4 file system, the length of the file name is limited, which causes users to face some challenges when using the file system. The existing technology for handling long file names includes truncating the file name, modifying the kernel limit of the ext4 file system, and using symbolic links and hard links. However, these methods have their own limitations: 1) Kernel dependency: The file name length limit in Linux systems usually stems from the design of the file system, which often requires kernel support. Therefore, any modification or extension of the file system features requires the cooperation of the kernel, which limits the flexibility and scalability of the file system. For example, the ext4 file system only supports file names with a length of 255 bytes. To overcome this limitation, the kernel design of the ext4 file system needs to be modified, but this is difficult, risky, and poorly diversified.

[0005] 2) Limitations of symbolic links and hard links: Although symbolic links and hard links provide a way to circumvent file name length limitations, they are not a panacea. Symbolic links may become invalid if the original file they point to is moved or deleted, and hard links do not support directory nesting, which limits their application in complex file structures.

[0006] 3) Limited user experience: Due to the limitation of file name length, users may need to sacrifice clarity and descriptiveness when naming files. Secondly, when trying to copy files with long file names on other file systems, the system may fail to copy or directly truncate the file name. These all affect the user experience and make file management and identification more difficult.

[0007] Therefore, the shortcomings of the existing technology make it difficult for users to meet their needs in certain application scenarios, the user experience is limited, and the technical difficulty and complexity are increased. Summary of the invention

[0008] In view of the above problems, the present invention proposes a solution based on FUSE technology, aiming to overcome the limitations of the prior art and realize the creation and management of long file names with a file name length greater than 255 bytes under the ext4 file system in the Linux system.

[0009] To achieve the above object, the technical solution of the present invention is: The ultra-long file name implementation system based on FUSE technology in Linux system is designed based on FUSE technology between the user interface layer and the kernel driver layer to support long file names. It supports ultra-long file names and includes the following modules: The user configuration management module is set in the user interface layer, provides a dynamic configuration interface through the DBus communication protocol, and receives configuration parameters input by the user; The file management module is connected to the user configuration management module and is used to provide a preset DBus communication interface to pass user configuration parameters to the virtual file system middle layer that supports long file names, triggering dynamic mounting of the virtual file system; The virtual file system middle layer that supports long file names is connected to the user configuration management module and the file management module to provide a virtual file system logic implementation unit that supports long file names; The driver adapter module is built in the kernel and connected to the virtual file system middle layer that supports long file names. It calls the native API of the underlying file system through the Linux VFS interface.

[0010] Furthermore, the user configuration parameters include the path of the directory supporting long file names and a maximum file name length threshold.

[0011] Furthermore, the file management module is also used to automatically detect whether there is a virtual file system supporting long file names that needs to be mounted after the system is restarted.

[0012] Furthermore, the workflow of the file management module is as follows: Step S1: After the user logs in, the directory supporting long file names in the user configuration parameters is obtained, and the directory supporting long file names set by the user is mounted as a virtual file system supporting long file names; Step S2: When the user creates or copies a file, determine whether the file name length is greater than 255 bytes: If it does not exceed the limit, create or copy the file directly; If it exceeds, it will further determine whether the current directory supports long file names: if it does, directly create or copy the file; if it does not, the user will be reminded to specify a directory that supports long file names and a maximum file name length threshold. Through the preset DBus communication interface, the directory that supports long file names is dynamically mounted as a virtual file system that supports long file names, the file is saved in the virtual file system that supports long file names, and the configuration file that stores the directory that supports long file names and the maximum file name length threshold is saved.

[0013] Furthermore, the logic implementation unit is used to intercept the file operation request triggered by the upper application through the user interface layer, realize the bidirectional mapping between the long file name and the underlying short file name, and redirect the long file name to the actual storage path.

[0014] Furthermore, the driver adaptation module includes a FUSE driver module and an ext4 driver module, which are respectively used to provide the FUSE driver in the kernel and to connect to the underlying file system and execute standardized file operation instructions.

[0015] The method for implementing an extra-long file name based on FUSE technology in a Linux system using the above-mentioned implementation system includes the following steps: S1. A user creates or copies a file with a file name length greater than 255 bytes in a directory of the Linux operating system. S2, the file management module determines whether the file name length of the file exceeds 255 bytes, and whether the current directory supports long file names; S3. If the file name length exceeds 255 bytes and the directory does not support long file names, the file system UI pop-up window is triggered according to the operation of S2, prompting the user whether the current directory needs to be mounted as a virtual file system that supports long file names; S4. If the user selects to mount the virtual file system that supports long file names, the system mounts the directory selected by the user as the virtual file system that supports long file names; S5. If the user chooses not to mount the file system as one that supports long file names, the system will process the long file name files in the default manner.

[0016] Furthermore, in step S4, the virtual file system supporting long file names supports a file name length of 512 bytes by default, with an upper limit of 4096 bytes.

[0017] Furthermore, the default way of processing the file with a long file name in step S5 includes prompting that the file name is too long and cannot be created, or directly truncating it.

[0018] The beneficial effects of the method for realizing an ultra-long file name based on FUSE technology under Linux system of the present invention are as follows: The present invention is compatible with the Linux system and can process long file names in a desktop environment, thus better meeting the needs of users in a desktop operating system; users can freely set directories that support long file names and the maximum length that can be supported, thus improving the user's freedom of use; the present invention also enhances the practicality and user experience of the system, without the need for users to install additional software, thus reducing the user's operating difficulty and system maintenance cost.

[0019] The present invention is based on the introduction of FUSE technology (Filesystem in Userspace), allowing developers to implement file system logic in user space without modifying the kernel, thereby providing flexibility in expanding and customizing the file system while maintaining compatibility with existing operating systems; the present invention utilizes the flexibility and efficiency of FUSE to provide a novel solution for processing files with file name lengths exceeding 255 bytes for the ext4 file system under Linux.

[0020] The specific technical effects and implementation mechanisms are as follows: 1) Seamless integration: The present invention implements the logic of supporting the file system with extra-long file names based on FUSE technology, and works seamlessly with the existing file system, thereby eliminating the need to modify the kernel code or the internal structure of the existing file system.

[0021] 2) Long file name processing mechanism: The present invention includes a logic implementation unit that uses a hash table to map long file names to original short file names in ext4 (or other underlying file systems), effectively solving the limitation problem of file name length exceeding 255 bytes.

[0022] 3) File name mapping relationship storage: The present invention implements a mechanism to store the mapping relationship between long file names and short file names in a specified file, so that long file names can be effectively identified and processed.

[0023] 4) Automatic mount: Through the Dbus communication interface, automatic mount is triggered dynamically. After the system starts, the configuration file is read according to Dbus to complete the restart mount. The user does not need to specify a directory multiple times to support long file names.

[0024] 5) User-defined directories and supported file name lengths: The present invention allows users to "customize directories and supported file name lengths" according to personal needs. Users can specify one or more directories to support extra-long file names, and can flexibly set the file name lengths of these directories up to the limit of 4096 bytes supported by the FUSE driver. This provides users with unprecedented flexibility and freedom to meet their special requirements for file naming.

[0025] 6) Consistency of user experience: The present invention ensures that the operation of long file names is consistent with the existing file system operation mode when the user uses it. The user does not need to be aware of the processing process behind it, which simplifies user interaction.

[0026] 7) Compatibility across file systems: The long file name implementation method of the present invention supports long file names copied from other file systems, avoiding the problem of name truncation or failure to copy, and improving the efficiency of data migration between different file systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0028] Figure 1 : System architecture diagram of the system for implementing ultra-long file names based on FUSE technology in Linux system; Figure 2 : Another system architecture diagram of the ultra-long file name implementation system based on FUSE technology under Linux system; Figure 3 : The main processing flow chart of the file management module of the present invention; Figure 4 : The present invention is based on the FUSE technology for the long file name reading and writing operation process diagram; Figure 5 : A flowchart of the construction steps of the method for implementing an ultra-long file name based on FUSE technology under the Linux system of the present invention; Figure 6 : The present invention stores file examples based on the long file name-short file name mapping relationship of FUSE technology. DETAILED DESCRIPTION

[0029] The technical scheme in the embodiment of the present invention is described clearly and completely below in conjunction with the accompanying drawings in the embodiment of the present invention. In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention can also be implemented in other ways different from those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present invention, so the present invention is not limited by the specific embodiments disclosed below.

[0030] Definitions of Abbreviations and Key Terms: FUSE (Filesystem in Userspace): is a mechanism for Unix-like operating systems that allows non-privileged users to create their own file systems without editing the kernel code. This is achieved by running the file system code in user space, and the FUSE kernel module provides a "bridge" from the user interface layer to the actual kernel interface.

[0031] VFS (Virtual File System): is an abstract layer used to manage file storage and access in an operating system. VFS isolates file operations in user space from underlying physical storage or file systems through intermediate layers (such as file tables, directory tables, and inode structures), thereby achieving unified management of multiple storage devices and file systems.

[0032] DBus (Dynamic Broadband UNIX System): is a high-performance network interface technology. DBus is an asynchronous communication protocol based on message passing, allowing multiple devices (such as microcontrollers, embedded systems or computer hardware) to communicate efficiently by sharing a physical bus. It achieves efficient collaboration between devices through message queues and synchronization mechanisms.

[0033] Character: A symbol used to represent text, such as letters, numbers, punctuation marks, or other written symbols. In computers, characters are usually converted into numbers through encoding systems (such as ASCII, Unicode, etc.) so that computers can store and process them. For example, ASCII encoding uses one byte (8 bits) to represent English characters, while UTF-8 encoding may use one to four bytes to represent a Unicode character. For commonly used Chinese characters, 3 bytes are usually used to encode; for uncommon or rare Chinese characters, only 1 or 2 bytes may be needed.

[0034] Byte: It is a unit of storage space size used in computer information technology, usually used to represent the capacity of computer memory or storage devices (such as hard disks, flash memory, etc.). A byte consists of 8 bits, each of which can be 0 or 1, so a byte can represent 256 different values.

[0035] The basic file system attributes of ext4 on the Linux system have been clarified. In order to overcome the defects of the prior art, the present invention builds an intermediate layer between the file system and the upper application on this basis, and the intermediate layer handles the limitation of the file name length to finally meet the demand.

[0036] The present invention proposes a method for implementing ultra-long file names based on FUSE technology in the Linux system, which can effectively break through the file name length limitation of traditional file systems. This solution breaks through the file name length limitation (255 bytes) of traditional file systems (such as ext4) by customizing and mounting a virtual file system that supports ultra-long file names in user space, significantly improving the flexibility and practicality of file management. Example 1

[0037] Figure 1 and Figure 2 The system architecture diagram of the ultra-long file name implementation system based on FUSE technology in the Linux system provided by the present invention, wherein: Figure 1 Focus on the logical construction of each functional module, Figure 2 Focus on the functional coordination of various functional modules when implementing ultra-long file names.

[0038] The core of the present invention is to construct a layered virtual file system architecture, that is, to design a virtual file system middle layer that supports long file names between the user interface layer and the kernel driver layer based on FUSE technology, such as Figure 1 and Figure 2 As shown, it includes the following modules: 1) User configuration management module (user interface layer) A dynamic configuration interface is provided through the DBus communication protocol to receive configuration parameters input by the user. The configuration parameters include: the path of the directory that supports long file names (hereinafter also referred to as the "target directory") and the maximum file name length threshold.

[0039] 2) File management module It is connected to the user configuration management module to provide a preset DBus communication interface to pass user configuration parameters to the middle layer (i.e., the FUSE layer), trigger the dynamic mounting of the virtual file system, and automatically detect whether there is a virtual file system that supports long file names that needs to be mounted after the system restarts.

[0040] Figure 3 This is a specific flowchart of the file management module of the present invention to achieve the above functions: Step S1: After the user logs in, the directory supporting long file names in the user configuration parameters is obtained, and the directory supporting long file names set by the user is mounted as a virtual file system supporting long file names; Step S2: When the user creates or copies a file, determine whether the file name length is greater than 255 bytes: If it does not exceed, directly create or copy the file (corresponding to Figure 3 "Create or copy file successfully"); If it exceeds, further determine whether the current directory supports long file names: If it does, directly create or copy the file (corresponding to Figure 3 If not supported, the user is prompted to specify a directory that supports long file names (the user can freely select the directory) and a maximum file name length threshold (512 bytes by default, with an upper limit of 4096 bytes). Through the preset DBus communication interface, the directory that supports long file names is dynamically mounted as a virtual file system that supports long file names (corresponding to the FUSE layer), the file is saved in the virtual file system that supports long file names, and the configuration file that stores the directory that supports long file names and the maximum file name length threshold is saved.

[0041] After the system restarts, the DBus communication interface will read the configuration file that supports long file names, obtain the directory that supports long file names and the maximum file name length threshold, and automatically mount the directory as a virtual file system that supports long file names, so that it can be set once and automatically mounted.

[0042] 3) Virtual file system middle layer (FUSE layer) supporting long file names Connected with the user configuration management module and the file management module, it provides a virtual file system logic implementation unit that supports long file names, which is used to intercept file operation requests triggered by upper-layer applications through the user interface layer, realize two-way mapping between long file names and underlying short file names, and redirect long file names to actual storage paths. The virtual file system logic implementation unit that supports long file names is implemented based on FUSE technology, which is responsible for completing the logic implementation of the customized long file name file system. By using FUSE technology, the function of the file system can be expanded to support long file names without modifying the underlying file system.

[0043] The specific implementation means of the logic implementation unit include: Operation virtualization: Provides rewriting of FUSE's create (new file), readdir (read file), rename (rename) and other file operation interfaces, intercepts and parses requests for creating, reading, renaming, etc. for files with extra-long file names; Mapping establishment, storage and query: After the target directory is mounted as a virtual file system that supports long file names, a hidden metadata file (such as .longname) is created in the target directory, a hash correspondence table between long file names and short file names (the longest file name that can be stored in the ext4 file system) is established, and the mapping relationship between long file names (>255 bytes) and automatically generated short file names (≤255 bytes) is stored in the target directory; like Figure 4As shown, taking the read and write operations as an example, when the user needs to perform file operations such as read and write on a file, the logic implementation unit will detect whether the file is a long file name file: if it is a long file name file, then based on the FUSE technology, the read and write operation request is intercepted, and then the target directory is queried to see whether the file storing the mapping of the long file name to the short file name exists: if it does not exist, it returns that the target directory does not have a long file name file; if it exists, the mapping relationship between the long file name and the short file name (for example, Figure 6 As shown in the figure, the short file name is obtained, and the corresponding file on the ext4 file system in the kernel is found according to the short file name, and the read and write operation requests are sent to the FUSE driver module in the kernel to process the real read and write operations of the file; then, the result of the read and write operation success or failure returned by the FUSE driver module is received and returned to the user interface layer, and the read and write operations of the long file name file are completed; Path redirection: Convert the virtual path into the real path of the underlying file system according to the mapping relationship, and call the driver layer to execute the actual operation request.

[0044] 4) Driver Adaptation Module (Driver Layer) The driver adapter module is built in the kernel and connected to the virtual file system middle layer that supports long file names. It includes a FUSE driver module and an ext4 driver module, which are used to provide the FUSE driver in the kernel and connect to the underlying file system (such as ext4) to execute standardized file operation instructions.

[0045] The driver adapter module calls the native API of the underlying file system through the Linux VFS interface to ensure that operations such as reading, writing, and permission control are consistent with native behaviors.

[0046] In the driver adaptation module, the FUSE driver module is used to process specific operation requests for files issued by the logic implementation unit, such as creating, copying, renaming, reading and writing, and receiving the operation results returned by the ext4 driver module, such as whether the new file, copying, and renaming are successful, and finally return to the user interface layer through the virtual file system middle layer that supports long file names, thereby completing regular file operations such as creation and copying.

[0047] Please continue to combine Figure 2 As shown: In the present invention, the "operation results" of the file management module, the logic implementation unit and the kernel all include conventional operation results such as creating, copying, reading and writing files; "long file name file operation" includes conventional operations such as reading, writing, creating, copying, connecting, and viewing properties; the result returned by the driver layer is the specific operation result of the file, such as reading the content in the file, whether the file is copied successfully, and whether the renaming is successful.

[0048] The solution of the present invention not only breaks through the file name length limit of traditional file systems, but also significantly improves the user's ability to handle files with long file names through a flexible configuration mechanism and a user-friendly operation interface, providing an innovative solution to modern data management needs. Example 2

[0049] On the basis of Example 1, the method for implementing an ultra-long file name based on FUSE technology under a Linux system of the present invention comprises the following steps: Figure 5 As shown: S1. When a user creates or copies a file with a file name length greater than 255 bytes in a directory of the Linux operating system; S2, the file management module determines whether the file name length of the file exceeds 255 bytes, and whether the current directory supports long file names; S3. If the length of the file name exceeds 255 bytes and the current directory does not support long file names, a UI pop-up window is triggered according to the operation of S2, prompting the user whether the current directory needs to be mounted as a virtual file system that supports long file names. The default supported length of the virtual file system that supports long file names is 512 bytes. In the above process, the user configuration management module provides a dynamic configuration interface through the DBus communication protocol to complete information interaction, thereby determining whether it is necessary to trigger the dynamic mounting of the virtual file system.

[0050] S4. If the user selects to mount the virtual file system that supports long file names, the system mounts the directory selected by the user as the virtual file system that supports long file names; In the S4 system, once a directory is designated as a FUSE-based virtual file system that supports long file names, the FUSE daemon (corresponding to the function of the FUSE layer) will be activated to wait for further requests from the user layer. When the user creates or copies a file with a file name longer than 255 bytes, the virtual file system will create a hash table between the long file name and the short file name (the longest file name that can be stored in the ext4 file system) and store the mapping relationship in the designated file.

[0051] After that, the daemon will pass the file operation request to the FUSE driver module in the kernel, and then the FUSE driver module will forward the file operation request to the ext4 driver module in the kernel, and then operate the underlying ext4 file system. The operation result is returned to the FUSE driver module in the kernel through the kernel's etx4 driver module, and then passed to the custom FUSE logic implementation unit, and finally returned to the file system UI, thus completing operations such as creation and copying.

[0052] After that, in this directory, the user's reading and writing operations on long file names will be processed by the virtual file system that supports long file names, effectively solving the limitation problem of file name length exceeding 255 bytes.

[0053] S5. If the user chooses not to mount the virtual file system that supports long file names, the system can only process files with long file names in the default manner, such as prompting that the file name is too long and cannot be created, or directly truncating it.

[0054] It can be seen from the above embodiments that the present invention provides a method for implementing an ultra-long file name based on FUSE technology in a Linux system, which can support a file name length exceeding 255 bytes, with an upper limit of 4096 bytes supported by the FUSE driver, while maintaining compatibility with existing file systems and user usage habits. The technical features and effects are summarized as follows: 1. The present invention expands the capabilities of the existing file system without changing the basic functions, interfaces and kernel codes of the original file system, so that users can create, copy, rename files with long file names without changing the usage habits of the existing system, greatly reducing the difficulty and complexity of development.

[0055] By utilizing the FUSE framework, the present invention realizes the extension function of the file system in the user space, avoids modifying the kernel code, and reduces the risk and complexity of system updates; provides a dynamic configuration interface through the DBus communication protocol, receives the target directory path and the maximum file name length threshold input by the user, completes the interaction of user data to the middle layer, and makes the operation more convenient; the FUSE driver module acts as an intermediary between the user space and the kernel space, ensuring that the operation of the long file name can be correctly transmitted to the underlying physical file system.

[0056] 2. The mapping mechanism between long file names and short file names maps long file names to compatible short file names by establishing a hash table and saving them in a hidden file. This solves the problem of the file system handling long file names without changing the structure of the underlying file system. It also solves the problem of being unable to copy or having the file name truncated when copying files with long file names from other file systems, enhances the migration efficiency of long file name data between different file systems, and reduces the cost of data migration.

[0057] 3. The file storing the mapping relationship ensures that the mapping relationship between long file names and short file names remains consistent even after a system restart or failure, which is crucial for data reliability and integrity.

[0058] 4. Users only need to set it once to mount a specific directory as a virtual file system that supports long file names. The mounting process will be automatically completed on the current file system and any subsequent restarts.

[0059] 5. The present invention also provides the flexibility of user-defined settings, allowing users to specify multiple directories to support long file names, and define the file name lengths supported by these directories; the default setting is 512 bytes, but users can adjust it to the maximum file name length of 4096 bytes supported by the FUSE driver to meet personalized needs.

[0060] 6. Since FUSE operations are completed in user space, developers can use high-level languages ​​to write file system codes without in-depth understanding of kernel programming, so the present invention can improve development efficiency. Users do not need to perform additional learning when using the implementation method of the present invention, because all operations follow the existing file system operation habits. This seamless experience improves user satisfaction. In summary, the present invention implements the function of supporting ultra-long file names based on FUSE technology and utilizes the unique advantages of FUSE technology, which not only provides users with enhanced functions beyond the limitations of standard file systems, but also allows users to customize multiple directories and supported lengths, thereby achieving effective isolation between users and the convenience of automatic mounting. At the same time, the present invention maintains compatibility with existing systems and user usage habits.

[0061] The implementation method of the present invention demonstrates that the functions of the existing system can be effectively expanded without sacrificing performance and compatibility, so that users can complete the naming of file names with more detailed descriptions in specific scenarios.

[0062] Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

Claims

1. An ultra-long file name implementation system based on FUSE technology under Linux system, characterized in that: Based on FUSE technology, a virtual file system middle layer that supports long file names is designed between the user interface layer and the kernel driver layer to support ultra-long file names, including the following modules: The user configuration management module is set in the user interface layer, provides a dynamic configuration interface through the DBus communication protocol, and receives configuration parameters input by the user; The file management module is connected to the user configuration management module and is used to provide a preset DBus communication interface to pass user configuration parameters to the virtual file system middle layer that supports long file names, triggering dynamic mounting of the virtual file system; The virtual file system middle layer that supports long file names is connected to the user configuration management module and the file management module to provide a virtual file system logic implementation unit that supports long file names; The driver adapter module is built in the kernel and connected to the virtual file system middle layer that supports long file names. It calls the native API of the underlying file system through the Linux VFS interface.

2. The system for realizing an ultra-long file name based on FUSE technology in a Linux system according to claim 1, characterized in that: The user configuration parameters include the path of the directory supporting long file names and the maximum file name length threshold.

3. The system for realizing an ultra-long file name based on FUSE technology in a Linux system according to claim 1, characterized in that: The file management module is also used to automatically detect whether there is a virtual file system supporting long file names that needs to be mounted after the system is restarted.

4. The system for realizing an ultra-long file name based on FUSE technology in a Linux system according to claim 1, characterized in that: The workflow of the file management module is as follows: Step S1: After the user logs in, the directory supporting long file names in the user configuration parameters is obtained, and the directory supporting long file names set by the user is mounted as a virtual file system supporting long file names; Step S2: When the user creates or copies a file, determine whether the file name length is greater than 255 bytes: If it does not exceed the limit, create or copy the file directly; If it exceeds, the system will further determine whether the current directory supports long file names. If it does, the file will be created or copied directly. If it is not supported, the user will be reminded to specify the directory that supports long file names and the maximum file name length threshold separately. Through the preset DBus communication interface, the directory that supports long file names will be dynamically mounted as a virtual file system that supports long file names, and the file will be saved in the virtual file system that supports long file names. The configuration file that stores the directory that supports long file names and the maximum file name length threshold will also be saved.

5. The system for realizing an ultra-long file name based on FUSE technology in a Linux system according to claim 1, characterized in that: The logic implementation unit is used to intercept the file operation request triggered by the upper application through the user interface layer, realize the bidirectional mapping between the long file name and the bottom short file name, and redirect the long file name to the actual storage path.

6. The system for realizing an ultra-long file name based on FUSE technology in a Linux system according to claim 1, characterized in that: The driver adaptation module includes a FUSE driver module and an ext4 driver module, which are respectively used to provide the FUSE driver in the kernel and to connect to the underlying file system and execute standardized file operation instructions.

7. A method for implementing an ultra-long file name based on FUSE technology in a Linux system using the implementation system described in any one of claims 1 to 6, characterized in that: The steps include: S1. A user creates or copies a file with a file name length greater than 255 bytes in a directory of the Linux operating system. S2, the file management module determines whether the file name length of the file exceeds 255 bytes, and whether the current directory supports long file names; S3. If the file name length exceeds 255 bytes and the directory does not support long file names, the file system UI pop-up window is triggered according to the operation of S2, prompting the user whether the current directory needs to be mounted as a virtual file system that supports long file names; S4. If the user selects to mount the virtual file system that supports long file names, the system mounts the directory selected by the user as the virtual file system that supports long file names; S5. If the user chooses not to mount the file system as one that supports long file names, the system will process the long file name files in the default manner.

8. The method for implementing an ultra-long file name based on FUSE technology in a Linux system according to claim 7, characterized in that: In step S4, the virtual file system supporting long file names supports a file name length of 512 bytes by default, with an upper limit of 4096 bytes.

9. The method for implementing an ultra-long file name based on FUSE technology in a Linux system according to claim 8, characterized in that: The default way of processing the file with a long file name in step S5 includes prompting that the file name is too long and cannot be created, or directly truncating it.

Citation Information

Patent Citations

  • System structure and method for realizing support for long filenames in short-filename file systems

    CN101673261A

  • File processing method and device, electronic equipment and computer readable storage medium

    CN117407366A

  • File management program, data structure, and file management device

    JP2006092088A

  • Delayed file virtualization

    US20070162510A1