CN104573061A - Virtual file system device and method supporting expanding function - Google Patents

Virtual file system device and method supporting expanding function Download PDF

Info

Publication number
CN104573061A
CN104573061A CN201510034043.6A CN201510034043A CN104573061A CN 104573061 A CN104573061 A CN 104573061A CN 201510034043 A CN201510034043 A CN 201510034043A CN 104573061 A CN104573061 A CN 104573061A
Authority
CN
China
Prior art keywords
file system
function
file
expanded function
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.)
Granted
Application number
CN201510034043.6A
Other languages
Chinese (zh)
Other versions
CN104573061B (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 virtual file system device and method supporting the expanding function, and belongs to the field of computers. The virtual file system device supports the dynamic expansion function operation for a file system. The virtual file system device supporting the expanding function comprises a virtual file system service module, a file system example module, an expanding function table module and an expanding function module. The method supporting the virtual file system expanding function includes the steps of establishing a file system type example table at the initial time, establishing file system type examples while loading the file system, registering the file expanding function of assigned file system types, and having access to the file expanding function of the file system examples. The file data processing process is transferred to be completed on a virtual file system layer from an application layer, and therefore the transfer of file data between the two layers is reduced, the processing speed of the file data is effectively increased, and the device and the method are particularly suitable for IO intensive application and application scenes based on network file systems.

Description

A kind of Virtual File System apparatus and method supporting expanded function
Technical field
The invention belongs to computer realm, the main processing speed paying close attention to raising file data in file system.
Background technology
The processing speed of current raising file data mainly contains two class means, and a class improves the processing power of computer hardware CPU; An other class is the cache mechanism by application layer.The common shortcoming of above-mentioned two class means be pending file data must be delivered to application layer software on process, such file data needs to read in operating system nucleus by storage medium, and then be delivered to operating system User space, even need by network delivery in the User space of the computer node of file manipulation software, data copy a large amount of so very expends computational resource, and the processing speed of file data is difficult to huge raising.
Summary of the invention
The present invention seeks to the processing speed in order to effectively improve file data in file system.Provide a kind of Virtual File System device and method adopting support expanded function.
Technical scheme of the present invention
Support a Virtual File System device for expanded function, described device comprises: Virtual File System service module, file system instance module, expanded function table module and extended function module; Virtual File System service module is interconnected with file system instance module and expanded function table module respectively, expanded function table module is connected with extended function module is unidirectional, and expanded function table module is passed through or do not pointed to file system instance module by Virtual File System service module;
Wherein, described Virtual File System service module comprises: 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 the management to " file system type example table ", comprises registration and the cancellation of " file system type " example; Standard feature service module is for providing the service of file standard function, and standard feature service module is interrelated with " file system instance " belonging to this " file system type " example by registered " file system type " example; Expanded function service module for providing the service of self-defining file extent function, expanded function service module by registered " file system type " example and registered " expanded function table " interrelated;
File system instance module comprises data structure body example and standard feature module, " data structure body example " records the runtime data of this file system instance, and standard feature module then provides the realization of the file standard function run time version of this file system instance based on the data of " data structure body example ";
Expanded function table module, for providing the management of " the expanded function table " of file extent function for concrete file system instance;
Expanded function service module, for providing the realization of file extent function run time version for concrete file system instance.
Described " expanded function table " is the set of one group of " expanded function description " structure example, wherein " expanded function description " structure include file system type, expanded function numbering, 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, and the pointer that wherein " file system type " structure contains file system type title, " file system type " corresponding " expanded function table " is somebody's turn to do in sensing and sensing belong to the pointer of " superblock " of concrete " file system instance " of this " file system type ".
The expanded function service module of described Virtual File System service module provides " expanded function method of servicing ", and " expanded function method of servicing " comprises that expanded function enumerates function, expanded function searches function, expanded function registration function and expanded function nullify function; " application program " strengthening existed system service by adopting, setting up the expanded function method of servicing that new system service, various interprocess commications protocol and network communication protocol visit Virtual File System.
Invention also provides the method for the support Virtual File System expanded function based on said system device, described method comprises following processing procedure:
1st step, load when supporting the Virtual File System of expanded function, set up and initialization " file system type example table ";
2nd step, when loading concrete file system instance, if " file system type example table " does not comprise " file system type " example corresponding to this concrete file system instance, then set up " file system type " example and add to " file system type example table "; And setting up further should " expanded function table " associated by " file system type " example, and carries out initialization to this " expanded function table ", add empty " expanded function description " structure example; Further the associated pointers of " file system type " example corresponding to this concrete file system instance is pointed to and be somebody's turn to do " expanded function table ";
The expanded function method of servicing of the 3rd step, accesses virtual file system;
4th step, registration or nullify the file extent function of specified file system type;
5th step, access the file extent function of concrete file system instance;
When 6th step, unloading support the Virtual File System of expanded function, in unloading Virtual File System, all files expanded function code of All Files system type, deletes whole " the expanded function tables " of All Files system type further.
In " the file extent function of registration or cancellation specified file system type " described in the inventive method the 4th step, " the file extent function of registration specified file system type " realizes registration by the expanded function registration function in the expanded function service module of Virtual File System service module; The parameter of expanded function registration function comprises file system type example and file extent functional description example;
The processing procedure of the 4.1st step, expanded function registration function is as follows:
4.1.1 walks, according to file system type example and file extent functional description example, invoke extensions function lookup function searches whether this file expanded function registered in this file system type example, if registered, arrange rreturn value and walks for " failure " identifies and perform 4.1.6;
4.1.2 step, to load according to " function name " of file extent functional description example and specify expanded function function code in Virtual File System, and the internal memory first address of this expanded function function code is recorded in this file expanded function describes in example;
4.1.3 walks, finds " the expanded function table " corresponding to this file system type example according to file system type example;
4.1.4 walks, add the file extent functional description example in 4.1.2 step to " expanded function table " in 4.1.3 step;
4.1.5 walks, arrange rreturn value for " success " mark;
4.1.6 step, processing procedure terminate.
In " the file extent function of registration or cancellation specified file system type " described in the inventive method the 4th step, " nullifying the file extent function of specified file system type " nullifies function by the expanded function in the expanded function service module of Virtual File System service module to realize nullifying; The parameter that expanded function nullifies function comprises file system type example and file extent functional description example;
The processing procedure that 4.2nd step, expanded function nullify function is as follows:
4.2.1 walks, according to file system type example and file extent functional description example, invoke extensions function lookup function searches whether this file expanded function registered in this file system type example, if unregistered, arrange rreturn value and walks for " failure " identifies and perform 4.2.7;
4.2.2 walks, finds " the expanded function table " corresponding to this file system type example according to file system type example;
4.2.3 step, " the expanded function table " traveled through in 4.2.2 step, find and to walk file expanded function with 4.2.1 and describe expanded function in example and number the first address that identical existing file expanded function describes example;
4.2.4 walks, describe example according to the existing file expanded function found in 4.2.3 step, obtains corresponding " expanded function " function first address, unloads this expanded function function code in Virtual File System;
4.2.5 step, the existing file expanded function found in deletion 4.2.3 step in " the expanded function table " of 4.2.2 step describe example;
4.2.6 walks, arrange rreturn value for " success " mark;
4.2.7 step, processing procedure terminate.
The method of " accessing the file extent function of concrete file system instance " described in the inventive method the 5th step is that " application program " strengthens existed system service by adopting or set up the file extent function that new system service visits concrete file system instance, and the parameter of said system service comprises file extent function numbering and file extent 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, to obtain according to the file describing word in the 5.1st step corresponding to file structure, " superblock " structure example of concrete " file system instance " corresponding to obtaining according to this file structure further;
5.3rd step, according to " superblock " structure example in the 5.2nd step, the file system type example corresponding to acquisition;
5.4th step, according to the file system type example in the 5.3rd step and file extent function numbering, invoke extensions function lookup function searches whether this file expanded function registered in this file system type example, if unregistered, arrange rreturn value and identifies for " failure " and perform the 5.6th step; Otherwise record expanded function and search this file expanded function function address that function returns;
5.5th step, function address according to file extent functional parameter structure and the 5.4th this file expanded function of step, call this file expanded function, and using the rreturn value of this file expanded function as the rreturn value when pretreatment process;
5.6th step, processing procedure terminate.
The implication of particular content involved in the present invention and described term is:
(1) Virtual File System: be in fact a set of abstract file service set, masked the difference of various concrete file system instance by Virtual File System, thus provide unified file service for upper level applications; Virtual File System is widely used, but only provides file standard service at present;
(2) file system type: the file system referring to 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 has various different relative merits, and different file system is also applied to different occasions;
(3) file system instance: the instantiation referring to certain file system type; File system instance had both comprised the standard feature code of this file system files, also comprise the various data structure body examples of instantiation, wherein data structure body example comprises " superblock " structure example, index node inode structure example, file structure example, directory entry dentry structure example, file system mounted some vfsmount structure example etc.; Illustrate, if a computing machine having two memory devices, file system on these two memory devices is all ntfs, then this computing machine means after loading these two memory devices and has two file system instance, but these two file system instance belong to same file system type;
(4) file standard function: refer to the file function service meeting international standard, such as POSIX standard provides the open to file, the file processing functions such as read, write, seek, close;
(5) file extent function: refer to the service not belonging to file standard function, the MD5 value of such as calculation document, has various self-defining file extent function according to different business;
(6) " superblock " of file system instance: refer to the data structure body about the various global datas of this file system instance in each concrete file system instance, such as, super_block structure in ext4;
(7) system service: refer to that computer operating system is the interface mechanism of the various services that User space " application program " provides kernel state to realize, also referred to as system call, under operating system User space, the encapsulation fetcher code of system service is commonly referred to as " system library routine " or " system library process ".
Advantage of the present invention and good effect:
The processing speed of effective raising file data.The present invention has come forwarding virtual file system to the complex process of file data to from application layer, the complex process of file data has been come at virtual file system as far as possible, thus greatly reduce file data is delivered to application layer data volume and number of times by virtual file system, effective raising whole system to the processing speed of file data, especially at IO intensive applications and file system application scenarios Network Based.
For IO intensive applications, the SHA1 value of such as calculation document in fact application program finally just needs acquisition SHA1 character string; But existing program is limited under file system only provides standards service therefore file data can only be read the User space of application program and carries out data processing; And the present invention supports the Virtual File System of expanded function by introducing dynamic, virtual file system is put into as expanded function using to the process of the frequent re-treatment of file data, such file data there is no need to be delivered to reprocessing under the User space of application program, therefore save the operations such as a large amount of file data internal memories copies, therefore will effectively improve the processing speed of file data.
The present invention more effectively improves the processing speed of file data for file system application scenarios Network Based, because file data does not need to transmit in a network, only on the computing node at file data place, just need can carry out file extent function treatment.
Accompanying drawing explanation
Fig. 1 is the Virtual File System installation drawing of extendable functions.
Fig. 2 is the structure of expanded function description in the present invention, the structure statement schematic diagram of expanded function type function.
Fig. 3 is the program code schematic diagram of the structure that in the present invention, expanded function describes.
Fig. 4 is that in the present invention, Virtual File System service module provides " expanded function method of servicing " primary function to state schematic diagram.
Fig. 5 is the key data structure body relation schematic diagram of Virtual File System service module and file system instance module in the present invention.
Fig. 6 is network file system(NFS) client terminal device and the network file system server device architecture figure of file system application Network Based in the present invention.
Fig. 7 is that in the present invention, under operating system User space, the code schematic diagram of Virtual File System expanded function is called in the encapsulation of system library routine.
Fig. 8 be in the present invention application program by the code schematic diagram of system library routine call Virtual File System expanded function.
Fig. 9 is that in the present invention, under operating system kernel state, the code schematic diagram of Virtual File System expanded function is called in system service encapsulation.
Figure 10 is the specific implementation code schematic diagram of Virtual File System expanded function file_sha1 example in the present invention.
Embodiment
The Virtual File System device of embodiment 1, support expanded function
The Virtual File System device of support expanded function provided by the invention, as shown in Figure 1, this system and device comprises as follows: Virtual File System service module 200, file system instance module 300, expanded function table module 330 and extended function module 340; Virtual File System service module 200 is interconnected with file system instance module 300 and expanded function table module 330 respectively, expanded function table module 330 is connected with extended function module 340 is unidirectional, expanded function table module 330 points to file system instance module 300 indirectly by Virtual File System service module 200, or expanded function table module 330 also can increase a pointer thus directly point to file system instance module 300;
Wherein, described Virtual File System service module 200 comprises: file system type instance management module 210, standard feature service module 220, and expanded function service module 230; Described file system type instance management module 210, for the management to " file system type example table ", comprises registration and the cancellation of " file system type " example; As shown in Figure 5, " file system type " file_system_type structure includes file system type title, points to the pointer fs_exop of " expanded function table " of being somebody's turn to do " file system type " correspondence and point to the pointer fs_supers belonging to " superblock " of concrete " file system instance " of this " file system type ";
In Virtual File System service module 200, standard feature service module 220 is for providing the service of file standard function, and standard feature service module 220 is interrelated with " file system instance " belonging to this " file system type " example by registered " file system type " example;
In Virtual File System service module 200, expanded function service module 230 for providing the service of self-defining file extent function, expanded function service module 230 by registered " file system type " example and registered " expanded function table " interrelated; As shown in Figure 5, " expanded function table " is the set of one group of " expanded function description " structure fs_extendop example; As shown in Figure 2, " expanded function description " structure fs_extendop include file system type fstype, expanded function numbering id, expanded function type type, expanded function title name, expanded function Name Length namelen and expanded function function address fs_exopfunc; As shown in Figure 9, the expanded function that file SHA1 calculates is numbered 1001;
File system instance module 300 comprises data structure body example 310 and standard feature module 320, " data structure body example " 310 records the runtime data of this file system instance, and standard feature module 320 provides the realization of the file standard function run time version of this file system instance based on the data of " data structure body example " 310; As shown in Figure 5, main " data structure body example " 310 comprises " superblock " structure example, index node inode structure example, file structure example, directory entry dentry structure example, file system mounted some vfsmount structure example etc.;
Expanded function table module 330, for providing the management of " the expanded function table " of file extent function for concrete file system instance;
Expanded function service module 340, for providing the realization of file extent function run time version for concrete file system instance; As shown in Figure 2, the function interface statement of expanded function type function comprises pointer to object obj, object size obj_len, parameter pointer arg, parameter size arg_len, argument structure body pointed by parameter pointer arg can have different argument structure body types according to the difference of expanded function, as shown in Figure 9, the argument structure body of the expanded function of calculation document SHA1 is FSEXOP_FILE_SHA1_ARG.
In Virtual File System service module 200, expanded function service module 230 provides " expanded function method of servicing ", " expanded function method of servicing " comprises that expanded function enumerates function, expanded function searches function, expanded function registration function, expanded function nullify function, as shown in Figure 4, the structure example fsexop that the function parameter of above-mentioned " expanded function method of servicing " mainly comprises file system type example fs, expanded function describes; " application program " strengthening existed system service by adopting, setting up the expanded function method of servicing that new system service, various interprocess commications protocol and network communication protocol visit Virtual File System, such as pipeline mechanism, Socket network, remote procedure call, Restful agreement etc. based on HTTP; In example, " application program " provides the unified call function of all expanded functions of Virtual File System after encapsulating existed system service ioctl as shown in Figure 7, as shown in Figure 8, " application program " is without the need to oneself realizing SHA1 function but the SHA1 expanded function directly called on Virtual File System realizes calculating the SHA1 of file.
The method of embodiment 2, support Virtual File System expanded function
The concrete processing procedure of method of support Virtual File System expanded function provided by the present invention is as follows:
1st step, load when supporting the Virtual File System of expanded function, set up and initialization " file system type example table ", as shown in Figure 5 " file system type example table " fs_system_type;
2nd step, when loading concrete file system instance, if " file system type example table " does not comprise " file system type " example corresponding to this concrete file system instance, then set up " file system type " example and add to " file system type example table "; And setting up further should " expanded function table " associated by " file system type " example, and carries out initialization to this " expanded function table ", add empty " expanded function description " structure example; Further the associated pointers of " file system type " example corresponding to this concrete file system instance is pointed to and be somebody's turn to do " expanded function table ", fs_extendop as shown in Figure 5;
The expanded function method of servicing of the 3rd step, accesses virtual file system, as shown in Figure 4;
4th step, registration or nullify the file extent function of specified file system type;
The method of the file extent function of the 4.1st step, Virtual File System support provided by the present invention registration specified file system type realizes registration by the expanded function registration function in the expanded function service module of Virtual File System service module; The parameter of expanded function registration function comprises file system type example and file extent functional description example, and concrete processing procedure is as follows:
4.1.1 walks, according to file system type example and file extent functional description example, invoke extensions function lookup function searches whether this file expanded function registered in this file system type example, if registered, arrange rreturn value and walks for " failure " identifies and perform 4.1.6;
As shown in Figure 5, file system type example file_system_type points to file extent menu fs_extendop, the link of the All Files expanded function description scheme body example of this file system type example is got up with chain sheet form by file extent menu fs_extendop, and expanded function searches function travels through the All Files expanded function description scheme body example of this file system type example successively file extent function numbering of file extent function numbering whether for searching according to above-mentioned connection;
4.1.2 step, to load according to " function name " of file extent functional description example and specify expanded function function code in Virtual File System, and the internal memory first address of this expanded function function code is recorded in this file expanded function describes in example;
Current main-stream operating system all supports dynamic load function code, such as, dlopen in linux;
4.1.3 walks, finds " the expanded function table " corresponding to this file system type example according to file system type example;
Fs_exop as shown in Figure 5 in file system type example file_system_type has pointed to " expanded function table " fs_extendop;
4.1.4 walks, add the file extent functional description example in 4.1.2 step to " expanded function table " in 4.1.3 step;
As shown in Figure 5, " expanded function table " fs_extendop is chained list;
4.1.5 walks, arrange rreturn value for " success " mark;
4.1.6 step, processing procedure terminate.
4.2nd step, Virtual File System support provided by the present invention nullify the method for the file extent function of specified file system type, are to nullify function by the expanded function in the expanded function service module of Virtual File System service module to realize nullifying; The parameter that expanded function nullifies function comprises file system type example and file extent functional description example, and concrete processing procedure is as follows:
4.2.1 walks, according to file system type example and file extent functional description example, invoke extensions function lookup function searches whether this file expanded function registered in this file system type example, if unregistered, arrange rreturn value and walks for " failure " identifies and perform 4.2.7;
4.2.2 walks, finds " the expanded function table " corresponding to this file system type example according to file system type example;
4.2.3 step, " the expanded function table " traveled through in 4.2.2 step, find and to walk file expanded function with 4.2.1 and describe expanded function in example and number the first address that identical existing file expanded function describes example;
As shown in Figure 5, " expanded function table " fs_extendop is chained list;
4.2.4 walks, describe example according to the existing file expanded function found in 4.2.3 step, obtains corresponding " expanded function " function first address, unloads this expanded function function code in Virtual File System;
As shown in Figure 5, the fs_exopf of file extent functional description example is " expanded function " function first address; Current main-stream operating system all supports dynamic offloading function code, such as, dlclose in linux;
4.2.5 step, the existing file expanded function found in deletion 4.2.3 step in " the expanded function table " of 4.2.2 step describe example;
4.2.6 walks, arrange rreturn value for " success " mark;
4.2.7 step, processing procedure terminate.
5th step, access the file extent function of concrete file system instance;
When 6th step, unloading support the Virtual File System of expanded function, in unloading Virtual File System, all files expanded function code of All Files system type, deletes whole " the expanded function tables " of All Files system type further.
5th step, access the file extent function of concrete file system instance;
The method of the file extent function of concrete file system instance is accessed in Virtual File System support provided by the present invention, that " application program " strengthens existed system service by adopting, set up new system service, various interprocess commications protocol and network communication protocol visit the file extent function of concrete file system instance, the unified call function of all expanded functions of Virtual File System is provided after as shown in Figure 7 existed system service ioctl being encapsulated, the parameter of said system service comprises file extent function numbering and file extent 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, to obtain according to the file describing word in the 5.1st step corresponding to file structure, " superblock " structure example of concrete " file system instance " corresponding to obtaining according to this file structure further; As shown in Figure 5, the file_inode in file structure file points to inode structures body inode, and the i_sb in further inode structures body inode points to " superblock " structure super_block;
5.3rd step, according to " superblock " structure example in the 5.2nd step, the file system type example corresponding to acquisition; 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, according to the file system type example in the 5.3rd step and file extent function numbering, invoke extensions function lookup function searches whether this file expanded function registered in this file system type example, if unregistered, arrange rreturn value and identifies for " failure " and perform the 5.6th step; Otherwise record expanded function and search this file expanded function function address that function returns;
As shown in Figure 5, file system type example file_system_type points to file extent menu fs_extendop, the link of the All Files expanded function description scheme body example of this file system type example is got up with chain sheet form by file extent menu fs_extendop, and expanded function searches function travels through the All Files expanded function description scheme body example of this file system type example successively file extent function numbering of file extent function numbering whether for searching according to above-mentioned connection;
5.5th step, function address according to file extent functional parameter structure and the 5.4th this file expanded function of step, call this file expanded function, and using the rreturn value of this file expanded function as the rreturn value when pretreatment process;
As shown in Figure 5, the fs_exopf in file extent functional description structure example has pointed to the function code first address of file extent function;
5.6th step, processing procedure terminate.
When 6th step, unloading support the Virtual File System of expanded function, in unloading Virtual File System, all files expanded function code of All Files system type, deletes whole " the expanded function tables " of All Files system type further.
For technology contents of the present invention, Characteristic can be understood further, hereby enumerate following application example, and coordinate accompanying drawing to be described in detail as follows:
Application example 1
As shown in Figure 6, whole system is the scene of file system Network Based application, " application program " on " network file system(NFS) customer set up " visits the file system on " network file system server device " by local " Virtual File System ", common scheme sets up network file system(NFS) NFS service agreement, namely the file system on " network file system server device " passes through NFS service agreement carry in " Virtual File System " of " network file system(NFS) customer set up ", " application program " now on " network file system(NFS) customer set up " accesses this network file system(NFS) as access local file system Ext4.
As shown in Fig. 7,8,9,10, application example 1 is that " application program " on " network file system(NFS) customer set up " calculates the digital digest that the file in the file system on long-range " network file system server device " carries out SHA1 algorithm, and it is not the standards service that file system provides that SHA1 calculates.
For application example 1, existing scheme is that on " network file system(NFS) customer set up ", the file data overall network in the file system on " network file system server device " is transferred to " network file system(NFS) customer set up " by local " Virtual File System " and NFS service agreement by " application program ", and copy to User space by the kernel state of " network file system(NFS) customer set up " further, then " application program " calculates the SHA1 value of this file again, can produce like this in a large amount of network data transmission of certain file and " network file system(NFS) customer set up " by the replicate run of kernel state to User space.
The scheme that the present invention provides, by setting up the Virtual File System device of extendable functions, Virtual File System is made to support expanded function, thus calculate carrying out SHA1 to file the expanded function changing Virtual File System into, SHA1 expanded function is all set up like this at " Virtual File System " of " network file system(NFS) customer set up " and " network file system server device " two devices, and by the remote procedure call that the existing service agreement of network file system(NFS) NFS realizes, thus realize " SHA1 expanded function " the calling " the SHA1 expanded function " of " network file system server device " of " network file system(NFS) customer set up ", in fact " the network file system(NFS) service routine NFS_S " of " network file system server device " upper User space is also a kind of is extendable functions " Virtual File System ", " Virtual File System " should externally provide file service by the system service of procotol instead of operating system, " the expanded function service " of being somebody's turn to do " Virtual File System " is realized according to the inventive method, and " the SHA1 expanded function " of " network file system(NFS) customer set up " calling " the SHA1 expanded function " of " network file system server device ", like this without the need to carry out in a large amount of network data transmission of certain file and " network file system(NFS) customer set up " by the replicate run of kernel state to User space, " Virtual File System " directly on " network file system server device " carries out the calculating of SHA1 expanded function, and give " application program " on " network file system(NFS) customer set up " SHA1 value transmit, and SHA1 value itself is little byte stream, be far smaller than file data itself.
For application example 1, according to the 2nd kind of scheme of the present invention, also can in the SHA1 expanded function of " the network file system(NFS) service routine NFS_S " of " network file system server device " upper User space, instead of SHA1 expanded function is registered in " network file system server device " goes up " Virtual File System ", such file data needs from kernel state copying to User space " network file system server device ", but do not need a large amount of network data transmission for certain file yet, effectively can improve the efficiency that file calculates SHA1 yet.
Unified call function int syscall_fsexop (the int fsexop_type of all expanded functions of Virtual File System is provided after as shown in Figure 7 existed system service ioctl being encapsulated, void*arg), existing system service ioctl does not support that the expanded function of Virtual File System is called, but system service ioctl interface is very general, 2nd parameter of ioctl represents operational order numbering, therefore when not changing system service ioctl interface, support to call Virtual File System expanded function to carry out Unified number, as the FSEXOP in Fig. 7, the numberings such as FSEXOP_FILE_SHA1, and under the kernel state of ioctl, in measure for fulfill, support that new operational order is numbered, under the kernel state of ioctl as shown in Figure 9, measure for fulfill is SYSCALL_DEFINE3 (ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg), only need disposable increase to the code of cmd parameter New function, case FSEXOP code snippet as shown in Figure 9,
The method of the SHA1 file extent function of concrete file system instance is accessed in Virtual File System support provided by the present invention, the unified call function of all expanded functions of Virtual File System is provided after as shown in Figure 7 existed system service ioctl being encapsulated, function parameter comprises file extent function numbering and file extent functional parameter structure pointer, and concrete processing procedure 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, to obtain according to the file describing word in the 1st step corresponding to file structure, " superblock " structure of concrete " file system instance " corresponding to obtaining according to this file structure further;
Code fs=file->file_inode->i_sb-Gr eatT.GreaT.GTs_type as shown in Figure 9;
3rd step, according to " superblock " structure in the 2nd step, the file system type example corresponding to acquisition;
Code fsexopf=find_fsexops (fs, FSEXOP_ID, mArg->fsexop_type, sizeof (int)) as shown in Figure 9;
4th step, according to the file system type example in the 3rd step and file extent function numbering, invoke extensions function lookup function searches whether this file expanded function registered in this file system type example, if unregistered, arrange rreturn value and identifies for " failure " and perform the 6th step; Otherwise record expanded function and search this file expanded function function address that function returns;
5th step, function address according to file extent functional parameter structure and the 4th this file expanded function of step, call this file expanded function, and using the rreturn value of this file expanded function as the rreturn value when pretreatment process;
Code (* fsexopf) (file, sizeof (struct file*), mArg->digest, mArg->digestlen) as shown in Figure 9;
6th step, processing procedure terminate.
The method that the file extent function of concrete file system instance is accessed in Virtual File System support provided by the present invention is the method providing expanded function framework, only once need write, support calling of any file extent function; On the other hand, because the function that different file extent functional realiey is different, therefore each file extent function must develop specific implementation code, as Figure 10 gives specific implementation code intfsexop_file_sha1 (the const struct file*filep of the SHA1 expanded function run in Virtual File System, void*op, int oplen), do not inquire into the specific implementation of specific file extent function herein in detail.
Consider the embodiment of the description of this invention disclosed herein and special case, other embodiments of the present invention are aobvious and suggestion for a person skilled in the art.These illustrate and embodiment is only considered as an example, within the spirit and principles in the present invention all, and any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (7)

1. support a Virtual File System device for expanded function, it is characterized in that, described system and device comprises: Virtual File System service module, file system instance module, expanded function table module and extended function module; Virtual File System service module is interconnected with file system instance module and expanded function table module respectively, expanded function table module is connected with extended function module is unidirectional, and expanded function table module is passed through or do not pointed to file system instance module by Virtual File System service module;
Wherein, described Virtual File System service module comprises: 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 the management to " file system type example table ", comprises registration and the cancellation of " file system type " example; Standard feature service module is for providing the service of file standard function, and standard feature service module is interrelated with " file system instance " belonging to this " file system type " example by registered " file system type " example; Expanded function service module for providing the service of self-defining file extent function, expanded function service module by registered " file system type " example and registered " expanded function table " interrelated;
File system instance module comprises data structure body example and standard feature module, " data structure body example " records the runtime data of this file system instance, and standard feature module then provides the realization of the file standard function run time version of this file system instance based on the data of " data structure body example ";
Expanded function table module, for providing the management of " the expanded function table " of file extent function for concrete file system instance;
Expanded function service module, for providing the realization of file extent function run time version for concrete file system instance.
2. system and device according to claim 1, it is characterized in that, described " expanded function table " is the set of one group of " expanded function description " structure example, wherein " expanded function description " structure include file system type, expanded function numbering, 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, and the pointer that wherein " file system type " structure contains file system type title, " file system type " corresponding " expanded function table " is somebody's turn to do in sensing and sensing belong to the pointer of " superblock " of concrete " file system instance " of this " file system type ".
3. system and device according to claim 1, it is characterized in that, the expanded function service module of described Virtual File System service module provides " expanded function method of servicing ", and " expanded function method of servicing " comprises that expanded function enumerates function, expanded function searches function, expanded function registration function and expanded function nullify function; " application program " strengthening existed system service by adopting, setting up the expanded function method of servicing that new system service, various interprocess commications protocol and network communication protocol visit Virtual File System.
4. support a method for Virtual File System expanded function, it is characterized in that, described method comprises following processing procedure:
1st step, load when supporting the Virtual File System of expanded function, set up and initialization " file system type example table ";
2nd step, when loading concrete file system instance, if " file system type example table " does not comprise " file system type " example corresponding to this concrete file system instance, then set up " file system type " example and add to " file system type example table "; And setting up further should " expanded function table " associated by " file system type " example, and carries out initialization to this " expanded function table ", add empty " expanded function description " structure example; Further the associated pointers of " file system type " example corresponding to this concrete file system instance is pointed to and be somebody's turn to do " expanded function table ";
The expanded function method of servicing of the 3rd step, accesses virtual file system;
4th step, registration or nullify the file extent function of specified file system type;
5th step, access the file extent function of concrete file system instance;
When 6th step, unloading support the Virtual File System of expanded function, in unloading Virtual File System, all files expanded function code of All Files system type, deletes whole " the expanded function tables " of All Files system type further.
5. method according to claim 4, it is characterized in that, in " the file extent function of registration or cancellation specified file system type " described in 4th step, " the file extent function of registration specified file system type " realizes registration by the expanded function registration function in the expanded function service module of Virtual File System service module; The parameter of expanded function registration function comprises file system type example and file extent functional description example;
The processing procedure of the 4.1st step, expanded function registration function is as follows:
4.1.1 walks, according to file system type example and file extent functional description example, invoke extensions function lookup function searches whether this file expanded function registered in this file system type example, if registered, arrange rreturn value and walks for " failure " identifies and perform 4.1.6;
4.1.2 step, to load according to " function name " of file extent functional description example and specify expanded function function code in Virtual File System, and the internal memory first address of this expanded function function code is recorded in this file expanded function describes in example;
4.1.3 walks, finds " the expanded function table " corresponding to this file system type example according to file system type example;
4.1.4 walks, add the file extent functional description example in 4.1.2 step to " expanded function table " in 4.1.3 step;
4.1.5 walks, arrange rreturn value for " success " mark;
4.1.6 step, processing procedure terminate.
6. method according to claim 4, it is characterized in that, in " the file extent function of registration or cancellation specified file system type " described in 4th step, " nullifying the file extent function of specified file system type " nullifies function by the expanded function in the expanded function service module of Virtual File System service module to realize nullifying; The parameter that expanded function nullifies function comprises file system type example and file extent functional description example;
The processing procedure that 4.2nd step, expanded function nullify function is as follows:
4.2.1 walks, according to file system type example and file extent functional description example, invoke extensions function lookup function searches whether this file expanded function registered in this file system type example, if unregistered, arrange rreturn value and walks for " failure " identifies and perform 4.2.7;
4.2.2 walks, finds " the expanded function table " corresponding to this file system type example according to file system type example;
4.2.3 step, " the expanded function table " traveled through in 4.2.2 step, find and to walk file expanded function with 4.2.1 and describe expanded function in example and number the first address that identical existing file expanded function describes example;
4.2.4 walks, describe example according to the existing file expanded function found in 4.2.3 step, obtains corresponding " expanded function " function first address, unloads this expanded function function code in Virtual File System;
4.2.5 step, the existing file expanded function found in deletion 4.2.3 step in " the expanded function table " of 4.2.2 step describe example;
4.2.6 walks, arrange rreturn value for " success " mark;
4.2.7 step, processing procedure terminate.
7. method according to claim 4, it is characterized in that, the method of " accessing the file extent function of concrete file system instance " described in the 5th step is that " application program " strengthens existed system service by adopting or set up the file extent function that new system service visits concrete file system instance, and the parameter of said system service comprises file extent function numbering and file extent 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, to obtain according to the file describing word in the 5.1st step corresponding to file structure, " superblock " structure example of concrete " file system instance " corresponding to obtaining according to this file structure further;
5.3rd step, according to " superblock " structure example in the 5.2nd step, the file system type example corresponding to acquisition;
5.4th step, according to the file system type example in the 5.3rd step and file extent function numbering, invoke extensions function lookup function searches whether this file expanded function registered in this file system type example, if unregistered, arrange rreturn value and identifies for " failure " and perform the 5.6th step; Otherwise record expanded function and search this file expanded function function address that function returns;
5.5th step, function address according to file extent functional parameter structure and the 5.4th this file expanded function of step, call this file expanded function, and using the rreturn value of this file expanded function as the rreturn value when pretreatment process;
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 true CN104573061A (en) 2015-04-29
CN104573061B 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)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107894886A (en) * 2017-11-23 2018-04-10 北京九章云极科技有限公司 The method, apparatus and terminal device of a kind of operation 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

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107894886A (en) * 2017-11-23 2018-04-10 北京九章云极科技有限公司 The method, apparatus and terminal device of a kind of operation code
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

Also Published As

Publication number Publication date
CN104573061B (en) 2017-09-26

Similar Documents

Publication Publication Date Title
US10013185B2 (en) Mapping systems and methods of an accelerated application-oriented middleware layer
US6871245B2 (en) File system translators and methods for implementing the same
KR101041319B1 (en) Systems and methods for providing conflict handling for peer-to-peer synchronization of units of information manageable by a hardware/software interface system
US9367569B1 (en) Recovery of directory information
EP2771794B1 (en) Software translation lookaside buffer for persistent pointer management
JP4653106B2 (en) Type path indexing
US20070220089A1 (en) Modular distributed mobile data applications
KR20170019352A (en) Data query method and apparatus
CA2824489C (en) Method for backward-compatible aggregate file system operation performance improvement, and respective apparatus
WO2008101237A1 (en) Live entities internet store service
US20180307736A1 (en) Efficient Snapshot Generation of Data Tables
US11210006B2 (en) Distributed scalable storage
CN102014154A (en) Grid service-based remote sensing image extraction and sharing system and method
Wang et al. Retrieving and indexing spatial data in the cloud computing environment
US11100129B1 (en) Providing a consistent view of associations between independently replicated data objects
CN108536617A (en) Buffer memory management method, medium, system and electronic equipment
US11106394B2 (en) Storing an entity as an object or a file in a hybrid storage system based on an accessing protocol
TWI337310B (en) Systems and methods for extensions and inheritance for units of information manageable by a hardware/software interface system
US10606805B2 (en) Object-level image query and retrieval
CN104573061A (en) Virtual file system device and method supporting expanding function
CN114756509B (en) File system operation method, system, device and storage medium
US7155458B1 (en) Mechanism for distributed atomic creation of client-private files
US11934547B2 (en) Multiprotocol access control
CN114519039B (en) Data online management method and device, terminal equipment and storage medium
US20230334093A1 (en) Graph-organized 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