CN103473277A - Snapshot method and device for file systems - Google Patents

Snapshot method and device for file systems Download PDF

Info

Publication number
CN103473277A
CN103473277A CN2013103788943A CN201310378894A CN103473277A CN 103473277 A CN103473277 A CN 103473277A CN 2013103788943 A CN2013103788943 A CN 2013103788943A CN 201310378894 A CN201310378894 A CN 201310378894A CN 103473277 A CN103473277 A CN 103473277A
Authority
CN
China
Prior art keywords
snapshot
metadata
pointer
indexing
catalogue
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
CN2013103788943A
Other languages
Chinese (zh)
Other versions
CN103473277B (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.)
Zhejiang Haining Warp Knitting Industrial Park Development Co., Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310378894.3A priority Critical patent/CN103473277B/en
Publication of CN103473277A publication Critical patent/CN103473277A/en
Application granted granted Critical
Publication of CN103473277B publication Critical patent/CN103473277B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a snapshot method and device for file systems, relates to the technical field of computers, and solves the problems that time for snapshot creation is increased and a great deal of storage space is occupied during the snapshot creation in the prior art. The snapshot method includes: determining a catalog of a snapshot to be created; creating a snapshot index in metadata of the catalog. The snapshot index comprises a snapshot logo, a snapshot timestamp and a snapshot change list, wherein the snapshot logo refers to a logo of the created snapshot index, the snapshot timestamp refers to system time of created snapshot index, and the snapshot change list includes a new list and a deletion list. The snapshot method is adapted to the snapshot processing of the file systems.

Description

The Snapshot Method of file system and device
Technical field
The present invention relates to field of computer technology, relate in particular to a kind of Snapshot Method and device of file system.
Background technology
Along with the widespread use of computer technology in every field, quantity of information increases rapidly, and the production of enterprise and individual's life progressively strengthens the dependence of computer data.Therefore, in order to realize on-line storage and to take precautions against the loss of data, snapping technique arises at the historic moment.
Current snapping technique roughly can be divided into two classes, cuts apart mirror image (Split Mirror) and copy-on-write (Copy-On-Write, COW).Wherein, cut apart the mirror snapshot technology before the snapshot time point arrives, create and safeguard a complete mirrored volume for the source data volume.When the snapshot time point arrives, mirror image operation is stopped, and mirrored volume is converted into snapped volume, obtains a data snapshot.Snapped volume, after completing the application such as data backup, will be rolled up re-synchronization with source data, again become mirrored volume.Source data volume for will retain a plurality of time point snapshots simultaneously, must create a plurality of mirrored volume for it in advance.The copy-on-write snapping technique need to be reserved some storage spaces, sets up snapped volume.When we are that after a source data volume creates a snapshot, these reserved storage spaces are used for storing the legacy data that is updated the source data volume.Copy-on-write impinges upon soon in initialized process and only creates the pointer information (metadata) that is used for describing source data volume position, rather than complete source data volume copy is come.
In the process of the snapshot of realizing file system, the inventor finds that in prior art, at least there are the following problems: for cutting apart the mirror snapshot technology, be pre-created mirrored volume and taken a large amount of storage resources, cause the waste of resource.For the copy-on-write snapping technique, need replication meta when creating snapshot, increase the time that creates snapshot, and take a large amount of storage spaces.
Summary of the invention
Embodiments of the invention provide a kind of Snapshot Method and device of file system, have shortened and have created the time of snapshot, and saved the storage space that snapshot takies.
For achieving the above object, embodiments of the invention adopt following technical scheme:
First aspect, the invention provides a kind of Snapshot Method of file system, comprising:
Determine the catalogue of snapshot to be created;
Create snapshot indexing in the metadata of described catalogue; Described snapshot indexing comprises that snapshot sign, snapshot timestamp and snapshot change list; Wherein, described snapshot is designated the sign of the described snapshot indexing of described directory creating; The system time that described snapshot timestamp is the described snapshot indexing of described directory creating; Described snapshot changes list and comprises newly-built list and delete list, after described newly-built list comprises the described snapshot indexing of establishment, and the pointer of the metadata of new files and amended file in described catalogue; After described delete list comprises the described snapshot indexing of described directory creating, deleted file and the pointer of metadata that is modified the source document of file in described catalogue.
In the first of first aspect, in possible implementation, the described snapshot indexing that creates in the metadata of described catalogue comprises:
Whether created snapshot according to the snapshot determined property in the metadata of described catalogue, described snapshot attribute is used to indicate described catalogue and whether has created snapshot;
When described snapshot attribute indication does not create snapshot, add described snapshot indexing in the metadata of described catalogue, snapshot in described snapshot indexing sign is set to predetermined value, and is that described snapshot indexing distributes forwarding pointer and backwarding pointer, described forwarding pointer and backwarding pointer all are made as to sky; Wherein, described forwarding pointer is used in reference to in the metadata of described catalogue, the backwarding pointer of the previous snapshot indexing of described catalogue; Described backwarding pointer is used in reference to in the metadata of described catalogue, the forwarding pointer of the next snapshot indexing of described catalogue;
When described snapshot attribute indication has created snapshot, add described snapshot indexing in the metadata of described catalogue, and the forwarding pointer of described snapshot indexing is pointed to the backwarding pointer of previous snapshot indexing, the backwarding pointer of described previous snapshot indexing is pointed to the forwarding pointer of described snapshot indexing.
The possible implementation in conjunction with the first of first aspect, at the second, in possible implementation, create snapshot indexing in the metadata of described catalogue after, described method also comprises:
According at least one in snapshot sign and snapshot timestamp, search snapshot indexing to be deleted in the metadata of described catalogue;
Whether the forwarding pointer and the backwarding pointer that judge described snapshot indexing to be deleted are sky;
When the forwarding pointer of described snapshot indexing to be deleted and backwarding pointer are sky, described snapshot indexing to be deleted is deleted;
When the forwarding pointer of described snapshot indexing to be deleted is empty, and when the backwarding pointer of described snapshot indexing to be deleted is not empty, the snapshot of described snapshot indexing to be deleted is changed to the snapshot that list deposits next snapshot indexing in to be changed in list, and described snapshot indexing to be deleted is deleted, wherein, the forwarding pointer of described next snapshot indexing is made as sky;
When the backwarding pointer of described snapshot indexing to be deleted is empty, the forwarding pointer of described snapshot indexing to be deleted is not empty, perhaps when the forwarding pointer of described snapshot indexing to be deleted and backwarding pointer while not being all empty, the snapshot of described snapshot indexing to be deleted is changed to the snapshot that list deposits previous snapshot indexing in to be changed in list, and described snapshot indexing to be deleted is deleted, wherein, the backwarding pointer of described previous snapshot indexing points to the forwarding pointer of the next snapshot indexing of described snapshot indexing to be deleted, the forwarding pointer of described next snapshot indexing points to the backwarding pointer of described previous snapshot indexing.
In the third possible implementation of first aspect, create snapshot indexing in the metadata of described catalogue after, described method also comprises:
Obtain file pending under described catalogue, and to the operation of described pending file;
According to described operation, the snapshot upgraded in the snapshot indexing created in the metadata of described catalogue changes list.
The third possible implementation in conjunction with first aspect, in the 4th kind of possible implementation, when described to described pending file be operating as under described catalogue new files the time, described according to described operation, the snapshot variation list of upgrading in the snapshot indexing created in the metadata of described catalogue comprises:
The pointer of the metadata of described pending file is deposited in the newly-built list of last snapshot indexing in the metadata of described catalogue.
The third possible implementation in conjunction with first aspect, in the 5th kind of possible implementation, when described to described pending file be operating as the file of revising under described catalogue the time, described according to described operation, the snapshot variation list of upgrading in the snapshot indexing created in the metadata of described catalogue comprises:
Whether the pointer that judges the metadata of described pending file is present in the newly-built list of snapshot indexing in the metadata of described catalogue;
In the time of in being present in described newly-built list, according to the modification to described pending file, revise the metadata of described pending file;
In the time of in not being present in described newly-built list, by described pending file copy to the first storage area, the metadata replication of described pending file is to the second storage area, and the pointer of the metadata of described pending file is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, the pointer of the metadata of amended file is deposited in the newly-built list of described last snapshot indexing.
The third possible implementation in conjunction with first aspect, in the 6th kind of possible implementation, when described to described pending file be operating as the metadata of revising the file under described catalogue the time, described according to described operation, the snapshot variation list of upgrading in the snapshot indexing created in the metadata of described catalogue comprises:
Whether the pointer that judges the metadata of described pending file is present in the newly-built list of snapshot indexing in the metadata of described catalogue;
When being present in described newly-built list, revise the metadata of described pending file;
When not being present in described newly-built list, metadata replication to the three storage areas by described pending file, the pointer of the metadata of described pending file is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, the pointer of the metadata of file after revising is deposited in the newly-built list of described last snapshot indexing.
The third possible implementation in conjunction with first aspect, in the 7th kind of possible implementation, when described to described pending file be operating as the file of deleting under described catalogue the time, described according to described operation, the snapshot variation list of upgrading in the snapshot indexing created in the metadata of described catalogue comprises:
Whether the pointer that judges the metadata of described pending file is present in the newly-built list of snapshot indexing in the metadata of described catalogue;
When being present in described newly-built list, delete the pointer of the metadata of file pending described in described newly-built list;
When not being present in described newly-built list, delete the object pointer in the metadata of described catalogue, by described pending file copy to the four storage areas, and the pointer of the metadata after described pending file copy is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, point to the pointer of the metadata of described pending file in the metadata that described object pointer is described catalogue.
Second aspect, the invention provides a kind of fast photographing device of file system, comprising:
Determining unit, for determining the catalogue of snapshot to be created;
Creating unit, create snapshot indexing for the metadata in described catalogue; Described snapshot indexing comprises that snapshot sign, snapshot timestamp and snapshot change list; Wherein, described snapshot is designated the sign of the described snapshot indexing of described directory creating; The system time that described snapshot timestamp is the described snapshot indexing of described directory creating; Described snapshot changes list and comprises newly-built list and delete list, after described newly-built list comprises the described snapshot indexing of establishment, and the pointer of the metadata of new files and amended file in described catalogue; After described delete list comprises the described snapshot indexing of described directory creating, deleted file and the pointer of metadata that is modified the source document of file in described catalogue.
In the first of second aspect, in possible implementation, described creating unit comprises:
Whether judge module, created snapshot for the snapshot determined property of the metadata according to described catalogue, and described snapshot attribute is used to indicate described catalogue and whether has created snapshot;
The first creation module, for when described snapshot attribute indication does not create snapshot, add described snapshot indexing in the metadata of described catalogue, snapshot in described snapshot indexing sign is set to predetermined value, and be that described snapshot indexing distributes forwarding pointer and backwarding pointer, described forwarding pointer and backwarding pointer all are made as to sky; Wherein, described forwarding pointer is used in reference to in the metadata of described catalogue, the backwarding pointer of the previous snapshot indexing of described catalogue; Described backwarding pointer is used in reference to in the metadata of described catalogue, the forwarding pointer of the next snapshot indexing of described catalogue;
The second creation module, for when described snapshot attribute indication has created snapshot, add described snapshot indexing in the metadata of described catalogue, and the forwarding pointer of described snapshot indexing is pointed to the backwarding pointer of previous snapshot indexing, the backwarding pointer of described previous snapshot indexing is pointed to the forwarding pointer of described snapshot indexing.
The possible implementation in conjunction with the first of second aspect, at the second, in possible implementation, described device also comprises:
Search unit, for according at least one of snapshot sign and snapshot timestamp, search snapshot indexing to be deleted in the metadata of described catalogue;
Whether judging unit, be sky for forwarding pointer and the backwarding pointer that judges described snapshot indexing to be deleted;
Delete cells, while for the forwarding pointer when described snapshot indexing to be deleted and backwarding pointer, being sky, delete described snapshot indexing to be deleted;
The first processing unit, for the forwarding pointer when described snapshot indexing to be deleted, it be sky, and when the backwarding pointer of described snapshot indexing to be deleted is not empty, the snapshot of described snapshot indexing to be deleted is changed to the snapshot that list deposits next snapshot indexing in to be changed in list, and described snapshot indexing to be deleted is deleted, wherein, the forwarding pointer of described next snapshot indexing is made as sky;
The second processing unit, for the backwarding pointer when described snapshot indexing to be deleted, it be sky, the forwarding pointer of described snapshot indexing to be deleted is not empty, perhaps when the forwarding pointer of described snapshot indexing to be deleted and backwarding pointer while not being all empty, the snapshot of described snapshot indexing to be deleted is changed to the snapshot that list deposits previous snapshot indexing in to be changed in list, and described snapshot indexing to be deleted is deleted, wherein, the backwarding pointer of described previous snapshot indexing points to the forwarding pointer of the next snapshot indexing of described snapshot indexing to be deleted, the forwarding pointer of described next snapshot indexing points to the backwarding pointer of described previous snapshot indexing.
In the third possible implementation of second aspect, described device also comprises:
Acquiring unit, for obtaining file pending under described catalogue, and to the operation of described pending file;
Updating block, for according to described operation, upgrade the snapshot variation list in the snapshot indexing created in the metadata of described catalogue.
In conjunction with the third possible implementation of second aspect, in the 4th kind of possible implementation, when described acquiring unit get to described pending file be operating as under described catalogue new files the time, described updating block comprises:
The first processing module, deposit in for the pointer of the metadata by described pending file in the newly-built list of last snapshot indexing of metadata of described catalogue.
In conjunction with the third possible implementation of second aspect, in the 5th kind of possible implementation, when described acquiring unit get to described pending file be operating as the file of revising under described catalogue the time, described updating block comprises:
Whether judge module, be present in for the pointer of the metadata that judges described pending file in the newly-built list of metadata snapshot indexing of described catalogue;
The first modified module, for when being present in described newly-built list, according to the modification to described pending file, revise the metadata of described pending file;
The second processing module, for when not being present in described newly-built list, by described pending file copy to the first storage area, the metadata replication of described pending file is to the second storage area, and the pointer of the metadata of described pending file is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, the pointer of the metadata of amended file is deposited in the newly-built list of described last snapshot indexing.
In conjunction with the third possible implementation of second aspect, in the 6th kind of possible implementation, when described acquiring unit get to described pending file be operating as the metadata of revising the file under described catalogue the time, described updating block comprises:
Whether described judge module, also be present in the newly-built list of metadata snapshot indexing of described catalogue for the pointer of the metadata that judges described pending file;
The second modified module, for when being present in described newly-built list, revise the metadata of described pending file;
The 3rd processing module, for when not being present in described newly-built list, metadata replication to the three storage areas by described pending file, the pointer of the metadata of described pending file deposits in the delete list of last snapshot indexing in the metadata of described catalogue, the pointer of the metadata of described amended file is deposited in the newly-built list of described last snapshot indexing.
In conjunction with the third possible implementation of second aspect, in the 7th kind of possible implementation, when described acquiring unit get to described pending file be operating as the file of deleting under described catalogue the time, described updating block comprises:
Whether described judge module, also be present in the newly-built list of metadata snapshot indexing of described catalogue for the pointer of the metadata that judges described pending file;
Removing module, for when being present in described newly-built list, delete the pointer of the metadata of file pending described in described newly-built list;
Manages module everywhere, for when not being present in described newly-built list, delete the object pointer in the metadata of described catalogue, by described pending file copy to the four storage areas, and the pointer of the metadata after described pending file copy is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, point to the pointer of the metadata of described pending file in the metadata that described object pointer is described catalogue.
The embodiment of the present invention provides a kind of Snapshot Method and device of file system, by determining the catalogue of snapshot to be created, then in the metadata of described catalogue, creates snapshot indexing; Described snapshot indexing comprises that snapshot sign, snapshot timestamp and snapshot change list; Wherein, described snapshot is designated the sign of the described snapshot indexing of described directory creating; The system time that described snapshot timestamp is the described snapshot indexing of described directory creating; Described snapshot changes list and comprises newly-built list and delete list.The embodiment of the present invention has solved in prior art while creating snapshot, increases the time that creates snapshot, and the problem that takies a large amount of storage spaces, has shortened and has created the time of snapshot, and saved the storage space that snapshot takies.
The accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme of the embodiment of the present invention, below will the accompanying drawing of required use in the embodiment of the present invention be briefly described, apparently, below described accompanying drawing be only some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain according to these accompanying drawings other accompanying drawing.
The process flow diagram of the Snapshot Method of a kind of file system that Fig. 1 provides for the embodiment of the present invention;
The process flow diagram of step 102 in the Snapshot Method of a kind of file system that Fig. 2 provides for the embodiment of the present invention;
The schematic diagram of the snapshot indexing that Fig. 3 provides for the embodiment of the present invention;
The schematic diagram of 3 snapshot indexings that Fig. 4 provides for the embodiment of the present invention;
Delete the process flow diagram of snapshot indexing in the Snapshot Method of a kind of file system that Fig. 5 provides for the embodiment of the present invention;
Process the process flow diagram that creates the file in the snapshot catalogue in the Snapshot Method of a kind of file system that Fig. 6 provides for the embodiment of the present invention;
The process flow diagram of the Snapshot Method of a kind of file system that Fig. 7 provides for the embodiment of the present invention;
The structural drawing of the fast photographing device of a kind of file system that Fig. 8 provides for the embodiment of the present invention;
The structural drawing of the fast photographing device of the another kind of file system that Fig. 9 provides for the embodiment of the present invention;
The structural drawing of the fast photographing device of another file system that Figure 10 provides for the embodiment of the present invention;
The structural drawing of the fast photographing device of another file system again that Figure 11 provides for the embodiment of the present invention;
A kind of structural drawing of updating block in the fast photographing device of the file system that Figure 12 provides for the embodiment of the present invention;
The structural drawing of another kind of updating block in the fast photographing device of the file system that Figure 13 provides for the embodiment of the present invention;
The structural drawing of another updating block in the fast photographing device of the file system that Figure 14 provides for the embodiment of the present invention;
The structural drawing of another updating block again in the fast photographing device of the file system that Figure 15 provides for the embodiment of the present invention;
The hardware structure diagram of the fast photographing device of a kind of file system that Figure 16 provides for the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making under the creative work prerequisite the every other embodiment obtained, belong to the scope of protection of the invention.
The embodiment of the present invention, for the snapshot of file system, provides a kind of Snapshot Method of file system, and the present embodiment executive agent is terminal, and as shown in Figure 1, described method comprises:
101, determine the catalogue of snapshot to be created.
Wherein, the catalogue of described snapshot to be created can comprise sub-directory and son file.
102, create snapshot indexing in the metadata of described catalogue; Described snapshot indexing comprises that snapshot sign, snapshot timestamp and snapshot change list; Wherein, described snapshot is designated the sign of the described snapshot indexing of described directory creating; The system time that described snapshot timestamp is the described snapshot indexing of described directory creating; Described snapshot changes list and comprises newly-built list and delete list, after described newly-built list comprises the described snapshot indexing of establishment, and the pointer of the metadata of new files and amended file in described catalogue; After described delete list comprises the described snapshot indexing of described directory creating, deleted file and the pointer of metadata that is modified the source document of file in described catalogue.
Catalogue for creating snapshot creates snapshot indexing in the metadata of described catalogue, and described snapshot indexing comprises that snapshot sign, snapshot timestamp and snapshot change list.
Wherein, described snapshot is designated the sign of the described snapshot indexing of described directory creating, when described snapshot attribute indication does not create snapshot, when described catalogue creates snapshot for the first time, snapshot in described snapshot indexing sign is set to predetermined value, for example described snapshot sign is made as to 1; When described snapshot attribute indication has created snapshot, the snapshot sign according to previous snapshot indexing in the metadata of described catalogue, be set to the snapshot of described snapshot indexing sign to increase progressively integer.
Wherein, the pointer of the metadata of new files and amended file in described catalogue, refer to the store path of the metadata of new files in described catalogue and amended file; Deleted file and the pointer of metadata that is modified the source document of file in described catalogue, refer in described catalogue deleted file and be modified file source document metadata store path.
Wherein, the effect of newly-built list is for after the described snapshot indexing of described directory creating, when the file in described target has renewal, can real time record get off, in order to follow-up recovery data.The effect of described delete list is for after the described snapshot indexing of described directory creating, and deletion or amended file can preserve, in order to follow-up recovery data.
The embodiment of the present invention provides a kind of Snapshot Method of file system, by determining the catalogue of snapshot to be created, then in the metadata of described catalogue, creates snapshot indexing, and described snapshot indexing comprises that snapshot sign, snapshot timestamp and snapshot change list.The embodiment of the present invention has solved in prior art while creating snapshot, increases the time that creates snapshot, and the problem that takies a large amount of storage spaces, has shortened and has created the time of snapshot, and saved the storage space that snapshot takies.
Also there is the snapshot attribute in the metadata of described catalogue, be used to indicate described catalogue and whether created snapshot, for the catalogue that creates snapshot, snapshot attribute-bit in the metadata of described catalogue is for creating snapshot, for also not creating the catalogue of snapshot, the snapshot attribute-bit in the metadata of described catalogue is not for creating snapshot, as shown in Figure 2, in above-mentioned steps 102, create snapshot indexing and also comprise in the metadata of described catalogue:
201, whether created snapshot according to the snapshot determined property in the metadata of described catalogue, described snapshot attribute is used to indicate described catalogue and whether has created snapshot;
202, when described snapshot attribute indication does not create snapshot, add described snapshot indexing in the metadata of described catalogue, snapshot in described snapshot indexing sign is set to predetermined value, for example described snapshot sign is made as to 1, and be that described snapshot indexing distributes forwarding pointer and backwarding pointer, described forwarding pointer and backwarding pointer all are made as to sky; Wherein, described forwarding pointer is used in reference to in the metadata of described catalogue, the backwarding pointer of the previous snapshot indexing of described catalogue; Described backwarding pointer is used in reference to in the metadata of described catalogue, the forwarding pointer of the next snapshot indexing of described catalogue.
As shown in Figure 3.Wherein, described forwarding pointer is used in reference to in the metadata of described catalogue, the backwarding pointer of the previous snapshot indexing of described catalogue, and described backwarding pointer is used in reference to in the metadata of described catalogue, the forwarding pointer of the next snapshot indexing of described catalogue.
203, when described snapshot attribute indication has created snapshot, add described snapshot indexing in the metadata of described catalogue, and the forwarding pointer of described snapshot indexing is pointed to the backwarding pointer of previous snapshot indexing, the backwarding pointer of described previous snapshot indexing is pointed to the forwarding pointer of described snapshot indexing.
Wherein, the snapshot sign according to the previous snapshot indexing in the metadata of described catalogue, be set to the sign of the snapshot in described snapshot indexing to increase progressively integer.For example, the snapshot of described previous snapshot indexing is designated at 2 o'clock, the snapshot in described snapshot indexing is designated 3, and by the backwarding pointer of the described previous snapshot indexing of the forwarding pointer of described snapshot indexing sensing, and the backwarding pointer of described previous snapshot indexing points to the forwarding pointer of described snapshot indexing, as shown in Figure 4.
Optionally, for the catalogue that creates snapshot, also there is the deletion to snapshot, delete the snapshot indexing of described catalogue, as shown in Figure 5, comprise the steps:
501, according at least one in snapshot sign and snapshot timestamp, search snapshot indexing to be deleted in the metadata of described catalogue.
Because the snapshot of described snapshot indexing sign and snapshot timestamp are all the unique identifications of described snapshot indexing, by snapshot identify with the snapshot timestamp at least one, search snapshot indexing to be deleted in the metadata of described catalogue.
Whether the forwarding pointer and the backwarding pointer that 502, judge described snapshot indexing to be deleted are sky.
Known by Fig. 3 and Fig. 4, when unique snapshot indexing that described snapshot indexing is described catalogue, its forwarding pointer and backwarding pointer are sky, when described snapshot indexing is not unique snapshot indexing of described catalogue, has a pointer in the forwarding pointer of described snapshot indexing and backwarding pointer at least not for empty, therefore, judge forwarding pointer and the backwarding pointer of described snapshot indexing to be deleted, determine the processing to described snapshot indexing.
503, when the forwarding pointer of described snapshot indexing to be deleted and backwarding pointer are sky, described snapshot indexing to be deleted is deleted.
When the forwarding pointer of described snapshot indexing and backwarding pointer are sky, unique snapshot indexing that described snapshot indexing is described catalogue is described, directly described snapshot indexing is deleted.
504, the forwarding pointer when described snapshot indexing to be deleted is empty, and when the backwarding pointer of described snapshot indexing to be deleted is not empty, the snapshot of described snapshot indexing to be deleted is changed to the snapshot that list deposits next snapshot indexing in to be changed in list, and described snapshot indexing to be deleted is deleted, wherein, the forwarding pointer of described next snapshot indexing is made as sky.
When the forwarding pointer of described snapshot indexing to be deleted is empty, and when the backwarding pointer of described snapshot indexing to be deleted is not empty, first snapshot indexing that described snapshot indexing is described catalogue, the snapshot of described snapshot indexing to be deleted is changed to the snapshot that list deposits next snapshot indexing in to be changed in list, so that recover the state of described catalogue when first snapshot indexing in the future, then will described snapshot indexing to be deleted deletion.Wherein, after described snapshot indexing to be deleted is deleted, first snapshot indexing that described next snapshot indexing is described catalogue, the forwarding pointer of described next snapshot indexing is made as to sky.
Here be stressed that, described first snapshot indexing and snapshot are designated 1 snapshot indexing might not be identical, exists snapshot to be designated 1 snapshot indexing deleted, and first snapshot indexing is the situation that snapshot is designated 2 snapshot indexing at present.
505, when the backwarding pointer of described snapshot indexing to be deleted is empty, the forwarding pointer of described snapshot indexing to be deleted is not empty, perhaps when the forwarding pointer of described snapshot indexing to be deleted and backwarding pointer while not being all empty, the snapshot of described snapshot indexing to be deleted is changed to the snapshot that list deposits previous snapshot indexing in to be changed in list, and described snapshot indexing to be deleted is deleted, wherein, the backwarding pointer of described previous snapshot indexing points to the forwarding pointer of the next snapshot indexing of described snapshot indexing to be deleted, the forwarding pointer of described next snapshot indexing points to the backwarding pointer of described previous snapshot indexing.
For example,, shown in Fig. 4, when the backwarding pointer of described snapshot indexing to be deleted is empty, the forwarding pointer of described snapshot indexing to be deleted is not empty, for snapshot indexing 3, when the forwarding pointer of described snapshot indexing to be deleted and backwarding pointer, while not being all empty, be snapshot indexing 2.When described snapshot indexing to be deleted is snapshot indexing 3, the snapshot that the snapshot of described snapshot indexing 3 variation list is deposited in to snapshot indexing 2 changes in list, the snapshot that state in the time of will recovering described catalogue so that follow-up and be snapshot indexing 2 will be used in snapshot indexing 3 changes the content in list, and the backwarding pointer of described snapshot indexing 2 is made as to sky.When described snapshot indexing to be deleted is snapshot indexing 2, the snapshot that the snapshot of snapshot indexing 2 variation list is deposited in to snapshot indexing 1 changes in list, so that the content of the snapshot of the state when recovering described catalogue and be snapshot indexing 1 in will using snapshot indexing 2 in changing list in the future, and the backwarding pointer of snapshot indexing 1 is pointed to the forwarding pointer of snapshot indexing 3.
Optionally, as shown in Figure 6, create snapshot indexing in the metadata of described catalogue after, also comprise the record that described catalogue File is changed, comprising:
601, obtain file pending under described catalogue, and to the operation of described pending file;
602,, according to described operation, the snapshot upgraded in the snapshot indexing created in the metadata of described catalogue changes list.
Due to after at every turn to described directory creating snapshot, changing all may appear in the file in described catalogue, therefore, the variation that need in the snapshot indexing when inferior, record file under described catalogue, for example, after first snapshot indexing of described directory creating, the change records of described catalogue File is in the snapshot of described first snapshot indexing changes list, after second snapshot indexing of described directory creating, the change records of described catalogue File changes in list at the snapshot of described second snapshot indexing, the like.There are three kinds of situations in above-mentioned variation: new files, revised file and deleted file, described file can or be specific file, for example a file for a document.
The first situation: when described to described pending file be operating as under described catalogue newly-built described file the time, step 602 item is that the pointer of the metadata of described pending file is deposited in the newly-built list of last snapshot indexing in the metadata of described catalogue.
Modification to file in the second situation comprises two parts, is respectively the metadata of revised file and revised file.When described to described pending file be operating as the file of revising under described catalogue the time, step 602, described according to described operation, upgrade snapshot in the snapshot indexing created in the metadata of described catalogue and change list and comprise:
Whether the pointer that judges the metadata of described pending file is present in the newly-built list of snapshot indexing in the metadata of described catalogue;
In the time of in being present in described newly-built list, according to the modification to described pending file, revise the metadata of described pending file;
In the time of in not being present in described newly-built list, by described pending file copy to the first storage area, the metadata replication of described pending file is to the second storage area, and the pointer of the metadata of described pending file is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, the pointer of the metadata of amended file is deposited in the newly-built list of described last snapshot indexing.
Wherein, when the pointer of the metadata of described file is present in the newly-built list of snapshot indexing in the metadata of described catalogue, mean that described file is this described directory creating snapshot indexing newly-built file afterwards, according to the modification to described file, revises the metadata of described file.For example, after described file is modified, the modification time of described file changes, and the modification time in the metadata of described file is upgraded.
When the pointer of the metadata of described file is not present in the newly-built list of snapshot indexing in the metadata of described catalogue, mean that described file is before the described snapshot indexing of this described directory creating just Already in described catalogue, before revising, described file copy is to the first storage area, before described modification, the metadata replication of described file is to the second storage area, and the pointer of the metadata of described file before described modification is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, after revising, the pointer of the metadata of described file deposits in the newly-built list of described last snapshot indexing.
In the second situation, when described to described pending file be operating as the metadata of revising the file under described catalogue the time, step 602, described according to described operation, upgrade snapshot in the snapshot indexing created in the metadata of described catalogue and change list and comprise:
Whether the pointer that judges the metadata of described pending file is present in the newly-built list of snapshot indexing in the metadata of described catalogue;
When being present in described newly-built list, revise the metadata of described pending file;
When not being present in described newly-built list, metadata replication to the three storage areas by described pending file, the pointer of the metadata of described pending file is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, the pointer of the metadata of amended file is deposited in the newly-built list of described last snapshot indexing.
Wherein, when the pointer of the metadata of described file is present in the newly-built list of snapshot indexing in the metadata of described catalogue, mean that described file is for newly-built file after this described directory creating snapshot indexing, the direct metadata of the described file of modification.For example, in the time will modifying to the metadata File creation-time of described file, the creation-time in the metadata of described pointed is upgraded.
When the pointer of the metadata of described file is not present in the newly-built list of snapshot indexing in the metadata of described catalogue, mean that described file is before this described directory creating snapshot indexing just Already in described catalogue, by metadata replication to the three storage areas before described file modification, the pointer of the metadata before described file modification deposits in the delete list of described last snapshot indexing, and the pointer of the metadata after described file modification deposits in the newly-built list of described last snapshot indexing.
The third situation, when described to described pending file be operating as the file of deleting under described catalogue the time, step 602, described according to described operation, upgrade snapshot in the snapshot indexing created in the metadata of described catalogue and change list and comprise:
Whether the pointer that judges the metadata of described pending file is present in the newly-built list of snapshot indexing in the metadata of described catalogue;
When being present in described newly-built list, delete the pointer of the metadata of file pending described in described newly-built list;
When not being present in described newly-built list, delete the object pointer in the metadata of described catalogue, by described pending file copy to the four storage areas, and the pointer of the metadata after described pending file copy is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, point to the pointer of the metadata of described pending file in the metadata that described object pointer is described catalogue.
Wherein, when the pointer of the metadata of described file is present in the newly-built list of snapshot indexing in the metadata of described catalogue, mean that described file is for newly-built file after this described directory creating snapshot indexing,, in the metadata of deleting described file and described file, delete the pointer of the metadata of file described in described newly-built list.
When the pointer of the metadata of described file is not present in the newly-built list of snapshot indexing in the metadata of described catalogue, mean that described file is before this described directory creating snapshot indexing just Already in described catalogue, delete the object pointer in the metadata of described catalogue, described object pointer is to point to the pointer of the metadata of described file in the metadata of described catalogue, then described file copy to the four storage areas before deleting, and the pointer that will copy the metadata of rear described file deposits in the delete list of last snapshot indexing in the metadata of described catalogue.
For those skilled in the art better understand the technical scheme of the Snapshot Method of the file system that the embodiment of the present invention provides, the Snapshot Method below by specific embodiment to file system provided by the invention is elaborated.
The present embodiment be take local file system as example, and as shown in Figure 7, executive agent is terminal, and when client process is initiated snapshot request, a process of file system receives this request, and carries out following steps:
701,, according to described snapshot request, determine the catalogue of snapshot to be created.
Described snapshot request comprises that band creates the catalogue of snapshot.
702, judge that whether the number of times of described directory creating snapshot is over maximal value;
703, when the number of times of described directory creating snapshot surpasses maximal value, show the information that creates the snapshot failure;
704, when the number of times of described directory creating snapshot does not surpass maximal value, in the metadata of described catalogue, create snapshot indexing.
Wherein, the processing procedure of step 704 can, with reference to figure 1 and the described step 102 of Fig. 2, repeat no more herein.
705, show the information that creates the snapshot success.
Local file system also can be deleted the operation of snapshot, and concrete processing procedure shown in Figure 5 repeats no more herein.
After the snapshot indexing of local file system to this described directory creating snapshot, also comprise the operation to file under described catalogue, as newly-built, modification and deleted file, can, with reference to the processing procedure shown in figure 6, repeat no more herein.
The Snapshot Method of above-mentioned file system can also be applied to the Snapshot Method of distributed file system, wherein, distributed file system refers to that the physical store resource of file system management not necessarily directly is connected on local node, but is connected with node by computer network.Wherein, metadata in file system is to manage by meta data server, by the network transmission protocol, message is passed to meta data server by client, carried out the snapshot of file system by meta data server, for example, in the time that snapshot will be created, snapshot request is sent to described meta data server, described meta data server is operated according to the processing procedure shown in Fig. 1, Fig. 2 and Fig. 7, and returns to snapshot creation success or failure to client.Equally, while deleting snapshot indexing, the request message of deleting snapshot indexing is sent to described meta data server, described meta data server is operated according to the processing procedure shown in Fig. 5, and returns to operating result.After the directory creating snapshot, to the operation of file under described catalogue, also can send request to described meta data server, described meta data server is operated according to the processing procedure shown in Fig. 6, and returns to operating result.
Can be when creating snapshot by the embodiment of the present invention, solve in prior art for cutting apart the mirror snapshot technology, be pre-created mirrored volume and taken a large amount of storage resources, cause the problem of the waste of resource, solve in the copy-on-write snapping technique simultaneously, need replication meta when creating snapshot, increase the time that creates snapshot, and the problem that takies a large amount of storage spaces.The embodiment of the present invention, when creating snapshot, need not be pre-created mirrored volume, also without replication meta, has therefore shortened and has created the time of snapshot, and saved the storage space that snapshot takies.
As shown in Figure 8, the embodiment of the present invention provides a kind of fast photographing device 80 of file system, comprises determining unit 801 and creating unit 802.
Wherein, determining unit 801, for determining the catalogue of snapshot to be created;
Creating unit 802, create snapshot indexing for the metadata in described catalogue; Described snapshot indexing comprises that snapshot sign, snapshot timestamp and snapshot change list; Wherein, described snapshot is designated the sign of the described snapshot indexing of described directory creating; The system time that described snapshot timestamp is the described snapshot indexing of described directory creating; Described snapshot changes list and comprises newly-built list and delete list, after described newly-built list comprises the described snapshot indexing of establishment, and the pointer of the metadata of new files and amended file in described catalogue; After described delete list comprises the described snapshot indexing of described directory creating, deleted file and the pointer of metadata that is modified the source document of file in described catalogue.
The embodiment of the present invention provides a kind of fast photographing device of file system, by determining the catalogue of snapshot to be created, then create snapshot indexing in the metadata of described catalogue, wherein, described snapshot indexing comprises that snapshot sign, snapshot timestamp and snapshot change list.The embodiment of the present invention has solved in prior art while creating snapshot, increases the time that creates snapshot, and the problem that takies a large amount of storage spaces, has shortened and has created the time of snapshot, and saved the storage space that snapshot takies.
Optionally, as shown in Figure 9, described creating unit comprises:
Whether judge module 901, created snapshot for the snapshot determined property of the metadata according to described catalogue, and described snapshot attribute is used to indicate described catalogue and whether has created snapshot;
The first creation module 902, for when described snapshot attribute indication does not create snapshot, add described snapshot indexing in the metadata of described catalogue, snapshot in described snapshot indexing sign is set to predetermined value, and be that described snapshot indexing distributes forwarding pointer and backwarding pointer, described forwarding pointer and backwarding pointer all are made as to sky; Wherein, described forwarding pointer is used in reference to in the metadata of described catalogue, the backwarding pointer of the previous snapshot indexing of described catalogue; Described backwarding pointer is used in reference to in the metadata of described catalogue, the forwarding pointer of the next snapshot indexing of described catalogue;
The second creation module 903, for when described snapshot attribute indication has created snapshot, add described snapshot indexing in the metadata of described catalogue, and the forwarding pointer of described snapshot indexing is pointed to the backwarding pointer of previous snapshot indexing, the backwarding pointer of described previous snapshot indexing is pointed to the forwarding pointer of described snapshot indexing.
Optionally, as shown in figure 10, described device also comprises:
Search unit 1001, for according at least one of snapshot sign and snapshot timestamp, search snapshot indexing to be deleted in the metadata of described catalogue;
Whether judging unit 1002, be sky for forwarding pointer and the backwarding pointer that judges described snapshot indexing to be deleted;
Delete cells 1003, while for the forwarding pointer when described snapshot indexing to be deleted and backwarding pointer, being sky, delete described snapshot indexing to be deleted;
The first processing unit 1004, for the forwarding pointer when described snapshot indexing to be deleted, it be sky, and when the backwarding pointer of described snapshot indexing to be deleted is not empty, the snapshot of described snapshot indexing to be deleted is changed to the snapshot that list deposits next snapshot indexing in to be changed in list, and described snapshot indexing to be deleted is deleted, wherein, the forwarding pointer of described next snapshot indexing is made as sky;
The second processing unit 1005, for the backwarding pointer when described snapshot indexing to be deleted, it be sky, the forwarding pointer of described snapshot indexing to be deleted is not empty, perhaps when the forwarding pointer of described snapshot indexing to be deleted and backwarding pointer while not being all empty, the snapshot of described snapshot indexing to be deleted is changed to the snapshot that list deposits previous snapshot indexing in to be changed in list, and described snapshot indexing to be deleted is deleted, wherein, the backwarding pointer of described previous snapshot indexing points to the forwarding pointer of the next snapshot indexing of described snapshot indexing to be deleted, the forwarding pointer of described next snapshot indexing points to the backwarding pointer of described previous snapshot indexing.
Optionally, as shown in figure 11, described device also comprises:
Acquiring unit 1101, for obtaining file pending under described catalogue, and to the operation of described pending file;
Updating block 1102, for according to described operation, upgrade the snapshot variation list in the snapshot indexing created in the metadata of described catalogue.
Optionally, when described acquiring unit get to described pending file be operating as under described catalogue new files the time, as shown in figure 12, described updating block comprises:
The first processing module 1201, deposit the newly-built list of last snapshot indexing of metadata of described catalogue in for the pointer of the metadata for by described pending file.
Optionally, when described acquiring unit get to described pending file be operating as the file of revising under described catalogue the time, as shown in figure 13, described updating block comprises:
Whether judge module 1301, be present in for the pointer of the metadata that judges described pending file in the newly-built list of metadata snapshot indexing of described catalogue;
The first modified module 1302, for when being present in described newly-built list, according to the modification to described pending file, revise the metadata of described pending file;
The second processing module 1303, for when not being present in described newly-built list, by described pending file copy to the first storage area, the metadata replication of described pending file is to the second storage area, and the pointer of the metadata of described pending file is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, the pointer of the metadata of amended file is deposited in the newly-built list of described last snapshot indexing.
Optionally, when described acquiring unit get to described pending file be operating as the metadata of revising the file under described catalogue the time, as shown in figure 14, described updating block comprises:
Whether described judge module, also be present in the newly-built list of metadata snapshot indexing of described catalogue for the pointer of the metadata that judges described pending file;
The second modified module 1401, for when being present in described newly-built list, revise the metadata of described pending file;
The 3rd processing module 1402, for when not being present in described newly-built list, by metadata replication to the three storage areas before described pending file modification, the pointer of the metadata of described pending file is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, the pointer of the metadata of amended file is deposited in the newly-built list of described last snapshot indexing.
Optionally, when described acquiring unit get to described pending file be operating as the file of deleting under described catalogue the time, as shown in figure 15, described updating block comprises:
Whether described judge module, also be present in the newly-built list of metadata snapshot indexing of described catalogue for the pointer of the metadata that judges described pending file;
Removing module 1501, for when being present in described newly-built list, delete the pointer of the metadata of file pending described in described newly-built list;
Manages module 1502 everywhere, for when not being present in described newly-built list, delete the object pointer in the metadata of described catalogue, by described pending file copy to the four storage areas, and the pointer of the metadata after described pending file copy is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, point to the pointer of the metadata of described pending file in the metadata that described object pointer is described catalogue.
When said apparatus 80 is processed the snapshot of local file system, described device 80 is present in local terminal, and while processing the snapshot of distributed file system, described device 80 is present in meta data server.
The specific implementation process of each unit in the fast photographing device 80 of above-mentioned file system, can be referring to the processing procedure of the Snapshot Method of above-mentioned file system.
The fast photographing device of the file system shown in above-mentioned Fig. 8 to Figure 15 can be realized by the hardware configuration based on computing machine or other network equipments, as shown in figure 16, the hardware configuration of the fast photographing device 16 of file system comprises storer 1601, transceiver 1602, processor 1603 and bus 1604.
Wherein, processor 1603, storer 1601 and transceiver 1602 are by bus 1604.
Storer 1601 can be ROM (read-only memory) (Read Only Memory, ROM), static storage device, dynamic memory or random access memory (Random Access Memory, RAM).Storer 1601 can the storage operation system and instruction and the application data of other application programs.In storer 1601, the instruction of storage moves execution by processor 1603.
In the embodiment of the present invention storer 1601 can be used for storage realize Fig. 8 to the instruction of each functional unit in embodiment illustrated in fig. 15, the establishment snapshot request received, delete snapshot request and to the request of the file operation under the catalogue that creates snapshot.
Transceiver 1602 is used for realizing the fast photographing device 16 and other equipment, for example communication of client of file system.
In the embodiment of the present invention, transceiver 1602 is for receiving the request message from client process or client.
Processor 1603 can adopt general central processing unit (Central Processing Unit, CPU), microprocessor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), perhaps one or more integrated circuit, for carrying out relative program.
In the embodiment of the present invention, processor 1603, for the instruction of execute store 1601, is specifically carried out:
By the establishment snapshot request message of transceiver 1602 receptions, determine the catalogue of snapshot to be created;
Create snapshot indexing in the metadata of described catalogue; Described snapshot indexing comprises that snapshot sign, snapshot timestamp and snapshot change list; Wherein, described snapshot is designated the sign of the described snapshot indexing of described directory creating; The system time that described snapshot timestamp is the described snapshot indexing of described directory creating; Described snapshot changes list and comprises newly-built list and delete list, after described newly-built list comprises the described snapshot indexing of establishment, and the pointer of the metadata of new files and amended file in described catalogue; After described delete list comprises the described snapshot indexing of described directory creating, deleted file and the pointer of metadata that is modified the source document of file in described catalogue.
Wherein, but the gateway embodiment part shown in the part of the concrete processing procedure reference method embodiment in processor 1603 and Fig. 8 to Figure 15 repeats no more here.
Bus 1604 can comprise a path, for example, between the fast photographing device all parts (processor 1603, storer 1601 and receiver 1602) of file system transmission information.
The those skilled in the art can be well understood to, for convenience and simplicity of description, only the division with above-mentioned each functional module is illustrated, in practical application, can above-mentioned functions be distributed and completed by different functional modules as required, the inner structure that is about to device is divided into different functional modules, to complete all or part of function described above.The system of foregoing description, the specific works process of device and unit, can, with reference to the process in preceding method embodiment, not repeat them here.
In the several embodiment that provide in the application, should be understood that, disclosed system, apparatus and method, can realize by another way.For example, device embodiment described above is only schematic, for example, the division of described module or unit, be only that a kind of logic function is divided, during actual the realization, other dividing mode can be arranged, for example a plurality of unit or assembly can in conjunction with or can be integrated into another system, or some features can ignore, or do not carry out.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, indirect coupling or the communication connection of device or unit can be electrically, machinery or other form.
The described unit as the separating component explanation can or can not be also physically to separate, and the parts that show as unit can be or can not be also physical locations, can be positioned at a place, or also can be distributed on a plurality of network element.Can select according to the actual needs some or all of unit wherein to realize the purpose of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can be also that the independent physics of unit exists, and also can be integrated in a unit two or more unit.Above-mentioned integrated unit both can adopt the form of hardware to realize, also can adopt the form of SFU software functional unit to realize.
If the form of SFU software functional unit of usining described integrated unit realizes and during as production marketing independently or use, can be stored in a computer read/write memory medium.Understanding based on such, the all or part of of the part that technical scheme of the present invention contributes to prior art in essence in other words or this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprise that some instructions are with so that a computer equipment (can be personal computer, server, or the network equipment etc.) or processor (processor) carry out all or part of step of the described method of each embodiment of the present invention.And aforesaid storage medium comprises: various media that can be program code stored such as USB flash disk, portable hard drive, ROM (read-only memory) (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CDs.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited to this, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, within all should being encompassed in protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of described claim.

Claims (16)

1. the Snapshot Method of a file system, is characterized in that, comprising:
Determine the catalogue of snapshot to be created;
Create snapshot indexing in the metadata of described catalogue; Described snapshot indexing comprises that snapshot sign, snapshot timestamp and snapshot change list; Wherein, described snapshot is designated the sign of the described snapshot indexing of described directory creating; The system time that described snapshot timestamp is the described snapshot indexing of described directory creating; Described snapshot changes list and comprises newly-built list and delete list, after described newly-built list comprises the described snapshot indexing of establishment, and the pointer of the metadata of new files and amended file in described catalogue; After described delete list comprises the described snapshot indexing of described directory creating, deleted file and the pointer of metadata that is modified the source document of file in described catalogue.
2. the Snapshot Method of file system according to claim 1, is characterized in that, the described snapshot indexing that creates in the metadata of described catalogue comprises:
Whether created snapshot according to the snapshot determined property in the metadata of described catalogue, described snapshot attribute is used to indicate described catalogue and whether has created snapshot;
When described snapshot attribute indication does not create snapshot, add described snapshot indexing in the metadata of described catalogue, snapshot in described snapshot indexing sign is set to predetermined value, and is that described snapshot indexing distributes forwarding pointer and backwarding pointer, described forwarding pointer and backwarding pointer all are made as to sky; Wherein, described forwarding pointer is used in reference to in the metadata of described catalogue, the backwarding pointer of the previous snapshot indexing of described catalogue; Described backwarding pointer is used in reference to in the metadata of described catalogue, the forwarding pointer of the next snapshot indexing of described catalogue;
When described snapshot attribute indication has created snapshot, add described snapshot indexing in the metadata of described catalogue, and the forwarding pointer of described snapshot indexing is pointed to the backwarding pointer of previous snapshot indexing, the backwarding pointer of described previous snapshot indexing is pointed to the forwarding pointer of described snapshot indexing.
3. the Snapshot Method of file system according to claim 2, is characterized in that, create snapshot indexing in the metadata of described catalogue after, described method also comprises:
According at least one in snapshot sign and snapshot timestamp, search snapshot indexing to be deleted in the metadata of described catalogue;
Whether the forwarding pointer and the backwarding pointer that judge described snapshot indexing to be deleted are sky;
When the forwarding pointer of described snapshot indexing to be deleted and backwarding pointer are sky, described snapshot indexing to be deleted is deleted;
When the forwarding pointer of described snapshot indexing to be deleted is empty, and when the backwarding pointer of described snapshot indexing to be deleted is not empty, the snapshot of described snapshot indexing to be deleted is changed to the snapshot that list deposits next snapshot indexing in to be changed in list, and described snapshot indexing to be deleted is deleted, wherein, the forwarding pointer of described next snapshot indexing is made as sky;
When the backwarding pointer of described snapshot indexing to be deleted is empty, the forwarding pointer of described snapshot indexing to be deleted is not empty, perhaps when the forwarding pointer of described snapshot indexing to be deleted and backwarding pointer while not being all empty, the snapshot of described snapshot indexing to be deleted is changed to the snapshot that list deposits previous snapshot indexing in to be changed in list, and described snapshot indexing to be deleted is deleted, wherein, the backwarding pointer of described previous snapshot indexing points to the forwarding pointer of the next snapshot indexing of described snapshot indexing to be deleted, the forwarding pointer of described next snapshot indexing points to the backwarding pointer of described previous snapshot indexing.
4. the Snapshot Method of file system according to claim 1, is characterized in that, create snapshot indexing in the metadata of described catalogue after, described method also comprises:
Obtain file pending under described catalogue, and to the operation of described pending file;
According to described operation, the snapshot upgraded in the snapshot indexing created in the metadata of described catalogue changes list.
5. the Snapshot Method of file system according to claim 4, it is characterized in that, when described to described pending file be operating as under described catalogue new files the time, described according to described operation, the snapshot variation list of upgrading in the snapshot indexing created in the metadata of described catalogue comprises:
The pointer of the metadata of described pending file is deposited in the newly-built list of last snapshot indexing in the metadata of described catalogue.
6. the Snapshot Method of file system according to claim 4, it is characterized in that, when described to described pending file be operating as the file of revising under described catalogue the time, described according to described operation, the snapshot variation list of upgrading in the snapshot indexing created in the metadata of described catalogue comprises:
Whether the pointer that judges the metadata of described pending file is present in the newly-built list of snapshot indexing in the metadata of described catalogue;
In the time of in being present in described newly-built list, according to the modification to described pending file, revise the metadata of described pending file;
In the time of in not being present in described newly-built list, by described pending file copy to the first storage area, the metadata replication of described pending file is to the second storage area, and the pointer of the metadata of described pending file is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, the pointer of the metadata of amended file is deposited in the newly-built list of described last snapshot indexing.
7. the Snapshot Method of file system according to claim 4, it is characterized in that, when described to described pending file be operating as the metadata of revising the file under described catalogue the time, described according to described operation, the snapshot variation list of upgrading in the snapshot indexing created in the metadata of described catalogue comprises:
Whether the pointer that judges the metadata of described pending file is present in the newly-built list of snapshot indexing in the metadata of described catalogue;
When being present in described newly-built list, revise the metadata of described pending file;
When not being present in described newly-built list, metadata replication to the three storage areas by described pending file, the pointer of the metadata of described pending file is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, the pointer of the metadata of amended file is deposited in the newly-built list of described last snapshot indexing.
8. the Snapshot Method of file system according to claim 4, it is characterized in that, when described to described pending file be operating as the file of deleting under described catalogue the time, described according to described operation, the snapshot variation list of upgrading in the snapshot indexing created in the metadata of described catalogue comprises:
Whether the pointer that judges the metadata of described pending file is present in the newly-built list of snapshot indexing in the metadata of described catalogue;
When being present in described newly-built list, delete the pointer of the metadata of file pending described in described newly-built list;
When not being present in described newly-built list, delete the object pointer in the metadata of described catalogue, by described pending file copy to the four storage areas, and the pointer of the metadata after described pending file copy is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, point to the pointer of the metadata of described pending file in the metadata that described object pointer is described catalogue.
9. the fast photographing device of a file system, is characterized in that, comprising:
Determining unit, for determining the catalogue of snapshot to be created;
Creating unit, create snapshot indexing for the metadata in described catalogue; Described snapshot indexing comprises that snapshot sign, snapshot timestamp and snapshot change list; Wherein, described snapshot is designated the sign of the described snapshot indexing of described directory creating; The system time that described snapshot timestamp is the described snapshot indexing of described directory creating; Described snapshot changes list and comprises newly-built list and delete list, after described newly-built list comprises the described snapshot indexing of establishment, and the pointer of the metadata of new files and amended file in described catalogue; After described delete list comprises the described snapshot indexing of described directory creating, deleted file and the pointer of metadata that is modified the source document of file in described catalogue.
10. the fast photographing device of file system according to claim 9, is characterized in that, described creating unit comprises:
Whether judge module, created snapshot for the snapshot determined property of the metadata according to described catalogue, and described snapshot attribute is used to indicate described catalogue and whether has created snapshot;
The first creation module, for when described snapshot attribute indication does not create snapshot, add described snapshot indexing in the metadata of described catalogue, snapshot in described snapshot indexing sign is set to predetermined value, and be that described snapshot indexing distributes forwarding pointer and backwarding pointer, described forwarding pointer and backwarding pointer all are made as to sky; Wherein, described forwarding pointer is used in reference to in the metadata of described catalogue, the backwarding pointer of the previous snapshot indexing of described catalogue; Described backwarding pointer is used in reference to in the metadata of described catalogue, the forwarding pointer of the next snapshot indexing of described catalogue;
The second creation module, for when described snapshot attribute indication has created snapshot, add described snapshot indexing in the metadata of described catalogue, and the forwarding pointer of described snapshot indexing is pointed to the backwarding pointer of previous snapshot indexing, the backwarding pointer of described previous snapshot indexing is pointed to the forwarding pointer of described snapshot indexing.
11. the fast photographing device of file system according to claim 10, is characterized in that, described device also comprises:
Search unit, for according at least one of snapshot sign and snapshot timestamp, search snapshot indexing to be deleted in the metadata of described catalogue;
Whether judging unit, be sky for forwarding pointer and the backwarding pointer that judges described snapshot indexing to be deleted;
Delete cells, while for the forwarding pointer when described snapshot indexing to be deleted and backwarding pointer, being sky, delete described snapshot indexing to be deleted;
The first processing unit, for the forwarding pointer when described snapshot indexing to be deleted, it be sky, and when the backwarding pointer of described snapshot indexing to be deleted is not empty, the snapshot of described snapshot indexing to be deleted is changed to the snapshot that list deposits next snapshot indexing in to be changed in list, and described snapshot indexing to be deleted is deleted, wherein, the forwarding pointer of described next snapshot indexing is made as sky;
The second processing unit, for the backwarding pointer when described snapshot indexing to be deleted, it be sky, the forwarding pointer of described snapshot indexing to be deleted is not empty, perhaps when the forwarding pointer of described snapshot indexing to be deleted and backwarding pointer while not being all empty, the snapshot of described snapshot indexing to be deleted is changed to the snapshot that list deposits previous snapshot indexing in to be changed in list, and described snapshot indexing to be deleted is deleted, wherein, the backwarding pointer of described previous snapshot indexing points to the forwarding pointer of the next snapshot indexing of described snapshot indexing to be deleted, the forwarding pointer of described next snapshot indexing points to the backwarding pointer of described previous snapshot indexing.
12. the fast photographing device of file system according to claim 9, is characterized in that, described device also comprises:
Acquiring unit, for obtaining file pending under described catalogue, and to the operation of described pending file;
Updating block, for according to described operation, upgrade the snapshot variation list in the snapshot indexing created in the metadata of described catalogue.
13. the fast photographing device of file system according to claim 12, is characterized in that, when described acquiring unit get to described pending file be operating as under described catalogue new files the time, described updating block comprises:
The first processing module, deposit in for the pointer of the metadata by described pending file in the newly-built list of last snapshot indexing of metadata of described catalogue.
14. the fast photographing device of file system according to claim 12, is characterized in that, when described acquiring unit get to described pending file be operating as the file of revising under described catalogue the time, described updating block comprises:
Whether judge module, be present in for the pointer of the metadata that judges described pending file in the newly-built list of metadata snapshot indexing of described catalogue;
The first modified module, for when being present in described newly-built list, according to the modification to described pending file, revise the metadata of described pending file;
The second processing module, for when not being present in described newly-built list, by described pending file copy to the first storage area, the metadata replication of described pending file is to the second storage area, and the pointer of the metadata of described pending file is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, the pointer of the metadata of amended file is deposited in the newly-built list of described last snapshot indexing.
15. the fast photographing device of file system according to claim 12, is characterized in that, when described acquiring unit get to described pending file be operating as the metadata of revising the file under described catalogue the time, described updating block comprises:
Whether described judge module, also be present in the newly-built list of metadata snapshot indexing of described catalogue for the pointer of the metadata that judges described pending file;
The second modified module, for when being present in described newly-built list, revise the metadata of described pending file;
The 3rd processing module, for when not being present in described newly-built list, metadata replication to the three storage areas by described pending file, the pointer of the metadata of described pending file is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, the pointer of the metadata of file after revising is deposited in the newly-built list of described last snapshot indexing.
16. the fast photographing device of file system according to claim 12, is characterized in that, when described acquiring unit get to described pending file be operating as the file of deleting under described catalogue the time, described updating block comprises:
Whether described judge module, also be present in the newly-built list of metadata snapshot indexing of described catalogue for the pointer of the metadata that judges described pending file;
Removing module, for when being present in described newly-built list, delete the pointer of the metadata of file pending described in described newly-built list;
Manages module everywhere, for when not being present in described newly-built list, delete the object pointer in the metadata of described catalogue, by described pending file copy to the four storage areas, and the pointer of the metadata after described pending file copy is deposited in the delete list of last snapshot indexing in the metadata of described catalogue, point to the pointer of the metadata of described pending file in the metadata that described object pointer is described catalogue.
CN201310378894.3A 2013-08-27 2013-08-27 The Snapshot Method and device of file system Active CN103473277B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310378894.3A CN103473277B (en) 2013-08-27 2013-08-27 The Snapshot Method and device of file system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310378894.3A CN103473277B (en) 2013-08-27 2013-08-27 The Snapshot Method and device of file system

Publications (2)

Publication Number Publication Date
CN103473277A true CN103473277A (en) 2013-12-25
CN103473277B CN103473277B (en) 2017-04-05

Family

ID=49798125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310378894.3A Active CN103473277B (en) 2013-08-27 2013-08-27 The Snapshot Method and device of file system

Country Status (1)

Country Link
CN (1) CN103473277B (en)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729265A (en) * 2013-12-30 2014-04-16 华为技术有限公司 Method and device for protecting stored data
CN104462290A (en) * 2014-11-27 2015-03-25 华为技术有限公司 File system copying method and device
CN104866245A (en) * 2015-06-03 2015-08-26 北京麓柏科技有限公司 Method and device for synchronous snapshot between cache equipment and storage system
CN106569738A (en) * 2016-09-30 2017-04-19 华为技术有限公司 Method and apparatus for deleting cascading snapshot
CN106649412A (en) * 2015-11-04 2017-05-10 阿里巴巴集团控股有限公司 Data processing method and device
CN106933699A (en) * 2015-12-30 2017-07-07 中移(苏州)软件技术有限公司 A kind of data recovery, snapshot establishment, snapshot delet method and device
CN106980645A (en) * 2017-02-24 2017-07-25 深圳市中博睿存信息技术有限公司 A kind of distributed file system framework implementation method and device
CN107122140A (en) * 2017-05-02 2017-09-01 郑州云海信息技术有限公司 A kind of file intelligent storage method based on metadata information
CN109462651A (en) * 2018-11-19 2019-03-12 郑州云海信息技术有限公司 Method, apparatus, system and the readable storage medium storing program for executing of cloud in a kind of mirrored volume data
CN109815194A (en) * 2019-02-01 2019-05-28 北京沃东天骏信息技术有限公司 Indexing means, indexing unit, computer readable storage medium and electronic equipment
CN110073344A (en) * 2016-10-28 2019-07-30 Netapp股份有限公司 Refreshed using synthesis baseline snapshot with state of evicting from and is evicted to reduce stable data
CN110515543A (en) * 2019-08-02 2019-11-29 星辰天合(北京)数据科技有限公司 Object bucket-based snapshot method, device and system
CN110515767A (en) * 2019-08-09 2019-11-29 济南浪潮数据技术有限公司 Snapshot data backup method, device, equipment and readable storage medium storing program for executing
CN111522780A (en) * 2019-02-01 2020-08-11 华为技术有限公司 Method and terminal for recording file creator information
CN113821476A (en) * 2021-11-25 2021-12-21 云和恩墨(北京)信息技术有限公司 Data processing method and device
US11429488B2 (en) 2016-10-14 2022-08-30 Tencent Technology (Shenzhen) Company Limited Data recovery method based on snapshots, device and storage medium
CN115185891A (en) * 2022-09-14 2022-10-14 联想凌拓科技有限公司 Data management method and device of file system, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030093443A1 (en) * 2001-11-15 2003-05-15 Huxoll Vernon F. System and method for creating online snapshots
US7072916B1 (en) * 2000-08-18 2006-07-04 Network Appliance, Inc. Instant snapshot
CN101162469A (en) * 2007-11-09 2008-04-16 清华大学 Fine grit document and catalogs version management method based on snapshot
CN101178677A (en) * 2007-11-09 2008-05-14 中国科学院计算技术研究所 Computer system for protecting software and method for protecting software
CN103257993A (en) * 2012-02-15 2013-08-21 株式会社日立解决方案 File list generation method, system, and program, and file list generation device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7072916B1 (en) * 2000-08-18 2006-07-04 Network Appliance, Inc. Instant snapshot
US20030093443A1 (en) * 2001-11-15 2003-05-15 Huxoll Vernon F. System and method for creating online snapshots
CN101162469A (en) * 2007-11-09 2008-04-16 清华大学 Fine grit document and catalogs version management method based on snapshot
CN101178677A (en) * 2007-11-09 2008-05-14 中国科学院计算技术研究所 Computer system for protecting software and method for protecting software
CN103257993A (en) * 2012-02-15 2013-08-21 株式会社日立解决方案 File list generation method, system, and program, and file list generation device

Cited By (31)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729265A (en) * 2013-12-30 2014-04-16 华为技术有限公司 Method and device for protecting stored data
CN103729265B (en) * 2013-12-30 2017-01-04 华为技术有限公司 A kind of guard method storing data and device
CN104462290A (en) * 2014-11-27 2015-03-25 华为技术有限公司 File system copying method and device
CN104462290B (en) * 2014-11-27 2017-10-10 华为技术有限公司 File system clone method and device
CN104866245A (en) * 2015-06-03 2015-08-26 北京麓柏科技有限公司 Method and device for synchronous snapshot between cache equipment and storage system
CN104866245B (en) * 2015-06-03 2018-09-14 马鞍山创久科技股份有限公司 The method and apparatus of synchronisation snapshot between buffer memory device and storage system
CN106649412A (en) * 2015-11-04 2017-05-10 阿里巴巴集团控股有限公司 Data processing method and device
US10789226B2 (en) 2015-11-04 2020-09-29 Alibaba Group Holding Limited Method and apparatus for data processing
CN106649412B (en) * 2015-11-04 2021-05-04 阿里巴巴集团控股有限公司 Data processing method and equipment
CN106933699B (en) * 2015-12-30 2021-11-30 中移(苏州)软件技术有限公司 Snapshot deleting method and device
CN106933699A (en) * 2015-12-30 2017-07-07 中移(苏州)软件技术有限公司 A kind of data recovery, snapshot establishment, snapshot delet method and device
CN106569738A (en) * 2016-09-30 2017-04-19 华为技术有限公司 Method and apparatus for deleting cascading snapshot
US11093162B2 (en) 2016-09-30 2021-08-17 Huawei Technologies Co., Ltd. Method and apparatus for deleting cascaded snapshot
CN106569738B (en) * 2016-09-30 2019-11-29 华为技术有限公司 A kind of method and device for deleting cascade snapshot
US11429488B2 (en) 2016-10-14 2022-08-30 Tencent Technology (Shenzhen) Company Limited Data recovery method based on snapshots, device and storage medium
CN110073344B (en) * 2016-10-28 2021-01-15 Netapp股份有限公司 Reducing stable data evictions using synthetic baseline snapshots and eviction state refreshes
CN110073344A (en) * 2016-10-28 2019-07-30 Netapp股份有限公司 Refreshed using synthesis baseline snapshot with state of evicting from and is evicted to reduce stable data
CN106980645B (en) * 2017-02-24 2020-09-15 北京同有飞骥科技股份有限公司 Distributed file system architecture implementation method and device
CN106980645A (en) * 2017-02-24 2017-07-25 深圳市中博睿存信息技术有限公司 A kind of distributed file system framework implementation method and device
CN107122140A (en) * 2017-05-02 2017-09-01 郑州云海信息技术有限公司 A kind of file intelligent storage method based on metadata information
CN109462651A (en) * 2018-11-19 2019-03-12 郑州云海信息技术有限公司 Method, apparatus, system and the readable storage medium storing program for executing of cloud in a kind of mirrored volume data
CN109462651B (en) * 2018-11-19 2021-11-19 郑州云海信息技术有限公司 Method, device and system for cloud-up of mirror volume data and readable storage medium
CN111522780A (en) * 2019-02-01 2020-08-11 华为技术有限公司 Method and terminal for recording file creator information
CN111522780B (en) * 2019-02-01 2024-01-30 华为技术有限公司 Method and terminal for recording information of file creator
CN109815194A (en) * 2019-02-01 2019-05-28 北京沃东天骏信息技术有限公司 Indexing means, indexing unit, computer readable storage medium and electronic equipment
CN110515543A (en) * 2019-08-02 2019-11-29 星辰天合(北京)数据科技有限公司 Object bucket-based snapshot method, device and system
CN110515543B (en) * 2019-08-02 2021-02-19 星辰天合(北京)数据科技有限公司 Object bucket-based snapshot method, device and system
CN110515767A (en) * 2019-08-09 2019-11-29 济南浪潮数据技术有限公司 Snapshot data backup method, device, equipment and readable storage medium storing program for executing
CN113821476A (en) * 2021-11-25 2021-12-21 云和恩墨(北京)信息技术有限公司 Data processing method and device
CN115185891A (en) * 2022-09-14 2022-10-14 联想凌拓科技有限公司 Data management method and device of file system, electronic equipment and storage medium
CN115185891B (en) * 2022-09-14 2023-01-17 联想凌拓科技有限公司 Data management method and device of file system, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN103473277B (en) 2017-04-05

Similar Documents

Publication Publication Date Title
CN103473277A (en) Snapshot method and device for file systems
US20200364194A1 (en) Migration of a database management system to cloud storage
US11042446B2 (en) Application-level live synchronization across computing platforms such as cloud platforms
US11422900B2 (en) Platform-agnostic containerized application data protection
CN102707990B (en) Container based processing method and device
US11288135B2 (en) Synthesizing a restore image from one or more secondary copies to facilitate data restore operations to a file server
CN102981931B (en) Backup method and device for virtual machine
US9235594B2 (en) Synchronizing updates across cluster filesystems
US11921594B2 (en) Enhanced file indexing, live browsing, and restoring of backup copies of virtual machines and/or file systems by populating and tracking a cache storage area and a backup index
US11321192B2 (en) Restoration of specified content from an archive
US8606759B2 (en) Apparatus, system and method for recovering meta data using fragmentary information
US20120110287A1 (en) Snapshots in a hybrid storage device comprising a magnetic disk and a solid state disk
US20210064486A1 (en) Access arbitration to a shared cache storage area in a data storage management system for live browse, file indexing, backup and/or restore operations
US20110093437A1 (en) Method and system for generating a space-efficient snapshot or snapclone of logical disks
CN113886143B (en) Virtual machine continuous data protection method and device and data recovery method and device
CN103678337A (en) Data eliminating method, device and system
CN113918385B (en) Method, device, electronic equipment and medium for online incremental backup and recovery of virtual machine
CN102360321A (en) Terminal program quick backup and recovery method based on cloud architecture
CN109491832A (en) Data disaster tolerance method and website
CN108255638A (en) A kind of snapshot rollback method and device
CN104662522A (en) System and method for full virtual machine backup using storage system functionality
CN112800019A (en) Data backup method and system based on Hadoop distributed file system
CN108572888B (en) Disk snapshot creating method and disk snapshot creating device
CN115098447A (en) File recovery method and device, electronic equipment and readable storage medium
EP3454231B1 (en) Remotely mounted file system with stubs

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20191231

Address after: 314413 No.2, Fengshou Avenue, Haining Economic and knitting industrial park, Jiaxing City, Zhejiang Province

Patentee after: Zhejiang Haining Warp Knitting Industrial Park Development Co., Ltd

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: Huawei Technologies Co., Ltd.

PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Snapshot method and device of file system

Effective date of registration: 20201129

Granted publication date: 20170405

Pledgee: Zhejiang Haining Rural Commercial Bank Co.,Ltd. Maqiao sub branch

Pledgor: Zhejiang Haining Warp Knitting Industrial Park Development Co.,Ltd.

Registration number: Y2020330001084