CN104021137B - A kind of client based on catalogue mandate is locally opened and closed the method and system of file - Google Patents

A kind of client based on catalogue mandate is locally opened and closed the method and system of file Download PDF

Info

Publication number
CN104021137B
CN104021137B CN201410160168.9A CN201410160168A CN104021137B CN 104021137 B CN104021137 B CN 104021137B CN 201410160168 A CN201410160168 A CN 201410160168A CN 104021137 B CN104021137 B CN 104021137B
Authority
CN
China
Prior art keywords
client
catalogue
document
file
read authority
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.)
Expired - Fee Related
Application number
CN201410160168.9A
Other languages
Chinese (zh)
Other versions
CN104021137A (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.)
Tianjin Zhongke Bluewhale Information Technology Co ltd
Institute of Computing Technology of CAS
Original Assignee
Tianjin Zhongke Bluewhale Information Technology Co ltd
Institute of Computing Technology of CAS
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 Tianjin Zhongke Bluewhale Information Technology Co ltd, Institute of Computing Technology of CAS filed Critical Tianjin Zhongke Bluewhale Information Technology Co ltd
Priority to CN201410160168.9A priority Critical patent/CN104021137B/en
Publication of CN104021137A publication Critical patent/CN104021137A/en
Application granted granted Critical
Publication of CN104021137B publication Critical patent/CN104021137B/en
Expired - Fee Related 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources

Abstract

The invention discloses the method and system that a kind of client based on catalogue mandate is locally opened and closed file, it is related to the optimisation technique of cluster file system small file access performance, the method that more particularly to a kind of client based on catalogue mandate is locally opened and closed file.The method includes authorisation step, and server authorizes the extension read authority of client directory according to directory-extension read authority mechanism, and directory information, extension read authority are sent into the client, and the directory information is stored in local read buffer by the client;Files step is opened, the client sets up the directory entry structure of this document and the inode structures of this document according to the directory information, and is associated with the Unclosing structure of this document, this document Unclosing structure is added in process opening file table;Files step is closed, the process is opened into this document Unclosing structure in file table and is removed and is discharged.The present invention can optimize the access efficiency of small documents, and can reduce the metadata access load of server.

Description

A kind of client based on catalogue mandate is locally opened and closed the method and system of file
Technical field
It is more particularly to a kind of to be based on catalogue the present invention relates to the optimisation technique of cluster file system small file access performance The method that the client of mandate is locally opened and closed file.
Background technology
Current mass small documents access performance has become the focus and difficult point of the research of one, cluster file system field, shadow The principal element for ringing mass small documents access performance is the metadata synchronization of access of high concurrent at high proportion, metadata synchronization of access band The network interaction expense come makes small documents access operating delay excessive, has severely impacted systematic function.
In existing system, in order to ensure correct shared semanteme, it is necessary to safeguard unit respectively in client and server The state of data, distributed file system (including pNFS, CEPH etc.) all status of support services of current main-stream, in status of support In the cluster file system of service, client will send to server and ask, so as in server to each opening of file The open mode of file is set up, the access attribute of file, equally, shutoff operation of the client to file is obtained, it is also desirable to Server is interacted, to notify that server removes the open mode of this document, but single client to each small documents Read and write access is required for Remote Open operation (open) and a remote closing operation (close) at least one times, gives each small text The data access of part increased network interaction expense twice, and the read-write efficiency of strong influence small documents is accessed in client In the case that conflict is fewer, frequently carry out network interaction to set up and remove state with server, cause unnecessary system The wasting of resources, when high concurrent accesses large amount of small documents, will greatly increase the metadata load of server, typical distributed text The outer reading flow of band of part system pNFS (parallel network file system) is as shown in Figure 1.
Patent of invention " file creating method and its system in a kind of distributed type file system client side caching " discloses one File creating method and its system in distributed type file system client side caching are planted, wherein the method includes:Step 1, client Catalogue is obtained from meta data server write mandate;Step 2, client establishment file in local cache;Step 3, client is different Step submits institute's establishment file to meta data server to.The inventive method solves distributed document in mass small documents application scenarios System prior art interacts the problem of expense with meta data server synchronizing network when cannot effectively reduce document creation.But should Invention is directed to distributed file system, it is proposed that a kind of method and system of the establishment file in client-cache, does not relate to And the method in client locally opening and closing file.
Patent of invention " realization method and system of the distributed deployment application program based on IO decouplings " discloses a kind of base In the realization method and system of the distributed deployment application program of IO decouplings, it is related to virtual machine, this realizes that system includes client Software, separation dynamic link library and virtual program administrative unit, separate the executable program that dynamic link library is located at server end And system dynamic link library between, separate dynamic link library and the function call on display, I/O portion is transferred to by this by RPC Ground terminal is performed, and display, the function of I/O portion include relating to man-machine interface interaction, figure shows, file I/O and network I/O Function.The present invention separates the logical gate of application program with display, I/O portion, and the other parts of application program are not changed, makes Application program is virtualized, and virtual granularity is relatively small, virtual program implementation effect as local program, with local other journeys Sequence interactivity is relatively good, reduces the consumption of VME operating system resource.But the invention is for the problem of application deployment, A kind of distributed deployment method and system based on IO decouplings is proposed, will be shown, the function call of I/O portion is transferred to client End locally executes, and is not involved with the method for file opening and closing in distributed file system.
The content of the invention
In view of the shortcomings of the prior art, the present invention proposes the client sheet based on catalogue mandate in a kind of cluster file system The method that ground is opened, closes file, to avoid the opening of each file, shutoff operation from being required for access server, so as to improve Small documents are accessed with the efficiency of operation, server metadata load is reduced.
To solve problem above, the present invention provides a kind of method that client based on catalogue mandate is locally opened and closed file, It is characterised in that it includes following steps:
Authorisation step, the user end to server sends reads the catalog request, and the server is according to directory-extension read authority Mechanism authorizes the extension read authority of the client to the catalogue, and directory information, the extension read authority are sent into the client The directory information is stored in local read buffer by end, the client;
Files step is opened, the directory information of the client in the local read buffer sets up the directory entry of this document The inode structures of structure and this document, and by the Unclosing structure of the directory entry structure, the inode structures and this document Association, while increasing the extension read authority, the directory entry structure, the reference count of the inode structures, this document is opened Structure is added to during process opens file table, and this document under the catalogue is locally opened to complete the client;
Files step is closed, the step is the inverse process of the opening Files step.
The method that the described client based on catalogue mandate is locally opened and closed file, the directory-extension is read in the authorisation step The step of licensing scheme, is as follows:Judge whether the client in addition to the client writes mandate by what the server authorized the catalogue Or the file under the catalogue writes mandate, if it is, extended to the client Returning catalogue for applying for the extension read authority reading Authorization failure signal, the otherwise server end are authorized and apply for that the extension of the client of the extension read authority catalogue reads to award Power.
The method that the described client based on catalogue mandate is locally opened and closed file, the directory information bag in the authorisation step Include:The attribute information of the All Files under the catalogue under the directory entry information of All Files and the catalogue.
The method that the described client based on catalogue mandate is locally opened and closed file, this document rope in the opening Files step The domain drawn in node structure includes:The creation time of this document, the modification time of this document, the size of this document, this document Founder, the inode number of this document, the type of this document, the access rights of this document, the corresponding equipment of this document;This article Domain in the directory entry structure of part includes:The filename of this document and the inode number of this document.
The method that the described client based on catalogue mandate is locally opened and closed file, also adjusts back including mandate, including as follows Step:When the client in addition to the client sends write request to this document under the catalogue or the catalogue to the server When, the server sends " readjustment " and asks to the client for holding the extension read authority, and this holds being somebody's turn to do for the extension read authority Client marks the extension read authority for " recalling ", when the reference count of the extension read authority is kept to 0, by the extension read authority Return to the server.
Present invention additionally comprises the system that a kind of client based on catalogue mandate is locally opened and closed file, it is characterised in that bag Include:
Authorization module, sends for the user end to server and reads the catalog request, and the server is read according to directory-extension Licensing scheme authorizes the extension read authority of the client to the catalogue, and directory information, the extension read authority are sent into this The directory information is stored in local read buffer by client, the client;
File module is opened, the mesh of this document is set up for the directory information of the client in the local read buffer The inode structures of record item structure and this document, and by the opening of the directory entry structure, the inode structures and this document Structure connection, while increase the extension read authority, the directory entry structure, the reference count of the inode structures, by this document Unclosing structure is added in process opening file table;
File module is closed, based on reducing the extension read authority, the directory entry structure, the reference of the inode structures Number, and this document Unclosing structure under the catalogue in process opening file table is removed and discharged.
The system that the described client based on catalogue mandate is locally opened and closed file, the directory-extension is read in the authorisation step The step of licensing scheme, is as follows:Judge whether the client in addition to the client writes mandate by what the server authorized the catalogue Or the file under the catalogue writes mandate, if it is, extended to the client Returning catalogue for applying for the extension read authority reading Authorization failure signal, the otherwise server end are authorized and apply for that the extension of the client of the extension read authority catalogue reads to award Power.
The system that the described client based on catalogue mandate is locally opened and closed file, the directory information includes:Under the catalogue The attribute information of the All Files under the directory entry information and the catalogue of All Files.
The system that the described client based on catalogue mandate is locally opened and closed file, the domain bag in the inode structures Include:The creation time of this document, the modification time of this document, the size of this document, the founder of this document, the index of this document Node number, the type of this document, the access rights of this document, the corresponding equipment of this document;This document directory entry structure includes:Should The filename of file and the inode number of this document.
The system that the described client based on catalogue mandate is locally opened and closed file, also including authorizing callback module, the mould Block reclaims the extension read authority for the server, when the client in addition to the client is under the catalogue or the catalogue When this document sends write request to the server, the server sends " readjustment " to the client for holding the extension read authority please Ask, the client for holding the extension read authority marks the extension read authority for " recalling ", when the reference of the extension read authority When counting is kept to 0, the extension read authority is returned into the server.
From above scheme, the advantage of the invention is that:
The present invention not only ensures that the data of client catalogue when directory-extension read authority is possessed will not be changed, and Ensure that the file under the catalogue will not be changed, if by read directory operation obtain catalogue under file directory entry information and category Property information while, be obtained in that the extension read authority of catalogue, then file just can be opened, closed local, it is not necessary to Server is interacted, so that the present invention can optimize the access efficiency of small documents, and can reduce the metadata of server Access load.
Brief description of the drawings
Fig. 1 is the reading flow chart of exemplary parallel network system;
Fig. 2 is that client obtains directory information and directory-extension read authority flow chart;
Fig. 3 locally opens document flowchart for client;
Fig. 4 locally closes document flowchart for client;
Fig. 5 be client according to whether hold the extension read authority of catalogue, judge from Local or Remote opening document flow Figure;
Fig. 6 be client according to whether hold the extension read authority of catalogue, judge from Local or Remote closing document flow Figure;
Fig. 7 is overall flow figure of the present invention;
Wherein reference is:
Step 100 is to obtain directory information and directory-extension read authority step by reading directory operation, including:
Step 101/102/103/104/105/106/107;
Step 200 is the specific steps that client locally opens file, including:
Step 201/201/202/203/204/205/206;
Step 300 is the specific steps that client locally closes file, including:
Step 301/302/303/304/305/306;
Step 400 be client according to whether hold the extension read authority of catalogue, judge from Local or Remote opening file Step, including:
Step 401/402/200;
Step 500 be client according to whether hold the extension read authority of catalogue, judge from Local or Remote closing file Step, including:
Step 501/502/300;
Specific embodiment
Present invention aim to address in existing cluster file system, the opening and closing of each file are required for and service Device is interacted, and causes small documents to read and write the problem for postponing big and server metadata load weight.The present invention proposes a kind of based on mesh Record the method that the client for authorizing locally is opened, closes file.Methods described is sent to assigned catalogue in user end to server Reading directory operation request (READDIR PLUS) obtain file attribute under the directory entry information and all catalogues of the catalogue Meanwhile, ask the extension read authority of the catalogue, during being used to ensure that client holds the catalogue read authority, the data of the catalogue and The data of each file will not be changed under the catalogue.
Licensing scheme is a kind of Optimization Mechanism of condition managing in the case that access conflict is fewer between client. When not having access conflict between client, licensing scheme can avoid repeating sending request and improving systematic function to server.Award Certain specified permission of client is authorized at power representative server end, and server is licensed into visitor to the right of file (including catalogue) Family end so that the decision-making that many should be made by server, locally can carry out decision-making, when another client ginseng by client With shared one authority when, server can send " readjustment " and ask recall mandate to client.
The specific steps below locally opened, close for client:
As shown in Fig. 2 step 100 is to obtain directory information (directory information by reading directory operation (READDIR PLUS) The attribute information of All Files under directory entry information, catalogue including All Files under catalogue) and directory-extension read authority step Suddenly, perform step 101 client and send and read catalog request to server, perform step 102 server and read to award according to directory-extension Power mechanism judges whether to authorize client directory extension read authority, and directory-extension read authority mechanism is:If server has been authorized The file write under mandate or the catalogue of other client catalogues writes mandates, then rushing occurs in the extension read authority of catalogue Prominent, performing step 106 client can not obtain extension read authority, perform step 107 client remote and obtain directory information, if The extension read authority of catalogue does not conflict, then perform step 103 server and send directory information (including under directory entry information, catalogue All Files attribute information), the extension read authority of catalogue to client performs step 104 client and obtains directory information With the extension read authority of catalogue, perform step 105 client and directory information is stored in read buffer, continue executing with step 200 visitor Open Files step in family end.
As shown in figure 3, step 200 is the specific steps that client locally opens file, performing step 201 client increases The extension read authority reference count of catalogue, performs step 202 and directory information is searched in read buffer, performs step 203 according to mesh Record information sets up directory entry structure and inode structures in virtual file system, in virtual file system, each opening File one inode structures of correspondence, be used to preserve the various attribute informations of file, and such as the creation time of file, file are repaiied Change time, the size of file, the founder of file, the inode number of file, the type of file, the access rights of file, text Corresponding equipment of part etc., inode number can be with unique mark file system a file, and directory entry structure is used for preserving The corresponding relation of filename and inode number, performs step 204 by directory entry structure and inode structures and File Open Structure connection, performing step 205 increases the reference count of directory entry structure and inode structures, performs step 206 by file Unclosing structure is added to process and opens file table, returns to application file descriptor.
As shown in figure 4, step 300 is the specific steps that client locally closes file, performs step 301 client and reduce Directory entry structure and inode structures quote number of times, perform step 302 and File Open structure is opened in file table from process Remove and discharge, perform the extension read authority reference number of times that step 303 reduces catalogue, perform step 304 and work as other clients pair When file under the catalogue or catalogue sends write request, server sends to the client of the extension read authority for holding the catalogue Extension read authority is recalled in " readjustment " request, judges whether the extension read authority of catalogue receives server readjustment request, if do not had Readjustment request is received, is then performed step 305 client and is continued to hold the extension read authority of catalogue, if receiving readjustment request, Perform step 306 client and the extension read authority of the catalogue is returned into server.
Be below client according to whether hold the extension read authority of catalogue, judge the step from Local or Remote opening file Suddenly:
As shown in figure 5, step 401 client judges whether to hold the extension read authority of the parent directory to be opened file, If holding, perform step 200 client and locally open this document step, otherwise, performing step 402 client remote opening should File.
Be below client according to whether hold the extension read authority of catalogue, judge the step from Local or Remote closing file Suddenly:
As shown in fig. 6, step 501 client judges whether that the extension of the parent directory for holding the file to be closed reads to award Power, if holding, performs step 300 client and locally closes this document step, otherwise, performs step 502 client remote and closes Close this document.
It is below overall flow of the present invention, as shown in fig. 7, user end to server sends reads catalog request, server root Client directory extension read authority is authorized according to directory-extension read authority mechanism, and directory information is sent to client, client Directory information is stored in local read buffer;When client opens or closes file, first check for whether client holds the mesh The extension read authority of the parent directory of record, to determine that Local or Remote opens this document;Side if other clients to monopolize Formula participates in sharing when having authorized a file under parent directory or the catalogue, and server can send " readjustment " request and call together to client Feedback is weighed.
It is below the specific implementation step in pNFS (parallel network file system) of the invention:
Parallel network file system represents a mandate, wherein type in client data structure nfs_delegation The type (read/write) for authorizing is represented, (NFS_DELEGATION_EXTENT is represented and authorized expansion flags for identifying the state for authorizing Exhibition type, NFS_DELEGATION_RECALL is represented to authorize and has been received readjustment request, and ref represents the number of times for authorizing and being cited. In client, catalogue (including file) one inode structures of correspondence, the pointer field in inode structures Delegation points to the authorization structure that client is held to the catalogue (file).
Server end data structure nfs4_delegation represents a mandate, and wherein dl_type represents the class for authorizing Type, extent is used to identify whether mandate is expansion type, and clp represents the client belonging to authorizing.In server end, a mesh Record or file one File Open structure (nfs4_file) of correspondence, the domain fi_delegations in File Open structure is one Individual linked list head, represents file authorizing chained list, and the chained list is the authorization structure chain held to the catalogue or file by all clients Connect.In server end, all of File Open structure is stored in a Hash table of entitled file_hashtbl, should Hash table is using the inode number of virtual file layer index node structure as index.
User end to server sends RPC (remote procedure call protocol), that is, read directory operation request, and server is according to mesh Record licensing scheme is authorized and judges whether the extension read authority for authorizing client directory, i.e. server by utilizing catalogue Virtual File System The index node of layer index node structure, indexes file_hashtbl Hash tables, searches corresponding File Open structure, if The File Open structure of file is not found in file_hashtbl Hash tables, then creates a File Open structure, initialization And it is added in file_hashtbl Hash tables, and authorizes the extension read authority of client directory.Server authorizes client The step of end extension read authority is the extension read authority structure that creaties directory, and distributes nfs4_delegation (authorization structure), if Dl_type (authorization type) is put to read, extent (extension) is that 1, clp (client belonging to authorizing) is active client, will be new The nfs4_delegation (authorization structure) of distribution, is added to fi_delegations (the file authorizing chains of File Open structure Table) in.If finding the File Open structure of file in file_hashtbl Hash tables, File Open structure is traveled through item by item Fi_delegations (file authorizing chained list), check the fi_delegations (file authorizings of each file under the catalogue Chained list) in whether write mandate, if all do not write in the fi_delegations (mandate chained list) of file under all catalogues Authorize, then authorize the extension read authority of client directory, (extent is 0, visitor otherwise to authorize the common catalogue read authority of client Family end can only enter the Remote Open or shutoff operation of column catalogue), server reads the directory entry information and category of the file under catalogue Property information, the vfs_readdir (function reading) of server calls virtual file system reads directory entry information slow In depositing, server by utilizing directory entry information carries out lookup (lookup) to the file under catalogue, it is established that file under catalogue Inode structures, directory entry structure etc., and call the vfs_getattr (acquisition attribute function) of virtual file system to obtain The attribute information of each file under the attribute information of the file under catalogue, server directory is transmitted after being attached to directory entry information To client, the catalogue authorization message that client decoding server end is beamed back, if server is granted by client read authority, Nfs_delegation (authorization structure) is set up, read authority sets type (type) to read, extension is authorized and sets flags (marks Know) it is NFS_DELEGATION_EXTENT (extension is authorized), by structure record in the corresponding nfs of client directory (network texts Part system layer) inode structures delegation (Authorized Domain) in, client will obtain directory entry information and catalogue under The attribute information of file be stored in the read buffer of client.
Client locally opens catalogue or file, virtual file system distribution File Open structure, i.e. File Open knot Structure, virtual file system calls the opening document method of NFS layer to open file, first determines whether file to be opened Parent directory whether hold the extension read authority of catalogue, that is, judge what nfs_inode (inode structures) was pointed to Whether the type (type field) of delegation (Authorized Domain) is to read and nfs_inode (inode structures) sensings Whether the flags (identification field) of delegation (Authorized Domain) is NFS_DELEGATION_EXTENT (extension is authorized), if do not had There is parent directory to extend read authority, then send Remote Open request, perform Remote Open Files step, if holding parent directory extension Read authority, then increase the reference count of the extension read authority of catalogue, checks file virtual file system directory entry structure, index Node structure whether in the buffer, if in the buffer, setting up File Open structure and inode structures and directory entry knot The association of structure, increases the reference count of inode structures and directory entry structure, if not in the buffer, gone according to filename Read buffer, the attribute information of the file under the directory entry information and catalogue of locating file, if not finding file are retrieved item by item Directory entry information and catalogue under file attribute information, terminate opening operation, releasing document Unclosing structure, return- ENOENT (catalogue or file do not specified), represents that opening file does not exist, if finding the directory entry information and mesh of file The attribute information of the file under record, then according to the attribute information of the file under directory entry information and catalogue, set up or refresh text The directory entry structure and inode structures of part virtual file system, File Open structure is added to the opening file of process In table.
Client locally closes catalogue or file, first determines whether whether the parent directory of file to be closed holds directory-extension reading Authorize, i.e., judge nfs_inode (inode structures) sensing delegation (Authorized Domain) type (type field) whether Be read and nfs_inode (inode structures) point to delegation (Authorized Domain) flags (identification field) whether be NFS_DELEGATION_EXTENT (extension is authorized), if extending read authority without parent directory, sends long-range CLOSE requests, Long-range closing Files step is performed, if holding the extension read authority of parent directory, the reference meter of directory-extension read authority is reduced Count, the File Open structure of this document is removed and discharged from the opening file table of process, when drawing for parent directory extension read authority When being kept to 0 with counting, whether there is NFS_DELEGATION_ in the flags (identification field) for judging the directory-extension read authority RECALL (authorizing readjustment) mark, if it is, the mandate is returned into server, the extension for otherwise continuing to hold the catalogue is read Authorize.
The readjustment process of the extension read authority of catalogue is, when other clients send to the file under the catalogue or catalogue During write request, server checks that the fi_delegations of catalogue nfs4_file (File Open structure) (authorizes chain item by item Table) in whether have directory-extension read authority, if then to client send CB_RECALL (readjustment) ask recall the mandate, Hold directory-extension read authority client receive to the CB_RECALL (readjustment) of catalogue request after, the catalogue is set Be NFS_DELEGATION_RECALL (authorize readjustment) marks, will nfs_inode (inode structures) point to The flags (identification field) of delegation (Authorized Domain) is set to NFS_DELEGATION_RECALL (authorizing readjustment) mark, when When there is no file to quote the extension read authority of the catalogue, i.e. nfs_inode->delegation->Ref (read by directory-extension The count value of mandate) for 0 when, send RETURN_DELEGATION (return authorize) requests to server and return to the mandate, service Device finds from the fi_delegations (mandate chained list) of the nfs4_file (File Open structure) of catalogue and deletes the extension Read authority, when chained list is space-time, deltree corresponding nfs4_file (File Open structure), client release nfs_inode Nfs_delegations (authorization structure) in (inode structures).
Present invention additionally comprises such as lower module:
Authorization module, sends for the user end to server and reads the catalog request, and the server is read according to directory-extension Licensing scheme authorizes the extension read authority of the client to the catalogue, and directory information, the extension read authority are sent into this The directory information is stored in local read buffer by client, the client;The step of directory-extension read authority mechanism, is as follows:Judge Whether the client in addition to the client is awarded by the writing for file under mandate or the catalogue of writing that the server authorizes the catalogue Power, if it is, extending read authority failure signal, the otherwise service to the client Returning catalogue for applying for the extension read authority Authorize the extension read authority for applying for the client of the extension read authority catalogue in device end.
File module is opened, the mesh of this document is set up for the directory information of the client in the local read buffer The inode structures of record item structure and this document, and by the opening of the directory entry structure, the inode structures and this document Structure connection, while increase the extension read authority, the directory entry structure, the reference count of the inode structures, by this document Unclosing structure is added in process opening file table;
File module is closed, based on reducing the extension read authority, the directory entry structure, the reference of the inode structures Number, and this document Unclosing structure under the catalogue in process opening file table is removed and discharged.
Callback module is authorized, the module reclaims the extension read authority for the server, as the visitor in addition to the client When family end sends write request to this document under the catalogue or the catalogue to the server, the server is read to the extension is held The client for authorizing sends " readjustment " and asks, and the client for holding the extension read authority marks the extension read authority to be " recalling ", when the reference count of the extension read authority is kept to 0, the server is returned to by the extension read authority.
The directory information includes:The attribute of the All Files under the catalogue under the directory entry information of All Files and the catalogue Information;Domain in the inode structures includes:The creation time of this document, the modification time of this document, the size of this document, The founder of this document, the inode number of this document, the type of this document, the access rights of this document, this document are corresponding Equipment;This document directory entry structure includes:The filename of this document and the inode number of this document.

Claims (10)

1. a kind of method that client based on catalogue mandate is locally opened and closed file, it is characterised in that comprise the following steps:
Authorisation step, the user end to server sends reads the catalog request, and the server is authorized according to catalogue read authority mechanism Directory information, the extension read authority are sent to the client by the client to the extension read authority of the catalogue, the client The directory information is stored in local read buffer;
Open Files step, the directory information of the client in the local read buffer set up the directory entry structure of file with The inode structures of this document, and the directory entry structure, the inode structures are associated with the Unclosing structure of this document, together The Shi Zengjia extension read authorities, the directory entry structure, the reference count of the inode structures, by the addition of this document Unclosing structure In opening file table to process, this document under the catalogue is locally opened to complete the client;
Files step is closed, the step is the inverse process of the opening Files step.
2. the method that the client based on catalogue mandate as claimed in claim 1 is locally opened and closed file, it is characterised in that this is awarded It is as follows the step of the catalogue read authority mechanism in power step:Judge whether the client in addition to the client is awarded by the server The file write under mandate or the catalogue of the catalogue is given to write mandates, if it is, to the client of the application extension read authority End Returning catalogue extension read authority failure signal, otherwise server end authorizes the client mesh for applying for the extension read authority The extension read authority of record.
3. the method that the client based on catalogue mandate as claimed in claim 1 is locally opened and closed file, it is characterised in that this is awarded The directory information includes in power step:The attribute of the All Files under the catalogue under the directory entry information of All Files and the catalogue Information.
4. the method that the client based on catalogue mandate as described in claim 1 or 3 is locally opened and closed file, it is characterised in that Domain in the opening Files step in this document inode structures includes:When the creation time, the modification of this document of this document Between, the founder of the size of this document, this document, the inode number of this document, the type of this document, the access right of this document Limit, the corresponding equipment of this document;Domain in the directory entry structure of this document includes:The filename of this document and the rope of this document Draw node number.
5. the method that the client based on catalogue mandate as claimed in claim 1 is locally opened and closed file, it is characterised in that also wrap Mandate readjustment is included, is comprised the following steps:When the client in addition to the client to the file under the catalogue or the catalogue to When the server sends write request, the server sends " readjustment " and asks to the client for holding the extension read authority, and this is held The client for having the extension read authority marks the extension read authority for " recalling ", when the reference count of the extension read authority is kept to When 0, the extension read authority is returned into the server.
6. the system that a kind of client based on catalogue mandate is locally opened and closed file, it is characterised in that including:
Authorization module, sends for the user end to server and reads the catalog request, and the server is according to catalogue read authority mechanism Extension read authority of the client to the catalogue is authorized, and directory information, the extension read authority are sent to the client, the visitor The directory information is stored in local read buffer by family end;
File module is opened, the directory entry knot of file is set up for the directory information of the client in the local read buffer The inode structures of structure and this document, and the Unclosing structure of the directory entry structure, the inode structures and this document is closed Connection, while increasing the extension read authority, the directory entry structure, the reference count of the inode structures, this document is opened and is tied Structure is added in process opening file table;
Closing file module, the reference count for reducing the extension read authority, the directory entry structure, the inode structures, And this document Unclosing structure under the catalogue in process opening file table is removed and discharged.
7. the system that the client based on catalogue mandate as claimed in claim 6 is locally opened and closed file, it is characterised in that the mesh The step of record read authority mechanism, is as follows:Judge whether the client in addition to the client authorizes writing for the catalogue by the server Authorize or the catalogue under file write mandates, if it is, to the client Returning catalogue expansion for applying for the extension read authority Read authorization failure signal, otherwise the server end is authorized and applies for that the extension of the client of the extension read authority catalogue is read Authorize.
8. the system that the client based on catalogue mandate as claimed in claim 6 is locally opened and closed file, it is characterised in that the mesh Record information includes:The attribute information of the All Files under the catalogue under the directory entry information of All Files and the catalogue.
9. the system that the client based on catalogue mandate as described in claim 6 or 8 is locally opened and closed file, it is characterised in that Domain in the inode structures includes:The creation time of this document, the modification time of this document, the size of this document, this article The founder of part, the inode number of this document, the type of this document, the access rights of this document, the corresponding equipment of this document; This document directory entry structure includes:The filename of this document and the inode number of this document.
10. the system that the client based on catalogue mandate as claimed in claim 6 is locally opened and closed file, it is characterised in that also Including authorizing callback module, the module reclaims the extension read authority for the server, when the client in addition to the client When sending write request to the server to the file under the catalogue or the catalogue, the server is to holding the extension read authority The client sends " readjustment " request, and the client for holding the extension read authority marks the extension read authority for " recalling ", When the reference count of the extension read authority is kept to 0, the extension read authority is returned into the server.
CN201410160168.9A 2014-04-21 2014-04-21 A kind of client based on catalogue mandate is locally opened and closed the method and system of file Expired - Fee Related CN104021137B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410160168.9A CN104021137B (en) 2014-04-21 2014-04-21 A kind of client based on catalogue mandate is locally opened and closed the method and system of file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410160168.9A CN104021137B (en) 2014-04-21 2014-04-21 A kind of client based on catalogue mandate is locally opened and closed the method and system of file

Publications (2)

Publication Number Publication Date
CN104021137A CN104021137A (en) 2014-09-03
CN104021137B true CN104021137B (en) 2017-06-09

Family

ID=51437892

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410160168.9A Expired - Fee Related CN104021137B (en) 2014-04-21 2014-04-21 A kind of client based on catalogue mandate is locally opened and closed the method and system of file

Country Status (1)

Country Link
CN (1) CN104021137B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106897440B (en) * 2017-02-28 2020-06-26 郑州云海信息技术有限公司 File read-write processing method for distributed file system
CN108717420B (en) * 2018-04-20 2022-04-15 北京鲸鲨软件科技有限公司 Method for improving small file reading efficiency in distributed file system
CN109408474B (en) * 2018-11-09 2021-11-19 郑州云海信息技术有限公司 File creation method and client
CN111046001B (en) * 2019-12-28 2023-03-14 浪潮电子信息产业股份有限公司 Method, device and equipment for creating files in batch and storage medium
CN112948844A (en) * 2021-01-28 2021-06-11 维沃移动通信有限公司 Control method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102158546A (en) * 2011-02-28 2011-08-17 中国科学院计算技术研究所 Cluster file system and file service method thereof
CN102332016A (en) * 2010-09-17 2012-01-25 微软公司 Catalogue chance lock
CN103065100A (en) * 2012-12-26 2013-04-24 中国人民解放军总参谋部第六十一研究所 Container-based method of users to protect private data
CN103179185A (en) * 2012-12-25 2013-06-26 中国科学院计算技术研究所 Method and system for creating files in cache of distributed file system client

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102332016A (en) * 2010-09-17 2012-01-25 微软公司 Catalogue chance lock
CN102158546A (en) * 2011-02-28 2011-08-17 中国科学院计算技术研究所 Cluster file system and file service method thereof
CN103179185A (en) * 2012-12-25 2013-06-26 中国科学院计算技术研究所 Method and system for creating files in cache of distributed file system client
CN103065100A (en) * 2012-12-26 2013-04-24 中国人民解放军总参谋部第六十一研究所 Container-based method of users to protect private data

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
蓝鲸分布式文件系统数据一致性语义研究;范勇;《中国优秀硕士学位论文全文数据库》;20061015(第2006年10期);全文 *

Also Published As

Publication number Publication date
CN104021137A (en) 2014-09-03

Similar Documents

Publication Publication Date Title
CN103179185B (en) Method and system for creating files in cache of distributed file system client
US20220321927A1 (en) Providing access to managed content
Chandrasekar et al. A novel indexing scheme for efficient handling of small files in hadoop distributed file system
CN100530186C (en) Method and system for processing buffer
CN104021137B (en) A kind of client based on catalogue mandate is locally opened and closed the method and system of file
US8341118B2 (en) Method and system for dynamically replicating data within a distributed storage system
US8224804B2 (en) Indexing of partitioned external data sources
CN102789470B (en) The method and apparatus of the picture in loading webpage
US8078686B2 (en) High performance file fragment cache
CN104765840B (en) A kind of method and apparatus of big data distributed storage
CN106506587A (en) A kind of Docker image download methods based on distributed storage
CN105183839A (en) Hadoop-based storage optimizing method for small file hierachical indexing
WO2010072083A1 (en) Web application based database system and data management method therof
CN104794190B (en) The method and apparatus that a kind of big data effectively stores
CN104753966A (en) Resource file inquiry method and system based on server and client caches
CN109240946A (en) The multi-level buffer method and terminal device of data
CN107679420A (en) A kind of authority setting method and system based on distributed file system
CN105138275B (en) A kind of Lustre memory system datas sharing method
CN102984256B (en) Processing method and system for metadata based on authorization manner
CN109767274B (en) Method and system for carrying out associated storage on massive invoice data
CN109558378A (en) File management method, device, equipment and storage medium
CN104079600B (en) File memory method, device, access client and meta data server system
Mealha et al. Data replication on the cloud/edge
US10387384B1 (en) Method and system for semantic metadata compression in a two-tier storage system using copy-on-write
CN106372109A (en) Internet resource file caching method and apparatus

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170609

CF01 Termination of patent right due to non-payment of annual fee