CN104573061B - A kind of Virtual File System apparatus and method for supporting expanded function - Google Patents

A kind of Virtual File System apparatus and method for supporting expanded function Download PDF

Info

Publication number
CN104573061B
CN104573061B CN201510034043.6A CN201510034043A CN104573061B CN 104573061 B CN104573061 B CN 104573061B CN 201510034043 A CN201510034043 A CN 201510034043A CN 104573061 B CN104573061 B CN 104573061B
Authority
CN
China
Prior art keywords
function
file system
expanded function
file
expanded
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
CN201510034043.6A
Other languages
Chinese (zh)
Other versions
CN104573061A (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.)
Nankai University
Original Assignee
Nankai University
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 Nankai University filed Critical Nankai University
Priority to CN201510034043.6A priority Critical patent/CN104573061B/en
Publication of CN104573061A publication Critical patent/CN104573061A/en
Application granted granted Critical
Publication of CN104573061B publication Critical patent/CN104573061B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/18File system types
    • G06F16/188Virtual file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of Virtual File System apparatus and method for supporting expanded function, belong to computer realm, the Virtual File System device supports the dynamic expansion feature operation for file system.Supporting the Virtual File System device of expanded function includes Virtual File System service module, file system instance module, expanded function table module and extended function module;Supporting the method for Virtual File System expanded function includes:" file system type example table " is set up when initial;" file system type " example is set up during load document system example;Register the file extent function of specified file system type;Access the file extent function of file system instance.The processing procedure of file data is gone to virtual file system to complete by the present invention from application layer, so as to reduce transmission of the file data in above-mentioned two interlayer, the processing speed of file data is effectively improved, the application of I/O intensive type is especially suitable for and based on NFS application scenarios.

Description

A kind of Virtual File System apparatus and method for supporting expanded function
Technical field
The invention belongs to computer realm, it is primarily upon improving the processing speed of file data in file system.
Background technology
Improving the processing speed of file data at present mainly has two class means, and a class is to improve computer hardware CPU place Reason ability;An other class is the cache mechanism by application layer.The common shortcoming of above-mentioned two classes means is must be waiting to locate The file data of reason is delivered on the software of application layer to handle, and such file data needs to read operation system by storage medium Unite in kernel, operating system User space is then delivered to again, or even need the calculating by network delivery to file manipulation software In the User space of machine node, this large amount of data copy expends computing resource very much, and the processing speed of file data is difficult to have Huge raising.
The content of the invention
The invention aims to effectively improve the processing speed of file data in file system.Provide a kind of using support The Virtual File System device and method of expanded function.
Technical scheme
A kind of Virtual File System device for supporting expanded function, described device includes:Virtual File System service module, File system instance module, expanded function table module and extended function module;Virtual File System service module respectively with file System example module and expanded function table module are connected with each other, and expanded function table module is unidirectionally connected with extended function module, are expanded Open up menu module by or do not pass through Virtual File System service module point to file system instance module;
Wherein, described Virtual File System service module includes:File system type instance management module, standard feature Service module, and expanded function service module;Described file system type instance management module is used for " filesystem class The management of type example table ", includes the registration and cancellation of " file system type " example;Standard feature service module is used to provide text The service of part standard feature, standard feature service module is by registered " file system type " example and belongs to the " file system " file system instance " of type " example is interrelated;Expanded function service module is used to provide customized file extent work( The service of energy, expanded function service module is mutual by registered " file system type " example and registered " expanded function table " Association;
File system instance module includes data structure example and standard feature module, " data structure example " record The runtime data of this document system example, standard feature module then provides this article based on the data of " data structure example " The file standard function of part system example performs the realization of code;
Expanded function table module, " expanded function table " for providing file extent function for specific file system instance Management;
Expanded function service module, for providing the reality that file extent function performs code for specific file system instance It is existing.
Described " expanded function table " is the set of one group of " expanded function description " structure example, wherein " expanded function Description " structure includes file system type, expanded function numbering, expanded function type, expanded function title, expanded function name Claim length and expanded function function address;" file system type example table " is one group of " file system type " structure example Set, wherein " file system type " structure contains file system type title, points to and be somebody's turn to do " file system type " correspondence " expanded function table " pointer and sensing belong to " file system type " specific " file system instance " it is " super The pointer of block ".
The expanded function service module of described Virtual File System service module provides " expanded function method of servicing ", " expanded function method of servicing " enumerates function, expanded function including expanded function and searches function, expanded function registration function and expansion Open up function and nullify function;" application program " can by using enhancing existed system service, set up between new system service, various processes Communication protocol and network communication protocol access the expanded function method of servicing of Virtual File System.
It is described invention also provides the method for the support Virtual File System expanded function based on said system device Method includes following processing procedure:
When the Virtual File System of expanded function is supported in 1st step, loading, set up and initialize " file system type example Table ";
When the 2nd step, the specific file system instance of loading, if " file system type example table " does not include the specific file system " file system type " example united corresponding to example, then set up " file system type " example and be added to " filesystem class Type example table ";And " the expanded function table " being somebody's turn to do associated by " file system type " example is further set up, and to the " extension Menu " is initialized, and adds empty " expanded function description " structure example;Further by the specific file system The associated pointers of " file system type " example corresponding to example, which are pointed to, is somebody's turn to do " expanded function table ";
3rd step, the expanded function method of servicing for accessing Virtual File System;
4th step, registration or the file extent function of nullifying specified file system type;
5th step, the file extent function of accessing specific file system instance;
When the Virtual File System of expanded function is supported in 6th step, unloading, All Files system in unloading Virtual File System The all files expanded function code of type, further deletes the whole " expanded function table " of All Files system type.
In " registration or the file extent function of nullifying specified file system type " described in the step of the inventive method the 4th, " note The file extent function of volume specified file system type " is the expanded function service module by Virtual File System service module In expanded function registration function realize registration;The parameter of expanded function registration function includes file system type example and text Part expanded function describes example;
4.1st step, the processing procedure of expanded function registration function are as follows:
4.1.1 is walked, is described example according to file system type example and file extent function, calls expanded function to search Function searches whether registered this document expanded function in this document system type example, sets the return value to be if registered " failure " identifies and performs 4.1.6 steps;
In expanded function function generation, is specified in 4.1.2 steps, " function name " loading for describing according to file extent function example Code is described into Virtual File System, and by the internal memory first address record of the expanded function function code in this document expanded function In example;
4.1.3 steps, find according to file system type example " expanded function corresponding to this document system type example Table ";
4.1.4 is walked, the file extent function in 4.1.2 steps is described to " the extension that example is added in 4.1.3 steps Menu ";
4.1.5 steps, setting return value are that " success " is identified;
4.1.6 steps, processing procedure terminate.
In " registration or the file extent function of nullifying specified file system type " described in the step of the inventive method the 4th, " note The file extent function of pin specified file system type " is the expanded function service module by Virtual File System service module In expanded function nullify function and realize cancellation;The parameter that expanded function nullifies function includes file system type example and text Part expanded function describes example;
The processing procedure that 4.2nd step, expanded function nullify function is as follows:
4.2.1 is walked, is described example according to file system type example and file extent function, calls expanded function to search Function searches whether registered this document expanded function in this document system type example, sets the return value to be if unregistered " failure " identifies and performs 4.2.7 steps;
4.2.2 steps, find according to file system type example " expanded function corresponding to this document system type example Table ";
" expanded function table " in 4.2.3 steps, traversal 4.2.2 steps, finds and file expanded function in 4.2.1 steps Expanded function numbering identical existing file expanded function describes the first address of example in description example;
4.2.4 is walked, is described example according to the existing file expanded function found in 4.2.3 steps, obtains corresponding " expand Open up function " function first address, the expanded function function code is unloaded in Virtual File System;
4.2.5 steps, the existing file found in " the expanded function table " that 4.2.2 is walked in deletion 4.2.3 steps expand Exhibition function describes example;
4.2.6 steps, setting return value are that " success " is identified;
4.2.7 steps, processing procedure terminate.
The method of " the file extent function of accessing specific file system instance " described in the step of the inventive method the 5th is " should With program " access the file expansion of specific file system instance by using strengthening existed system service or setting up new system service Function is opened up, the parameter of said system service includes file extent function numbering and file extent functional parameter structure pointer;Tool Body processing procedure is as follows:
5.1st step, according to file extent functional parameter structure, obtain the file describing word of pending file;
5.2nd step, the file describing word in the 5.1st step obtain corresponding file structure, and further basis should File structure obtains " superblock " structure example of corresponding specific " file system instance ";
5.3rd step, " superblock " structure example in the 5.2nd step, obtain corresponding file system type real Example;
5.4th step, the file system type example in the 5.3rd step and file extent function numbering, call extension work( Function can be searched to search whether registered this document expanded function in this document system type example, set and return if unregistered It is that " failure " identifies and perform the 5.6th step to return value;Otherwise record expanded function and search this document extension work(that function is returned Can function address;
5.5th step, according to file extent functional parameter structure and the function address of the 5.4th step this document expanded function, Call this document expanded function, and using the return value of this document expanded function as currently processed process return value;
5.6th step, processing procedure terminate.
Particular content involved in the present invention and the term are meant that:
(1) Virtual File System:In fact it is a set of abstract file service set, is masked by Virtual File System The difference of various specific file system instances, so as to provide unified file service for upper level applications;Virtual file system System has been widely used, but only provides file standard service at present;
(2) file system type:The file system of finger different designs agreement, such as fat32, ext2, ntfs, xfs, Ext4, iso9660 etc., the file service that different file system is set up on a storage device have a variety of advantage and disadvantage, Different file system is also applied to different occasions;
(3) file system instance:Refer to the instantiation of certain file system type;File system instance both includes this document The standard feature code of system file, the also various data structure examples including instantiation, wherein data structure example Including " superblock " structure example, index node inode structure body example, file structure example, directory entry dentry knots Structure body example, file system mounted point vfsmount structure examples etc.;If for example, one possesses two storage devices File system in computer, the two storage devices is all ntfs, then this computer is loaded and anticipated after the two storage devices Taste, which, possesses two file system instances, but both of these documents system example belongs to same file system type;
(4) file standard function:Refer to the file function service for meeting international standard, such as POSIX standard is provided to text The file process function such as the open of part, read, write, seek, close;
(5) file extent function:Refer to the service for being not belonging to file standard function, the MD5 values of such as calculation document, according to not Same business has various customized file extent functions;
(6) " superblock " of file system instance:Refer to relevant this document system in each specific file system instance real Super_block structures in the data structure of the various global datas of example, such as ext4;
(7) system service:Finger computer operating system is that User space " application program " provides the various clothes that kernel state is realized The interface mechanism of business, also referred to as system are called, to the encapsulation fetcher code typically quilt of system service under operating system User space Referred to as " system library routine " or " system library process ".
Advantages and positive effects of the present invention:
Effectively improve the processing speed of file data.The present invention will turn to the complex process of file data from application layer Completed to virtual file system, the complex process of file data is completed in virtual file system as far as possible, from And greatly reduce data volume and number of times that file data is delivered to application layer by virtual file system, effectively improve whole system To the processing speed of file data, especially in the application of I/O intensive type and based on NFS application scenarios.
For I/O intensive type application, in fact application program finally simply needs acquisition one to the SHA1 values of such as calculation document Individual SHA1 character strings;But existing program be limited to file system only provide standards service therefore file data can only be read should With carrying out data processing under the User space of program;And the present invention can dynamically support the virtual file system of expanded function by introducing System, will be put into virtual file system, such number of files to the process of the frequent reprocessing of file data as expanded function Reprocessed according to being not necessarily to be delivered under the User space of application program, therefore save the behaviour such as substantial amounts of file data internal memory duplication Make, therefore the processing speed that file data will be effectively improved.
The present invention for based on NFS application scenarios it is more efficient improve file data processing speed because File data need not be transmitted in a network, and file extent work(only need to be can be carried out in the calculate node where file data Can processing.
Brief description of the drawings
Fig. 1 is the Virtual File System installation drawing of extendable functions.
Fig. 2 is the structure statement schematic diagram of the structure of expanded function description in the present invention, expanded function type function.
Fig. 3 is the program code schematic diagram of the structure of expanded function description in the present invention.
Fig. 4 is Virtual File System service module offer " expanded function method of servicing " primary function statement in the present invention Schematic diagram.
Fig. 5 is Virtual File System service module and the key data structure body of file system instance module pass in the present invention It is schematic diagram.
Fig. 6 is the NFS client terminal device and network file system applied based on NFS in the present invention System server unit Organization Chart.
Fig. 7 is that Virtual File System expanded function is called in the encapsulation of system library routine under operating system User space in the present invention Code schematic diagram.
Fig. 8 is that application program passes through the code of system library routine call Virtual File System expanded function and illustrated in the present invention Figure.
Fig. 9 is that the generation of Virtual File System expanded function is called in system service encapsulation under operating system kernel state in the present invention Code schematic diagram.
Figure 10 is that Virtual File System expanded function file_sha1 examples implement code schematic diagram in the present invention.
Embodiment
Embodiment 1, the Virtual File System device for supporting expanded function
The Virtual File System device for the support expanded function that the present invention is provided, as shown in figure 1, the system and device is included such as Under:Virtual File System service module 200, file system instance module 300, expanded function table module 330 and expanded function mould Block 340;Virtual File System service module 200 is mutual with file system instance module 300 and expanded function table module 330 respectively Connection, expanded function table module 330 is unidirectionally connected with extended function module 340, and expanded function table module 330 passes through virtual file System service module 200 refers indirectly to file system instance module 300, or, expanded function table module 330 can also increase by one Pointer is so as to be pointing directly at file system instance module 300;
Wherein, described Virtual File System service module 200 includes:File system type instance management module 210, mark Quasi- function services module 220, and expanded function service module 230;Described file system type instance management module 210 is used In the management to " file system type example table ", include the registration and cancellation of " file system type " example;As shown in figure 5, " file system type " file_system_type structures include file system type title, point to and be somebody's turn to do " filesystem class The pointer fs_exop of type " corresponding " expanded function table " and sensing belong to specific " the file system of " file system type " The pointer fs_supers of " superblock " of system example ";
In Virtual File System service module 200, standard feature service module 220 is used for the clothes for providing file standard function Business, standard feature service module 220 is by registered " file system type " example and belongs to " file system type " example " file system instance " is interrelated;
In Virtual File System service module 200, expanded function service module 230 is used to provide customized file extent The service of function, expanded function service module 230 is by registered " file system type " example and registered " expanded function Table " is interrelated;As shown in figure 5, " expanded function table " is one group of " expanded function description " structure fs_extendop example Set;As shown in Fig. 2 " expanded function description " structure fs_extendop includes file system type fstype, expanded function Numbering id, expanded function type type, expanded function title name, expanded function Name Length namelen and expanded function letter Number address fs_exopfunc;As shown in figure 9, the expanded function numbering that file SHA1 is calculated is 1001;
File system instance module 300 includes data structure example 310 and standard feature module 320, " data structure Example " 310 records the runtime data of this document system example, and standard feature module 320 is then based on " data structure example " 310 data come provide this document system example file standard function perform code realization;As shown in figure 5, main " number According to structure example " 310 to include " superblock " structure example, index node inode structure body example, file structure real Example, directory entry dentry structures example, file system mounted point vfsmount structure examples etc.;
Expanded function table the module 330, " expanded function for providing file extent function for specific file system instance The management of table ";
Expanded function service module 340, code is performed for providing file extent function for specific file system instance Realization;As shown in Fig. 2 the function interface statement of expanded function type function includes pointer to object obj, object size obj_ Len, parameter pointer arg, parameter size arg_len, the argument structure body pointed by parameter pointer arg according to expanded function not There can be different argument structure body types together, as shown in figure 9, the argument structure body of calculation document SHA1 expanded function is FSEXOP_FILE_SHA1_ARG。
In Virtual File System service module 200, expanded function service module 230 provides " expanded function service side Method ", " expanded function method of servicing " including expanded function enumerate function, expanded function search function, expanded function registration function, Expanded function nullifies function, as shown in figure 4, the function parameter of above-mentioned " expanded function method of servicing " mainly includes filesystem class Type example fs, the structure example fsexop of expanded function description;" application program " can by using enhancing existed system service, New system service, various interprocess commications protocols and network communication protocol is set up to access the expanded function of Virtual File System Method of servicing, such as pipeline mechanism, Socket networks, remote procedure call, the Restful agreements based on HTTP;As schemed " application program " owns by providing Virtual File System after being packaged to existed system service ioctl in example shown in 7 The unified call function of expanded function, as shown in figure 8, " application program " directly invokes void without oneself realizing SHA1 functions Intend the SHA1 expanded functions in file system to realize the SHA1 calculating to file.
Embodiment 2, the method for supporting Virtual File System expanded function
The method concrete processing procedure provided by the present invention for supporting Virtual File System expanded function is as follows:
When the Virtual File System of expanded function is supported in 1st step, loading, set up and initialize " file system type example Table ", " file system type example table " fs_system_type as shown in Figure 5;
When the 2nd step, the specific file system instance of loading, if " file system type example table " does not include the specific file system " file system type " example united corresponding to example, then set up " file system type " example and be added to " filesystem class Type example table ";And " the expanded function table " being somebody's turn to do associated by " file system type " example is further set up, and to the " extension Menu " is initialized, and adds empty " expanded function description " structure example;Further by the specific file system The associated pointers of " file system type " example corresponding to example are pointed to should " expanded function table ", fs_ as shown in Figure 5 extendop;
3rd step, the expanded function method of servicing for accessing Virtual File System, as shown in Figure 4;
4th step, registration or the file extent function of nullifying specified file system type;
4.1st step, Virtual File System provided by the present invention support the file extent of registration specified file system type The method of function is the expanded function registration function in the expanded function service module by Virtual File System service module come Realize registration;The parameter of expanded function registration function includes file system type example and file extent function describes example, has Body processing procedure is as follows:
4.1.1 is walked, is described example according to file system type example and file extent function, calls expanded function to search Function searches whether registered this document expanded function in this document system type example, sets the return value to be if registered " failure " identifies and performs 4.1.6 steps;
As shown in figure 5, file system type example file_system_type points to file extent menu fs_ Extendop, file extent menu fs_extendop are expanded the All Files of this document system type example with chain sheet form Exhibition function description scheme body example is chained up, and expanded function searches function and travels through this document system class successively according to above-mentioned connection Whether the file extent function numbering of the All Files expanded function description scheme body example of type example is the file to be searched Expanded function is numbered;
In expanded function function generation, is specified in 4.1.2 steps, " function name " loading for describing according to file extent function example Code is described into Virtual File System, and by the internal memory first address record of the expanded function function code in this document expanded function In example;
Current main-stream operating system supports the dlopen in dynamic load function code, such as linux;
4.1.3 steps, find according to file system type example " expanded function corresponding to this document system type example Table ";
Fs_exop in file system type example file_system_type as shown in Figure 5 has pointed to " expanded function Table " fs_extendop;
4.1.4 is walked, the file extent function in 4.1.2 steps is described to " the extension that example is added in 4.1.3 steps Menu ";
As shown in figure 5, " expanded function table " fs_extendop is chained list;
4.1.5 steps, setting return value are that " success " is identified;
4.1.6 steps, processing procedure terminate.
4.2nd step, Virtual File System provided by the present invention are supported to nullify the file extent of specified file system type The method of function, be expanded function in the expanded function service module by Virtual File System service module nullify function come Realize and nullify;The parameter that expanded function nullifies function describes example including file system type example and file extent function, has Body processing procedure is as follows:
4.2.1 is walked, is described example according to file system type example and file extent function, calls expanded function to search Function searches whether registered this document expanded function in this document system type example, sets the return value to be if unregistered " failure " identifies and performs 4.2.7 steps;
4.2.2 steps, find according to file system type example " expanded function corresponding to this document system type example Table ";
" expanded function table " in 4.2.3 steps, traversal 4.2.2 steps, finds and file expanded function in 4.2.1 steps Expanded function numbering identical existing file expanded function describes the first address of example in description example;
As shown in figure 5, " expanded function table " fs_extendop is chained list;
4.2.4 is walked, is described example according to the existing file expanded function found in 4.2.3 steps, obtains corresponding " expand Open up function " function first address, the expanded function function code is unloaded in Virtual File System;
As shown in figure 5, the fs_exopf that file extent function describes example is " expanded function " function first address;It is current main Stream operating system supports the dlclose in dynamic offloading function code, such as linux;
4.2.5 steps, the existing file found in " the expanded function table " that 4.2.2 is walked in deletion 4.2.3 steps expand Exhibition function describes example;
4.2.6 steps, setting return value are that " success " is identified;
4.2.7 steps, processing procedure terminate.
5th step, the file extent function of accessing specific file system instance;
When the Virtual File System of expanded function is supported in 6th step, unloading, All Files system in unloading Virtual File System The all files expanded function code of type, further deletes the whole " expanded function table " of All Files system type.
5th step, the file extent function of accessing specific file system instance;
Virtual File System provided by the present invention is supported to access the side of the file extent function of specific file system instance Method, be " application program " can by using enhancing existed system service, set up new system service, various interprocess commications protocols with And network communication protocol accesses the file extent function of specific file system instance, as shown in Figure 7 to existed system service Ioctl provides the unified call function of all expanded functions of Virtual File System, the ginseng of said system service after being packaged Number includes file extent function numbering and file extent functional parameter structure pointer, and concrete processing procedure is as follows:
5.1st step, according to file extent functional parameter structure, obtain the file describing word of pending file;
5.2nd step, the file describing word in the 5.1st step obtain corresponding file structure, and further basis should File structure obtains " superblock " structure example of corresponding specific " file system instance ";As shown in figure 5, file knot File_inode in structure body file points to the i_ in inode structures body inode, further inode structures body inode Sb points to " superblock " structure super_block;
5.3rd step, " superblock " structure example in the 5.2nd step, obtain corresponding file system type real Example;As shown in figure 5, the s_type in " superblock " structure super_block points to file system type example file_ system_type;
5.4th step, the file system type example in the 5.3rd step and file extent function numbering, call extension work( Function can be searched to search whether registered this document expanded function in this document system type example, set and return if unregistered It is that " failure " identifies and perform the 5.6th step to return value;Otherwise record expanded function and search this document extension work(that function is returned Can function address;
As shown in figure 5, file system type example file_system_type points to file extent menu fs_ Extendop, file extent menu fs_extendop are expanded the All Files of this document system type example with chain sheet form Exhibition function description scheme body example is chained up, and expanded function searches function and travels through this document system class successively according to above-mentioned connection Whether the file extent function numbering of the All Files expanded function description scheme body example of type example is the file to be searched Expanded function is numbered;
5.5th step, according to file extent functional parameter structure and the function address of the 5.4th step this document expanded function, Call this document expanded function, and using the return value of this document expanded function as currently processed process return value;
As shown in figure 5, the fs_exopf in file extent function description scheme body example has pointed to file extent function Function code first address;
5.6th step, processing procedure terminate.
When the Virtual File System of expanded function is supported in 6th step, unloading, All Files system in unloading Virtual File System The all files expanded function code of type, further deletes the whole " expanded function table " of All Files system type.
For technology contents, feature and effect of the present invention can be further appreciated that, following application example is hereby enumerated, and coordinate attached Figure describes in detail as follows:
Application example 1
As shown in fig. 6, whole system is the scene applied based on NFS, " NFS customer set up " On " application program " file on " network file system server device " is accessed by local " Virtual File System " System, common scheme is to set up NFS NFS service agreements, i.e. text on " network file system server device " Part system by NFS service agreements carry in " Virtual File System " of " NFS customer set up ", now " network " application program " on file system customer set up " accesses the NFS as accessed local file system Ext4 mono- Sample.
As shown in Fig. 7,8,9,10, application example 1 is " application program " on " NFS customer set up " to remote The digital digest that file in file system on " the network file system server device " of journey carries out SHA1 algorithms is calculated, SHA1 calculating is not the standards service that file system is provided.
For application example 1, existing scheme is that " application program " passes through this on " NFS customer set up " " Virtual File System " and NFS service agreements on ground are by the text in the file system on " network file system server device " Number of packages is transferred to " NFS customer set up " according to overall network, and further by " NFS customer set up " Kernel state copies to User space, and then " application program " calculates the SHA1 values of this document again, can so produce for certain file Operated on substantial amounts of network data transmission and " NFS customer set up " by the duplication of kernel state to User space.
The scheme that the present invention is provided, by the Virtual File System device for setting up extendable functions so that virtual file system System can support expanded function, so that will carry out SHA1 calculating to file is changed into the expanded function of Virtual File System, so exist " Virtual File System " of " NFS customer set up " and " network file system server device " two devices is all built Vertical SHA1 expanded functions, and the remote procedure call realized by the existing service agreements of NFS NFS, so that Realize " the SHA1 expansions of " SHA1 expanded functions " to " network file system server device " of " NFS customer set up " Exhibition function " call;In fact on " network file system server device " User space " NFS service routine NFS_S " is also a kind of " Virtual File System " for extendable functions, should " Virtual File System " by procotol rather than The system service of operating system externally provides file service, realizes and is somebody's turn to do " Virtual File System " according to the inventive method " expanded function service ", and " NFS customer set up " " SHA1 expanded functions " to " NFS service " the SHA1 expanded functions " of device device " is called;So without carry out for certain file substantial amounts of network data transmission and Operated on " NFS customer set up " by the duplication of kernel state to User space, directly in " network file system server SHA1 expanded function calculating is carried out on " Virtual File System " on device ", and SHA1 values are passed to " NFS visitor " application program " on family device ", and SHA1 values are seldom byte stream in itself, far smaller than file data are in itself.
, also can be on " network file system server device " according to the 2nd kind of scheme of the present invention for application example 1 User space " NFS service routine NFS_S " SHA1 expanded functions, rather than in " network file system server Registration SHA1 expanded functions in " Virtual File System " on device ", such file data is needed from " network file system server Kernel state, also can be effective but also without the substantial amounts of network data transmission for certain file to the duplication of User space on device " Improve the efficiency that file calculates SHA1.
All expanded functions that ioctl be packaged after provide Virtual File System are serviced existed system as shown in Figure 7 Unified call function int syscall_fsexop (int fsexop_type, void*arg), existing system service Ioctl does not support the expanded function of Virtual File System to call, but system service ioctl interfaces are very general, the of ioctl 2 parameters represent operational order numbering, therefore in the case where not changing system service ioctl interfaces, support to virtual file System expanded function calls FSEXOP, FSEXOP_FILE_SHA1 in carry out Unified number, such as Fig. 7 to number, and in ioctl Kernel state under realize and support new operational order to number in function, realize function under ioctl as shown in Figure 9 kernel state For SYSCALL_DEFINE3 (ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg), Only it need to disposably increase the code to cmd parameter New functions, case FSEXOP code snippets as shown in Figure 9;
Virtual File System provided by the present invention is supported to access the SHA1 file extent functions of specific file system instance Method, all expanded functions that Virtual File System is provided after ioctl is packaged are serviced existed system as shown in Figure 7 Unified call function, function parameter includes file extent function numbering and file extent functional parameter structure pointer, specific place Reason process is as follows:
1st step, according to file extent functional parameter structure, obtain the file describing word of pending file;
Code file=fget_light (fd, &fput_needed) as shown in Figure 9;
2nd step, the file describing word in the 1st step obtain corresponding file structure, further according to this article Part structure obtains " superblock " structure of corresponding specific " file system instance ";
Code fs=file- as shown in Figure 9>file_inode->i_sb->s_type;
3rd step, " superblock " structure in second step, obtain corresponding file system type example;
Code fsexopf=find_fsexops (fs, FSEXOP_ID, mArg- as shown in Figure 9>fsexop_type, sizeof(int));
4th step, the file system type example in third step and file extent function numbering, call expanded function Search function to search whether registered this document expanded function in this document system type example, set and return if unregistered It is worth and the 6th step is identified and performed for " failure ";Otherwise record expanded function and search this document expanded function that function is returned Function address;
5th step, according to file extent functional parameter structure and the function address of the 4th step this document expanded function, adjust Use this document expanded function, and using the return value of this document expanded function as currently processed process return value;
Code (* fsexopf) (file, sizeof (struct file*), mArg- as shown in Figure 9>digest, mArg->digestlen);
6th step, processing procedure terminate.
Virtual File System provided by the present invention is supported to access the side of the file extent function of specific file system instance Method is the method for providing expanded function framework, only need to once be write, and supports calling for any file extent function;On the other hand, Because different file extent functions realize different functions, therefore each file extent function must be developed and implement generation Code, what such as Figure 10 gave the SHA1 expanded functions run in Virtual File System implements code int fsexop_ File_sha1 (const struct file*filep, void*op, int oplen), specific file is not inquired into and is expanded in detail herein Open up implementing for function.
In view of the description of this invention disclosed herein and the embodiment of special case, other embodiment of the invention is for this It is aobvious for the technical staff in field and opinion.These explanations and embodiment only consider as an example, all the present invention's Within spirit and principle, any modification, equivalent substitution and improvements made etc. should be included in the scope of the protection.

Claims (7)

1. a kind of Virtual File System device for supporting expanded function, it is characterised in that the system and device includes:Virtual file System service module, file system instance module, expanded function table module and extended function module;Virtual File System services mould Block is connected with each other with file system instance module and expanded function table module respectively, expanded function table module and extended function module Unidirectional connection, expanded function table module by or do not pass through Virtual File System service module and point to file system instance module;
Wherein, described Virtual File System service module includes:File system type instance management module, standard feature service Module, and expanded function service module;Described file system type instance management module is used for " file system type is real The management of example table ", includes the registration and cancellation of " file system type " example;Standard feature service module is used to provide files-designated The service of quasi- function, standard feature service module is by registered " file system type " example and belongs to " file system type " " file system instance " of example is interrelated;Expanded function service module is used for the clothes for providing customized file extent function Business, expanded function service module is interrelated by registered " file system type " example and registered " expanded function table ";
File system instance module includes data structure example and standard feature module, " data structure example " record this article The runtime data of part system example, standard feature module then provides this document system based on the data of " data structure example " The file standard function of system example performs the realization of code;
Expanded function table module, the pipe of " expanded function table " for providing file extent function for specific file system instance Reason;
Expanded function service module, for providing the realization that file extent function performs code for specific file system instance.
2. system and device according to claim 1, it is characterised in that described " expanded function table " is one group of " extension work( The set of energy description " structure example, wherein " expanded function description " structure is compiled comprising file system type, expanded function Number, expanded function type, expanded function title, expanded function Name Length and expanded function function address;" file system type Example table " is the set of one group of " file system type " structure example, wherein " file system type " structure contains text Part system type title, sensing are somebody's turn to do the pointer of " file system type " corresponding " expanded function table " and sensing belongs to the " text The pointer of " superblock " of specific " file system instance " of part system type ".
3. system and device according to claim 1, it is characterised in that the extension of described Virtual File System service module Function services module provide " expanded function method of servicing ", " expanded function method of servicing " including expanded function enumerate function, Expanded function searches function, expanded function registration function and expanded function and nullifies function;" application program " can be by using enhancing Existed system service, set up new system service, various interprocess commications protocols and network communication protocol to access virtual file The expanded function method of servicing of system.
4. a kind of method for supporting Virtual File System expanded function, it is characterised in that methods described includes following processing procedure:
When the Virtual File System of expanded function is supported in 1st step, loading, set up and initialize " file system type example table ";
When the 2nd step, the specific file system instance of loading, if " file system type example table " does not include specific file system reality " file system type " example corresponding to example, then set up " file system type " example and be added to " file system type reality Example table ";And " the expanded function table " being somebody's turn to do associated by " file system type " example is further set up, and to the " expanded function Table " is initialized, and adds empty " expanded function description " structure example;Further by the specific file system instance The associated pointers of corresponding " file system type " example, which are pointed to, is somebody's turn to do " expanded function table ";
3rd step, the expanded function method of servicing for accessing Virtual File System;
4th step, registration or the file extent function of nullifying specified file system type;
5th step, the file extent function of accessing specific file system instance;
When the Virtual File System of expanded function is supported in 6th step, unloading, All Files system type in unloading Virtual File System All files expanded function code, further delete All Files system type whole " expanded function table ".
5. method according to claim 4, it is characterised in that " registration or cancellation specified file system class described in the 4th step In the file extent function of type ", " the file extent function of registration specified file system type " is taken by Virtual File System Expanded function registration function in the expanded function service module for module of being engaged in realizes registration;The parameter of expanded function registration function Example is described including file system type example and file extent function;
4.1st step, the processing procedure of expanded function registration function are as follows:
4.1.1 is walked, is described example according to file system type example and file extent function, calls expanded function to search function To search whether registered this document expanded function in this document system type example, return value is set if registered " to lose Lose " identify and perform 4.1.6 steps;
4.1.2 steps, " function name " for describing according to file extent function example loads specified expanded function function code and arrived In Virtual File System, and example is described into this document expanded function for the internal memory first address record of the expanded function function code In;
4.1.3 steps, find according to file system type example " expanded function table " corresponding to this document system type example;
4.1.4 is walked, the file extent function in 4.1.2 steps is described to " the expanded function that example is added in 4.1.3 steps Table ";
4.1.5 steps, setting return value are that " success " is identified;
4.1.6 steps, processing procedure terminate.
6. method according to claim 4, it is characterised in that " registration or cancellation specified file system class described in the 4th step In the file extent function of type ", " the file extent function of nullifying specified file system type " is taken by Virtual File System Expanded function in the expanded function service module for module of being engaged in nullifies function to realize cancellation;Expanded function nullifies the parameter of function Example is described including file system type example and file extent function;
The processing procedure that 4.2nd step, expanded function nullify function is as follows:
4.2.1 is walked, is described example according to file system type example and file extent function, calls expanded function to search function To search whether registered this document expanded function in this document system type example, return value is set if unregistered " to lose Lose " identify and perform 4.2.7 steps;
4.2.2 steps, find according to file system type example " expanded function table " corresponding to this document system type example;
" expanded function table " in 4.2.3 steps, traversal 4.2.2 steps, finds and is described with file expanded function in 4.2.1 steps Expanded function numbering identical existing file expanded function describes the first address of example in example;
4.2.4 is walked, is described example according to the existing file expanded function found in 4.2.3 steps, obtains corresponding " extension work( Can " function first address, the expanded function function code is unloaded in Virtual File System;
4.2.5 steps, the existing file found in " the expanded function table " that 4.2.2 is walked in deletion 4.2.3 steps extend work( Example can be described;
4.2.6 steps, setting return value are that " success " is identified;
4.2.7 steps, processing procedure terminate.
7. method according to claim 4, it is characterised in that " access the text of specific file system instance described in the 5th step The method of part expanded function " is that " application program " by using enhancing existed system service or can set up new system service and access The file extent function of specific file system instance, the parameter of said system service includes file extent function numbering and file expands Open up functional parameter structure pointer;Concrete processing procedure is as follows:
5.1st step, according to file extent functional parameter structure, obtain the file describing word of pending file;
5.2nd step, the file describing word in the 5.1st step obtain corresponding file structure, further according to this document Structure obtains " superblock " structure example of corresponding specific " file system instance ";
5.3rd step, " superblock " structure example in the 5.2nd step, obtain corresponding file system type example;
5.4th step, the file system type example in the 5.3rd step and file extent function numbering, call expanded function to look into Look for function to search whether registered this document expanded function in this document system type example, return value is set if unregistered Identified for " failure " and perform the 5.6th step;Otherwise record expanded function and search this document expanded function letter that function is returned Number address;
5.5th step, according to file extent functional parameter structure and the function address of the 5.4th step this document expanded function, call This document expanded function, and using the return value of this document expanded function as currently processed process return value;
5.6th step, processing procedure terminate.
CN201510034043.6A 2015-01-23 2015-01-23 A kind of Virtual File System apparatus and method for supporting expanded function Active CN104573061B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510034043.6A CN104573061B (en) 2015-01-23 2015-01-23 A kind of Virtual File System apparatus and method for supporting expanded function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510034043.6A CN104573061B (en) 2015-01-23 2015-01-23 A kind of Virtual File System apparatus and method for supporting expanded function

Publications (2)

Publication Number Publication Date
CN104573061A CN104573061A (en) 2015-04-29
CN104573061B true CN104573061B (en) 2017-09-26

Family

ID=53089123

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510034043.6A Active CN104573061B (en) 2015-01-23 2015-01-23 A kind of Virtual File System apparatus and method for supporting expanded function

Country Status (1)

Country Link
CN (1) CN104573061B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107894886B (en) * 2017-11-23 2019-02-19 北京九章云极科技有限公司 A kind of method, apparatus and terminal device running code
CN114201237A (en) * 2021-12-14 2022-03-18 北京欧珀通信有限公司 Application program running method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1553325A (en) * 2003-06-05 2004-12-08 联想(北京)有限公司 Method for transparent extending document system function
CN1841317A (en) * 2005-03-31 2006-10-04 株式会社日立制作所 File system and method for constructing and enhancing file system function
EP1715686A1 (en) * 2004-09-10 2006-10-25 Matsushita Electric Industrial Co., Ltd. Recording medium, reproduction device, program and reproduction method
CN102722500A (en) * 2011-03-31 2012-10-10 中国电信股份有限公司 Virtual file system and implementation method thereof
CN102741814A (en) * 2010-02-04 2012-10-17 微软公司 Extensible application virtualization subsystems

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1553325A (en) * 2003-06-05 2004-12-08 联想(北京)有限公司 Method for transparent extending document system function
EP1715686A1 (en) * 2004-09-10 2006-10-25 Matsushita Electric Industrial Co., Ltd. Recording medium, reproduction device, program and reproduction method
CN1841317A (en) * 2005-03-31 2006-10-04 株式会社日立制作所 File system and method for constructing and enhancing file system function
CN102741814A (en) * 2010-02-04 2012-10-17 微软公司 Extensible application virtualization subsystems
CN102722500A (en) * 2011-03-31 2012-10-10 中国电信股份有限公司 Virtual file system and implementation method thereof

Also Published As

Publication number Publication date
CN104573061A (en) 2015-04-29

Similar Documents

Publication Publication Date Title
US10013185B2 (en) Mapping systems and methods of an accelerated application-oriented middleware layer
US6134559A (en) Uniform object model having methods and additional features for integrating objects defined by different foreign object type systems into a single type system
JP4583377B2 (en) System and method for realizing relational and hierarchical synchronization services for units of information manageable by a hardware / software interface system
RU2417419C2 (en) Intelligent container indexing and performing search therein
JP4394643B2 (en) System and method for data modeling in an item-based storage platform
JP4653106B2 (en) Type path indexing
US10430378B1 (en) Fast container distribution with storage acceleration
US20070043747A1 (en) Storage reports file system scanner
CN103443789B (en) Backward-compatible aggregation file system operation performance improvement method and related device
JP2014044743A (en) Programming interface for computer platform
KR20060097577A (en) System data interfaces, related architectures, print system data interfaces and related print system architectures
JP2007521533A (en) System and method for interfacing application programs with item-based storage platforms
JP2011034589A (en) System and method for storing and obtaining field of user defined type outside of database store in which type is defined
JP2006018821A (en) System and method for providing conflict handling for peer-to-peer synchronization of units of information manageable by hardware/software interface system
JPH06231022A (en) Apparatus and system for utilization of one part of name space used in computer system as one part of another name space
US20210397583A1 (en) Namespace representation and enhanced browsability for replicated file systems
CN102014154A (en) Grid service-based remote sensing image extraction and sharing system and method
CN107851060A (en) Unload the probability calculation in data analysis application
US11886411B2 (en) Data storage using roaring binary-tree format
JP2002108671A (en) Method and system for providing customized information in computer processing system
Skluzacek et al. A serverless framework for distributed bulk metadata extraction
CN104573061B (en) A kind of Virtual File System apparatus and method for supporting expanded function
US7167872B2 (en) Efficient file interface and method for providing access to files using a JTRS SCA core framework
KR101109399B1 (en) Systems and methods for the implementation of a synchronization schemas for units of information manageable by a hardware/software interface system
CN114756509A (en) Operation method, system, device and storage medium of file system

Legal Events

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