CN103714013B - A kind of collocation method and device of the memory space of file system - Google Patents
A kind of collocation method and device of the memory space of file system Download PDFInfo
- Publication number
- CN103714013B CN103714013B CN201310750617.0A CN201310750617A CN103714013B CN 103714013 B CN103714013 B CN 103714013B CN 201310750617 A CN201310750617 A CN 201310750617A CN 103714013 B CN103714013 B CN 103714013B
- Authority
- CN
- China
- Prior art keywords
- area
- bit map
- data block
- resource
- index node
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Abstract
The embodiment of the invention discloses a kind of collocation method and device of the memory space of file system, methods described includes:For the file system assignment bit map area memory space and resource-area memory space;When in index node assignment bit map of the bit map area for the file system, it is allocated from the bit map area low address end to high address end direction, when in index node distribution index node list item space of the resource-area for the file system, it is allocated from the resource-area low address end to high address end direction;When in data block assignment bit map of the bit map area for the file system, it is allocated from the bit map area high address end to low address extreme direction, when in data block allocation space of the resource-area for the file system, it is allocated from the resource-area high address end to low address extreme direction.Thus, the embodiment of the present invention, can maximally utilise the memory space of memory.
Description
Technical field
The present invention relates to digital processing field, more particularly to a kind of memory space of file system collocation method and
Device.
Background technology
Phase transition storage(Phase Change Memory, PCM), reluctance type random access storage device
(Magnetoresistive Random Access Memory, MRAM) and variable resistance type memory (Resistive
Random-access memory, RRAM) it is the novel memory devices occurred at present, they turn into industry with its unique performance
Hot research object, storage level internal memory is referred to as by industry(Storage Class Memory, SCM).
SCM is different from traditional hard disk, in addition to high readwrite performance, also with Byte changeabilities, and read-write every time can be only
Change the data segment of very little, fine-grained management can be carried out.These current novel memory devices can be used for the number of storage file system
According to.
File system is mainly used in the data and metadata of management and storage file, the text of present most file system
The method that the distribution of the memory space of part or catalogue in memory all uses index node+data block.In index node
The metadata of middle storage file or catalogue and the data block number of file, deposit the specific of file or catalogue in corresponding data block
Content.Each file or catalogue have an index node, are determined to need how many data blocks according to file size.
Currently, the file system based on SCM is all fixed, such as ext4 file system for the boundary of each subregion
In, index node is just have recorded in superblock(It is abbreviated as:inode)Bitmap starting block, data bitmap block starting block, index
Node table starting block, data block starting block.The mode of this fixed limit can bring a problem.When small documents are excessive, meeting
Due to not unnecessary index node, and cause the waste of data block;And when big file is a lot, can be exhausted because of data block,
Unnecessary index node cannot be used.Both of these case, can all cause the waste of the memory space of memory.
The content of the invention
The embodiment of the present invention provides a kind of collocation method and device of the memory space of file system, is fully meeting file
, can effectively sharp memory-aided memory space during the memory allocation of system.
First aspect present invention provides a kind of collocation method of the memory space of file system, and it may include:
For the file system assignment bit map area memory space and resource-area memory space;
When in index node assignment bit map of the bit map area for the file system, from the bit map area low address end
It is allocated to high address end direction, when the index node distribution index node list item in the resource-area being the file system
During space, it is allocated from the resource-area low address end to high address end direction;
When the bit map area be the file system data block assignment bit map when, from the bit map area high address end to
Low address extreme direction is allocated, when in data block allocation space of the resource-area for the file system, from the money
Source region high address end is allocated to low address extreme direction.
With reference in a first aspect, in the first feasible embodiment, described is that the file system assignment bit map area is deposited
Store up space and resource-area memory space, it may include:
The size and number of the data block of the file system created according to user, calculate the bit map area size and
The size of the resource-area;
According to the size of the bit map area and the size of the resource-area, respectively described bit map area and the resource are distinguished
With correspondingly sized memory space.
With reference to the first feasible embodiment of first aspect or first aspect, in second of feasible embodiment
In, it is described when in index node assignment bit map of the bit map area for the file system, from the bit map area low address end
It is allocated to high address end direction, when the index node distribution index node list item in the resource-area being the file system
During space, it is allocated from the resource-area low address end to high address end direction, including:
When in index node assignment bit map of the bit map area for the root of the file system, from the bit map area
Low address end starts distribution to first bitmap in high address end direction;
When empty for the index node allocation space index node list item of the root of the file system in the resource-area
Between when, distributed since the low location end in the resource-area to first space in high address end direction;
It is described when the bit map area be the file system data block assignment bit map when, from the bit map area high address
Hold to low address extreme direction and be allocated, when in data block allocation space of the resource-area for the file system, from institute
Resource-area high address end is stated to be allocated to low address extreme direction, including:
It is high from the bit map area when in data block assignment bit map of the bit map area for the root of the file system
Address end starts distribution to first bitmap of low address extreme direction;
It is high from the resource-area when in data block allocation space of the resource-area for the root of the file system
Location end starts distribution to first space of low address extreme direction.
With reference to the first feasible embodiment of first aspect or first aspect, in the third feasible embodiment
In, it is described when in index node assignment bit map of the bit map area for the file system, from the bit map area low address end
It is allocated to high address end direction, when in index node distribution distribution index node of the resource-area for the file system
During list item space, it is allocated from the resource-area low address end to high address end direction, including:
When in index node assignment bit map of the bit map area for the file of the non-root of the file system, from institute
State bit map area low address end and travel through bitmap to high address end direction, until finding a first idle bitmap, by described first
Bitmap distributes to the index node of the file of the non-root;
Saved when being indexed in the resource-area for the index node allocation space of the file of the non-root of the file system
During point list item space, corresponding with first bitmap first is searched from the resource-area low address end to high address end direction empty
Between, and first space is distributed to the index node of the file of the non-root;
It is described when the bit map area be the file system data block assignment bit map when, from the bit map area high address
Hold to low address extreme direction and be allocated, when in data block allocation space of the resource-area for the file system, from institute
Resource-area high address end is stated to be allocated to low address extreme direction, including:
When in data block assignment bit map of the bit map area for the file of the non-root of the file system, from described
Bit map area high address end travels through bitmap to low address extreme direction, until finding a second idle bitmap, is found described
Second bitmap distributes to the data block of the file of the non-root;
When in the data block allocation space of the resource-area for the file of the non-root of the file system, from
The resource-area high address end searches corresponding with second bitmap second space to low address extreme direction, and by described second
Distribute to the data block of the file of the non-root in space.
With reference to the first feasible embodiment of first aspect or first aspect, in the 4th kind of feasible embodiment
In, it is described when in index node assignment bit map of the bit map area for the file system, from the bit map area low address end
It is allocated to high address end direction, when the index node allocation space index node in the resource-area being the file system
During list item space, it is allocated from the resource-area low address end to high address end direction, including:
When in index node assignment bit map of the bit map area for the file of the non-root of the file system, by institute
Bit map area low address end is stated to next bitmap of last bitmap for being assigned as index node in high address end direction to divide
The index node of the file of non-root described in dispensing;
When in index node allocation space index node list item space of the resource-area for the file system, by institute
State resource-area low address end and be assigned as next sky in index node list item space to last of high address end direction
Between distribute to the non-root file the index node;
It is described when the bit map area be the file system data block assignment bit map when, from the bit map area high address
Hold to low address extreme direction and be allocated, correspond to the number when being distributed in the resource-area for the data block of the file system
According to the bitmap of block space when, be allocated from the resource-area high address end to low address extreme direction, including:
, will be described when in data block assignment bit map of the bit map area for the file of the non-root of the file system
Bit map area high address end is distributed to next bitmap of last bitmap for being assigned as data block of low address extreme direction
The data block of the file of the non-root;
When in the data block allocation space of the resource-area for the file system, by the resource-area low address
Next space in last space for being assigned as data block to high address end direction is held to distribute to the non-root mesh
The data block of the file of record.
With reference to the first feasible embodiment of first aspect or first aspect, in the 5th kind of feasible embodiment
In, methods described may also include:
When deleting index node, the bitmap by the index node in the bit map area is reset, and discharges the index
Node adds in index node deletion record table the index node index letter of the deletion in the space of the resource-area
Breath, the index information of the index node be used to indicating the index node of the deletion in the position of the bitmap of the bit map area and
Indicate the index node of the deletion in the position of the index node list item of the resource-area;
When deleting data block, the bitmap by the data block in the bit map area is reset, and is discharged the data block and existed
The space of the resource-area, and add in data block deletion record table the index information of the data block of the deletion, the number
It is used to indicate that the data block of the deletion is deleted in the position of the bitmap of the bit map area with described in instruction according to the information of the index of block
Locus of the data block removed in the resource-area.
With reference to the 5th kind of feasible embodiment of first aspect, in the 6th kind of feasible embodiment, methods described
It may also include:
It is the text in the bit map area when the index node assignment bit map for being the file system and in the resource-area
During the index node distribution index node list item space of part system, whether be sky, such as if inquiring about the index node deletion record table
Really described index node deletion record table non-NULL, then the index information in the index node deletion record table again will be by
The index node of the file system is distributed in the bitmap of the index node of deletion and space;
When the data block assignment bit map in the bit map area being the file system and when in the resource-area being the text
During the data block allocation space of part system, whether be empty, if the data block is deleted if inquiring about the data block deletion record table
Record sheet non-NULL, then the index information in the data block deletion record table again by the bitmap of deleted data block and
Distribute to the data block of the file system in space.
Second aspect of the present invention provides a kind of configuration device of the memory space of file system, and it may include:
Initial configuration module, for for the file system assignment bit map area memory space and resource-area memory space;
Index node configuration module, for when the index node assignment bit map in the bit map area being the file system
When, be allocated from the bit map area low address end to high address end direction, when in the resource-area for the file system
During index node distribution index node list item space, it is allocated from the resource-area low address end to high address end direction;
Data block configuration module, for when the bit map area be the file system data block assignment bit map when, from
The bit map area high address end is allocated to low address extreme direction, when the data block in the resource-area being the file system
During allocation space, it is allocated from the resource-area high address end to low address extreme direction.
With reference to second aspect, in the first feasible embodiment, the initial configuration module, including:
Computing module, for the size and number of the data block of the file system created according to user, calculates described
The size of bit map area and the size of the resource-area;
Space partitioning module, for the size according to the bit map area and the size of the resource-area, respectively institute's rheme
Correspondingly sized memory space is distributed in figure area and the resource-area.
With reference to the first feasible embodiment of second aspect or second aspect, in second of feasible embodiment
In, the index node configuration module, including:
Root index node configuration module, for when in index of the bit map area for the root of the file system
During node distribution bitmap, distributed first bitmap since the bit map area low address end to high address end direction;And work as
At index node allocation space index node list item space of the resource-area for the root of the file system, from described
The low location end in resource-area starts distribution to first space in high address end direction;
The data block configuration module, including:
Root data block configuration module, for when in data block of the bit map area for the root of the file system
During assignment bit map, distributed since the bit map area high address end to first bitmap of low address extreme direction;And, when institute
When stating the data block allocation space for the root that resource-area is the file system, from the high location end in the resource-area to low address end
First space in direction starts distribution.
With reference to the first feasible embodiment of second aspect or second aspect, in the third feasible embodiment
In, the index node configuration module, including:
Non-root directory inode configuration module, for when the non-root in the bit map area being the file system
During the index node assignment bit map of file, bitmap is traveled through from the bit map area low address end to high address end direction, until finding
One the first idle bitmap, first bitmap is distributed to the index node of the file of the non-root;And,
When empty for the index node allocation space index node list item of the file of the non-root of the file system in the resource-area
Between when, corresponding with first bitmap the first space, and general are searched from the resource-area low address end to high address end direction
Distribute to the index node of the file of the non-root in first space;
The data block configuration module, including:
Non-root directory data block configuration module, for when in text of the bit map area for the non-root of the file system
During the data block assignment bit map of part, bitmap is traveled through from the bit map area high address end to low address extreme direction, until finding one
The second idle bitmap, second bitmap found is distributed to the data block of the file of the non-root;And,
When in the data block allocation space of the resource-area for the file of the non-root of the file system, from the resource
Area's high address end searches second space corresponding with second bitmap to low address extreme direction, and the second space is distributed
The data block to the file of the non-root.
With reference to the first feasible embodiment of second aspect or second aspect, in the 4th kind of feasible embodiment
In, the index node configuration module, including:
Non-root directory inode configuration module, for when the non-root in the bit map area being the file system
During the index node assignment bit map of file, the bit map area low address end has been assigned as to last of high address end direction
Next bitmap of the bitmap of index node distributes to the index node of the file of the non-root;And, when institute
When stating the index node allocation space index node list item space that resource-area is the file system, by the resource-area low address
Hold distributed to last next space for being assigned as index node list item space in high address end direction it is described non-
The index node of the file of root;
The data block configuration module, including:
Non-root directory data block configuration module, for when in text of the bit map area for the non-root of the file system
During the data block assignment bit map of part, the bit map area high address end data have been assigned as to last of low address extreme direction
Next bitmap of the bitmap of block distributes to the data block of the file of the non-root;And, when in the resource-area
For the file system the data block allocation space when, by the resource-area low address end to the last of high address end direction
One be assigned as data block space next space distribute to the non-root file the data block.
With reference to the first feasible embodiment of second aspect or second aspect, in the 5th kind of feasible embodiment
In, described device also includes:
Index node removing module, for when delete index node when, by the index node the bit map area position
Figure is reset, and discharges space of the index node in the resource-area, and adds described in index node deletion record table
The index node index information of deletion, the index information of the index node is used for the index node for indicating the deletion described
The position of the bitmap of bit map area and the position for indicating index node list item of the index node of the deletion in the resource-area;
Data block removing module, for when delete data block when, by the data block the bit map area bitmap reset,
And space of the data block in the resource-area is discharged, and add in data block deletion record table the data block of the deletion
Index information, the information of the index of the data block is used to indicating the bitmap of the data block of the deletion in the bit map area
Position and locus of the data block in the resource-area for indicating the deletion.
With reference to the 5th kind of feasible embodiment of second aspect, in the 6th kind of feasible embodiment, the index
Node configuration module, is additionally operable to work as in the bit map area for the index node assignment bit map of the file system and in the resource
When area is the index node distribution index node list item space of the file system, inquiring about the index node deletion record table is
No is sky, if the index node deletion record table non-NULL, the index letter in the index node deletion record table
Breath again distributes to the bitmap of deleted index node and space the index node of the file system;
The data block configuration module, is additionally operable to when the data block assignment bit map in the bit map area being the file system
And when in data block allocation space of the resource-area for the file system, whether inquire about the data block deletion record table
For sky, if the data block deletion record table non-NULL, the index information in the data block deletion record table is again
The bitmap of deleted data block and space are distributed to the data block of the file system.
Therefore, it is the file system assignment bit map area storage in some feasible embodiments of the present invention
Space and resource-area memory space;When being the index node assignment bit map of the file system in the bit map area, from described
Bit map area low address end is allocated to high address end direction, when in index node point of the resource-area for the file system
During with index node list item space, it is allocated from the resource-area low address end to high address end direction;When in the bitmap
When area is the data block assignment bit map of the file system, divided from the bit map area high address end to low address extreme direction
Match somebody with somebody, when in data block allocation space of the resource-area for the file system, from the resource-area high address end to low land
Location extreme direction is allocated.Thus, the embodiment of the present invention substantially do not limit index node and data block in bit map area and money
The boundary in the space of source region, but the space of bit map area and the space of resource-area are flexibly shared into index node and data block,
The memory space of memory can be maximally utilised.
Brief description of the drawings
Fig. 1 illustrates for the flow of an embodiment of the collocation method of the memory space of the file system of the embodiment of the present invention
Figure;
Fig. 2 is the memory space Configuration Framework schematic diagram of the file system of the embodiment of the present invention;
Fig. 3 shows for the structure composition of an embodiment of the configuration device of the memory space of the file system of the embodiment of the present invention
It is intended to;
Fig. 4 is the structure composition schematic diagram of an embodiment of the initial configuration module 31 of the embodiment of the present invention;
Fig. 5 is the structure composition of another embodiment of the configuration device of the memory space of the file system of the embodiment of the present invention
Schematic diagram;
Fig. 6 is the structure composition of another embodiment of the configuration device of the memory space of the file system of the embodiment of the present invention
Schematic diagram;
Fig. 7 is the structure composition of another embodiment of the configuration device of the memory space of the file system of the embodiment of the present invention
Schematic diagram;
Fig. 8 is the structure composition of another embodiment of the configuration device of the memory space of the file system of the embodiment of the present invention
Schematic diagram.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, the present invention is made into one below in conjunction with accompanying drawing
It is described in detail on step ground.
Fig. 1 illustrates for the flow of an embodiment of the collocation method of the memory space of the file system of the embodiment of the present invention
Figure.As shown in figure 1, the method for the embodiment of the present invention may include:
Step S110, is the file system assignment bit map area memory space and resource-area memory space.
In the specific implementation, step S110 can be performed in the file system initialization stage.
As a kind of feasible embodiment, in the data block of the step S110 file system that can be created according to user
Size and number, calculate the size of the bit map area and the size of the resource-area;Then, according to the size of the bit map area
With the size of the resource-area, correspondingly sized memory space is distributed in respectively described bit map area and the resource-area.
In the specific implementation, being that the file system assignment bit map area memory space and resource-area are stored in step S110
After space, the superblock of the file system can be also initialized, specifically, initialization superblock can make following operation:By institute
State the bitmap number that the initial address, the initial address of the resource-area, the bit map area of bit map area include, the resource-area bag
The information such as the space number included write the superblock.
Fig. 2 shows that a kind of embodiment of the present invention is that the file system assignment bit map area memory space and resource-area are stored
The building-block of logic of file system behind space.As shown in Fig. 2 the memory space of the file system of the embodiment of the present invention is mainly wrapped
Superblock, bit map area and the bulk of resource-area three are included, wherein, bit map area inside and indefinite division index node bitmap area and data
Inside bitmap block area, resource-area and indefinite division index node table area and data block area, therefore, bit map area of the embodiment of the present invention
In all spaces be available for index node and data block shared, all spaces are available for index node and data block shared in resource-area.
Step S111, when in index node assignment bit map of the bit map area for the file system, from the bitmap
Area low address end is allocated to high address end direction, when in index node distribution rope of the resource-area for the file system
When drawing node list item space, it is allocated from the resource-area low address end to high address end direction.
Step S112, when in data block assignment bit map of the bit map area for the file system, from the bit map area
High address end is allocated to low address extreme direction, when the data block allocation space in the resource-area being the file system
When, it is allocated from the resource-area high address end to low address extreme direction.
In the specific implementation, step S111 and step S112 can in no particular order sequentially.
In the specific implementation, the assignment bit map that is previously mentioned in the embodiment of the present invention may include herein and subsequently:By institute's rheme
Figure set, to represent that the bitmap is occupied.The value of the set can for any one pre-set numeral or
Person's letter.Such as, it can set when bitmap is set to " 1 ", represent that corresponding bitmap is allocated.
In some feasible embodiments, in step S111, when the root mesh in the bit map area being the file system
During the index node assignment bit map of record, divide first bitmap since the bit map area low address end to high address end direction
Match somebody with somebody;When in index node allocation space index node list item space of the resource-area for the root of the file system,
Distributed since the low location end in the resource-area to first space in high address end direction.And, in step S112, when described
When bit map area is the data block assignment bit map of the root of the file system, from the bit map area high address end to low address end
First bitmap in direction starts distribution;And, when in data block point of the resource-area for the root of the file system
During with space, distributed since the high location end in the resource-area to first space of low address extreme direction.
In some feasible embodiments, in step S111, when the non-root in the bit map area being the file system
During the index node assignment bit map of the file of catalogue, bitmap is traveled through from the bit map area low address end to high address end direction, directly
To a first idle bitmap is found, first bitmap is distributed to the index section of the file of the non-root
Point;When in index node allocation space index node list item of the resource-area for the file of the non-root of the file system
During space, the first space corresponding with first bitmap is searched from the resource-area low address end to high address end direction, and
First space is distributed to the index node of the file of the non-root.In the specific implementation, this mode can make
In the case of having index node release.In the specific implementation, in this scheme, from the bit map area low address end to high address
Before extreme direction traversal bitmap, whether the number that can first inquire about the deleted index node recorded in superblock is zero, if
Non-zero, then travel through.
In some feasible embodiments, in step S112, when the non-root in the bit map area being the file system
During the data block assignment bit map of the file of catalogue, bitmap is traveled through from the bit map area high address end to low address extreme direction, until
A second idle bitmap is found, second bitmap found is distributed to the data of the file of the non-root
Block;And, when in the data block allocation space of the resource-area for the file of the non-root of the file system, from
The resource-area high address end searches corresponding with second bitmap second space to low address extreme direction, and by described second
Distribute to the data block of the file of the non-root in space.In the specific implementation, this mode can be used in there is data block
In the case of release.In the specific implementation, in this scheme, bitmap is traveled through from the bit map area high address end to low address extreme direction
Before, whether the number that can first inquire about the deleted data block recorded in superblock is zero, if non-zero, is traveled through.
In some feasible embodiments, in step S111, when the non-root in the bit map area being the file system
During the index node assignment bit map of the file of catalogue, by the bit map area low address end to high address end direction last
Be assigned as the bitmap of index node next bitmap distribute to the non-root file the index node;When institute
When stating the index node allocation space index node list item space that resource-area is the file system, by the resource-area low address
Hold distributed to last next space for being assigned as index node list item space in high address end direction it is described non-
The index node of the file of root.In the specific implementation, this mode can be used in the case of having index node release
Or in the case of being discharged without index node.
In some feasible embodiments, in step S112, when the non-root in the bit map area being the file system
During the data block assignment bit map of the file of catalogue, the bit map area high address end has been divided to last of low address extreme direction
Next bitmap with the bitmap for data block distributes to the data block of the file of the non-root;When in the resource
Area be the file system the data block allocation space when, by the resource-area low address end to high address end direction most
Distribute to the data block of the file of the non-root in next space in the latter individual space for being assigned as data block.
In the specific implementation, this mode can be used in the case of having data block release or in the case of the release of no data block.
In some feasible embodiments, the method for the embodiment of the present invention may also include(It is not shown):
When deleting index node, the bitmap by the index node in the bit map area is reset, and discharges the index
Node adds in index node deletion record table the index node index letter of the deletion in the space of the resource-area
Breath, the index information of the index node be used to indicating the index node of the deletion in the position of the bitmap of the bit map area and
Indicate the index node of the deletion in the position of the index node list item of the resource-area;
When deleting data block, the bitmap by the data block in the bit map area is reset, and is discharged the data block and existed
The space of the resource-area, and add in data block deletion record table the index information of the data block of the deletion, the number
It is used to indicate that the data block of the deletion is deleted in the position of the bitmap of the bit map area with described in instruction according to the information of the index of block
Locus of the data block removed in the resource-area.
So, the embodiment of the present invention is in step S111, when in index node point of the bit map area for the file system
Coordination contour and when being the index node distribution index node list item space of the file system in the resource-area, inquires about the rope
Whether be empty, if the index node deletion record table non-NULL, is deleted according to the index node if drawing knot removal record sheet
Except the index information in record sheet again distributes to the bitmap of deleted index node and space the institute of the file system
State index node.And, the embodiment of the present invention, in step S112, when the data block in the bit map area being the file system
Assignment bit map and when being the data block allocation space of the file system in the resource-area, inquires about the data block and deletes note
Whether record table is empty, if the data block deletion record table non-NULL, according to the index in the data block deletion record table
Information again distributes to the bitmap of deleted data block and space the data block of the file system.
With reference to Fig. 2, it is assumed that arrow 1 is oriented to bit map area low address end to high address end direction, arrow 2 is oriented to
Bit map area high address end is to low address extreme direction, and arrow 3 is oriented to resource-area low address end to high address end direction, arrow 4
Be oriented to resource-area high address end to low address extreme direction.Therefore, just it may know that with reference to Fig. 2, the index of the embodiment of the present invention
The bitmap of node is the original position from arrow 1(From low address end to high address end direction)Beginning assignment bit map, and data block
Bitmap be original position from arrow 2(From high address end to low address extreme direction)Start distribution, so, the position of index node
Figure and the bitmap of data block draw close from both sides to centre, it is to avoid the defect of the space waste of obvious boundary.Equally, with reference to Fig. 2
Just it may know that, the index node list item of the index node of the embodiment of the present invention is the original position from arrow 3(From low address end to
High address end direction)Start allocation space, data block is the original position from arrow 4(From high address end to low address extreme direction)
Start allocation space, so, the index node list item and data block of index node are drawn close from resource-area both sides to centre, it is to avoid
The defect of the space waste of obvious boundary.
Therefore, it is the file system assignment bit map area storage in some feasible embodiments of the present invention
Space and resource-area memory space;When being the index node assignment bit map of the file system in the bit map area, from described
Bit map area low address end is allocated to high address end direction, when in index node point of the resource-area for the file system
During with index node list item space, it is allocated from the resource-area low address end to high address end direction;When in the bitmap
When area is the data block assignment bit map of the file system, divided from the bit map area high address end to low address extreme direction
Match somebody with somebody, when in data block allocation space of the resource-area for the file system, from the resource-area high address end to low land
Location extreme direction is allocated.Thus, the embodiment of the present invention substantially do not limit index node and data block in bit map area and money
The boundary in the space of source region, but the space of bit map area and the space of resource-area are flexibly shared into index node and data block,
The memory space of memory can be maximally utilised.
Accordingly, the embodiment of the present invention additionally provides the configuration of the memory space available for the file system for implementing the present invention
The device of method, device embodiment is illustrated below.
Fig. 3 shows for the structure composition of an embodiment of the configuration device of the memory space of the file system of the embodiment of the present invention
It is intended to.As shown in figure 3, the configuration device of the memory space of the file system of the embodiment of the present invention may include:Initial configuration module
31st, index node configuration module 32 and data block configuration module 33, wherein:
Initial configuration module 31, for for the file system assignment bit map area memory space and resource-area memory space.
Index node configuration module 32, for when the index node assignment bit map in the bit map area being the file system
When, be allocated from the bit map area low address end to high address end direction, when in the resource-area for the file system
During index node distribution index node list item space, it is allocated from the resource-area low address end to high address end direction;
Data block configuration module 33, for when the bit map area be the file system data block assignment bit map when,
It is allocated from the bit map area high address end to low address extreme direction, when the data in the resource-area being the file system
During block allocation space, it is allocated from the resource-area high address end to low address extreme direction.
In the specific implementation, initial configuration module 31 can be the file system assignment bit map in the file system initialization stage
Area's memory space and resource-area memory space.
In some feasible embodiments, as shown in figure 4, the initial configuration module 31 of the embodiment of the present invention can be further
Including:
Computing module 311, for the size and number of the data block of the file system created according to user, calculates institute
State the size of bit map area and the size of the resource-area;
Space partitioning module 312, is respectively described for the size according to the bit map area and the size of the resource-area
Correspondingly sized memory space is distributed in bit map area and the resource-area.
In the specific implementation, the initial configuration module 31 of the embodiment of the present invention can also be used to distribute position for the file system
After figure area memory space and resource-area memory space, the superblock of the file system is initialized, specifically, initialization is super
Block can make following operation:The position that the initial address of the bit map area, the initial address of the resource-area, the bit map area are included
Figure number, the information such as the space number that the resource-area includes writes the superblock.
As shown in figure 5, in some feasible embodiments, the index node configuration module 32, it may include:
Root index node configuration module 321, for when the root in the bit map area being the file system
During index node assignment bit map, distributed first bitmap since the bit map area low address end to high address end direction;With
And when in index node allocation space index node list item space of the resource-area for the root of the file system, from
The low location end in resource-area starts distribution to first space in high address end direction;
Non-root directory inode configuration module 322, for when the non-root mesh in the bit map area being the file system
During the index node assignment bit map of the file of record, bitmap is traveled through from the bit map area low address end to high address end direction, until
A first idle bitmap is found, first bitmap is distributed to the index node of the file of the non-root;
And, when in index node allocation space index node table of the resource-area for the file of the non-root of the file system
During item space, the first space corresponding with first bitmap is searched from the resource-area low address end to high address end direction,
And first space is distributed to the index node of the file of the non-root;
The data block configuration module 33, including:
Root data block configuration module 331, for when in number of the bit map area for the root of the file system
During according to block assignment bit map, distributed since the bit map area high address end to first bitmap of low address extreme direction;And, when
In the resource-area during data block allocation space for the root of the file system, from the high location end in the resource-area to low land
First space of location extreme direction starts distribution.
Non-root directory data block configuration module 332, for when the non-root in the bit map area being the file system
File data block assignment bit map when, from the bit map area high address end to low address extreme direction travel through bitmap, until finding
One the second idle bitmap, second bitmap found is distributed to the data block of the file of the non-root;
And, when in the data block allocation space of the resource-area for the file of the non-root of the file system, from institute
State resource-area high address end and search second space corresponding with second bitmap to low address extreme direction, and it is empty by described second
Between distribute to the non-root file the data block.
As shown in fig. 6, in some feasible embodiments, the index node configuration module 32, it may include:
Root index node configuration module 321, for when the root in the bit map area being the file system
During index node assignment bit map, distributed first bitmap since the bit map area low address end to high address end direction;With
And when in index node allocation space index node list item space of the resource-area for the root of the file system, from
The low location end in resource-area starts distribution to first space in high address end direction;
Non-root directory inode configuration module 323, for when the non-root mesh in the bit map area being the file system
During the index node assignment bit map of the file of record, the bit map area low address end has been divided to last of high address end direction
Next bitmap with the bitmap for index node distributes to the index node of the file of the non-root;And, when
It is at index node allocation space index node list item space of the resource-area for the file system, the resource-area is low
Institute is distributed to last next space for being assigned as index node list item space in high address end direction in address end
State the index node of the file of non-root;
The data block configuration module 33, including:
Root data block configuration module 331, for when in number of the bit map area for the root of the file system
During according to block assignment bit map, distributed since the bit map area high address end to first bitmap of low address extreme direction;And, when
In the resource-area during data block allocation space for the root of the file system, from the high location end in the resource-area to low land
First space of location extreme direction starts distribution.
Non-root directory data block configuration module 333, for when the non-root in the bit map area being the file system
File data block assignment bit map when, the bit map area high address end has been assigned as to last of low address extreme direction
Next bitmap of the bitmap of data block distributes to the data block of the file of the non-root;And, when in the money
When source region is the data block allocation space of the file system, by the resource-area low address end to high address end direction
Distribute to the data of the file of the non-root in last next space for being assigned as the space of data block
Block.
As shown in fig. 7, in some feasible embodiments, the device of the embodiment of the present invention may also include:
Index node removing module 34, for when deleting index node, by the index node in the bit map area
Bitmap is reset, and discharges space of the index node in the resource-area, and adds institute in index node deletion record table
The index node index information of deletion is stated, the index information of the index node is used for the index node for indicating the deletion in institute
State the position of the bitmap of bit map area and indicate the position of index node list item of the index node of the deletion in the resource-area;
Data block removing module 35, for when deleting data block, the bitmap by the data block in the bit map area to be clear
Zero, and discharge space of the data block in the resource-area, and add in data block deletion record table the number of the deletion
According to the index information of block, the information of the index of the data block is used for position of the data block in the bit map area for indicating the deletion
The position of figure and locus of the data block in the resource-area for indicating the deletion.
Then the index node configuration module 32, is additionally operable to when the index node in the bit map area being the file system
Assignment bit map and when being the index node distribution index node list item space of the file system in the resource-area, inquiry is described
Whether index node deletion record table is empty, if the index node deletion record table non-NULL, according to the index node
The bitmap of deleted index node and space are distributed to the file system by the index information in deletion record table again
The index node;
The data block configuration module 33, is additionally operable to when in data block distribution position of the bit map area for the file system
Scheme and when in data block allocation space of the resource-area for the file system, inquiring about the data block deletion record table is
No is sky, if the data block deletion record table non-NULL, according to the index information weight in the data block deletion record table
The new data block that the bitmap of deleted data block and space are distributed to the file system.
Above example, be functional module included by the configuration device from the memory space of file system it is constituted into
Gone citing, Fig. 8 for the configuration device of the memory space of the file system of the embodiment of the present invention hardware configuration composition schematic diagram.
As shown in figure 8, the configuration device of the memory space of the file system of the embodiment of the present invention may include on hardware composition:Memory
81 and processor 82, the processor 82 can call the relative program stored in the memory 81, and perform following steps:
For the file system assignment bit map area memory space and resource-area memory space;
When in index node assignment bit map of the bit map area for the file system, from the bit map area low address end
It is allocated to high address end direction, when the index node distribution index node list item in the resource-area being the file system
During space, it is allocated from the resource-area low address end to high address end direction;
When the bit map area be the file system data block assignment bit map when, from the bit map area high address end to
Low address extreme direction is allocated, when in data block allocation space of the resource-area for the file system, from the money
Source region high address end is allocated to low address extreme direction.
In some feasible embodiments, the processor 82 be the file system assignment bit map area memory space and
Resource-area memory space, is specifically included:
The size and number of the data block of the file system created according to user, calculate the bit map area size and
The size of the resource-area;
According to the size of the bit map area and the size of the resource-area, respectively described bit map area and the resource are distinguished
With correspondingly sized memory space.
In some feasible embodiments, it is the file system that the execution of processor 82, which is worked as in the bit map area,
During index node assignment bit map, it is allocated from the bit map area low address end to high address end direction, when in the resource-area
For the file system index node distribution index node list item space when, from the resource-area low address end to high address end
The step of direction is allocated, specifically includes:
When in index node assignment bit map of the bit map area for the root of the file system, from the bit map area
Low address end starts distribution to first bitmap in high address end direction;
When empty for the index node allocation space index node list item of the root of the file system in the resource-area
Between when, distributed since the low location end in the resource-area to first space in high address end direction;
The processor 82 is performed when being the data block assignment bit map of the file system in the bit map area, from described
Bit map area high address end is allocated to low address extreme direction, is distributed when in the resource-area for the data block of the file system
During space, the step of being allocated from the resource-area high address end to low address extreme direction specifically includes:
It is high from the bit map area when in data block assignment bit map of the bit map area for the root of the file system
Address end starts distribution to first bitmap of low address extreme direction;
It is high from the resource-area when in data block allocation space of the resource-area for the root of the file system
Location end starts distribution to first space of low address extreme direction.
In some feasible embodiments, the processor 82, which is performed described, to be the file system in the bit map area
During the index node assignment bit map of system, it is allocated from the bit map area low address end to high address end direction, when in the money
Source region for the file system index node distribution distribution index node list item space when, from the resource-area low address end to
The step of high address end direction is allocated, specifically includes:
When in index node assignment bit map of the bit map area for the file of the non-root of the file system, from institute
State bit map area low address end and travel through bitmap to high address end direction, until finding a first idle bitmap, by described first
Bitmap distributes to the index node of the file of the non-root;
Saved when being indexed in the resource-area for the index node allocation space of the file of the non-root of the file system
During point list item space, corresponding with first bitmap first is searched from the resource-area low address end to high address end direction empty
Between, and first space is distributed to the index node of the file of the non-root;
The processor 82 is performed when being the data block assignment bit map of the file system in the bit map area, from described
Bit map area high address end is allocated to low address extreme direction, is distributed when in the resource-area for the data block of the file system
During space, the step of being allocated from the resource-area high address end to low address extreme direction specifically includes:
When in data block assignment bit map of the bit map area for the file of the non-root of the file system, from described
Bit map area high address end travels through bitmap to low address extreme direction, until finding a second idle bitmap, is found described
Second bitmap distributes to the data block of the file of the non-root;
When in the data block allocation space of the resource-area for the file of the non-root of the file system, from
The resource-area high address end searches corresponding with second bitmap second space to low address extreme direction, and by described second
Distribute to the data block of the file of the non-root in space.
In some feasible embodiments, the processor 82, which is performed described, to be the file system in the bit map area
During the index node assignment bit map of system, it is allocated from the bit map area low address end to high address end direction, when in the money
Source region be the file system index node allocation space index node list item space when, from the resource-area low address end to
The step of high address end direction is allocated, specifically includes:
When in index node assignment bit map of the bit map area for the file of the non-root of the file system, by institute
Bit map area low address end is stated to next bitmap of last bitmap for being assigned as index node in high address end direction to divide
The index node of the file of non-root described in dispensing;
When in index node allocation space index node list item space of the resource-area for the file system, by institute
State resource-area low address end and be assigned as next sky in index node list item space to last of high address end direction
Between distribute to the non-root file the index node;
The processor 82 is performed when being the data block assignment bit map of the file system in the bit map area, from described
Bit map area high address end is allocated to low address extreme direction, is distributed when in the resource-area for the data block of the file system
Corresponding to the bitmap of the data block space when, the step being allocated from the resource-area high address end to low address extreme direction
Suddenly, specifically include:
, will be described when in data block assignment bit map of the bit map area for the file of the non-root of the file system
Bit map area high address end is distributed to next bitmap of last bitmap for being assigned as data block of low address extreme direction
The data block of the file of the non-root;
When in the data block allocation space of the resource-area for the file system, by the resource-area low address
Next space in last space for being assigned as data block to high address end direction is held to distribute to the non-root mesh
The data block of the file of record.
In some feasible embodiments, the processor 82 is also executed the following steps:
When deleting index node, the bitmap by the index node in the bit map area is reset, and discharges the index
Node adds in index node deletion record table the index node index letter of the deletion in the space of the resource-area
Breath, the index information of the index node be used to indicating the index node of the deletion in the position of the bitmap of the bit map area and
Indicate the index node of the deletion in the position of the index node list item of the resource-area;
When deleting data block, the bitmap by the data block in the bit map area is reset, and is discharged the data block and existed
The space of the resource-area, and add in data block deletion record table the index information of the data block of the deletion, the number
It is used to indicate that the data block of the deletion is deleted in the position of the bitmap of the bit map area with described in instruction according to the information of the index of block
Locus of the data block removed in the resource-area.
Then the processor 82 is worked as in the bit map area for the index node assignment bit map of the file system and described
When resource-area is the index node distribution index node list item space of the file system, following steps are specifically performed:
Whether be empty, if the index node deletion record table non-NULL if inquiring about the index node deletion record table,
Index information in the index node deletion record table again distributes the bitmap of deleted index node and space
The index node to the file system;
And the processor 82 is worked as in the bit map area for the data block assignment bit map of the file system and when in institute
When stating the data block allocation space that resource-area is the file system, following steps are specifically performed:
Whether be empty, if the data block deletion record table non-NULL, basis if inquiring about the data block deletion record table
The bitmap of deleted data block and space are distributed to the text by the index information in the data block deletion record table again
The data block of part system.
The module of the embodiment of the present invention, can use universal integrated circuit (such as central processor CPU), the controller based on FPGA
Or realized with application specific integrated circuit (ASIC).One of ordinary skill in the art will appreciate that in the various methods of above-described embodiment
All or part of step program is can be by instruct completing for correlation, that the program can be stored in one is computer-readable
In storage medium, storage medium can include:Flash disk, read-only storage(Read-Only Memory, ROM), arbitrary access
Device(Random Access Memory, RAM), disk or CD etc..
Enumerated above is only present pre-ferred embodiments, can not limit the right model of the present invention with this certainly
Enclose, therefore the equivalent variations made according to the claims in the present invention, still belong to the scope that the present invention is covered.
Claims (16)
1. a kind of collocation method of the memory space of file system, it is characterised in that including:
For the file system assignment bit map area memory space and resource-area memory space;
When in index node assignment bit map of the bit map area for the file system, from the bit map area low address end to height
Address extreme direction is allocated, when the index node distribution index node list item space in the resource-area being the file system
When, it is allocated from the resource-area low address end to high address end direction;
When in data block assignment bit map of the bit map area for the file system, from the bit map area high address end to low land
Location extreme direction is allocated, when in data block allocation space of the resource-area for the file system, from the resource-area
High address end is allocated to low address extreme direction;
Also include:
When deleting index node, the bitmap by the index node in the bit map area is reset, and discharges the index node
Space in the resource-area, and add in index node deletion record table the index node index information of the deletion, institute
Stating the index information of index node is used to indicate the index node of the deletion in the position of the bitmap of the bit map area and instruction
The index node of the deletion is in the position of the index node list item of the resource-area;
When deleting data block, the bitmap by the data block in the bit map area is reset, and discharges the data block described
The space of resource-area, and add in data block deletion record table the index information of the data block of the deletion, the data block
The information of index be used to indicate the data block of the deletion in the position of the bitmap of the bit map area and indicate the deletion
Locus of the data block in the resource-area;
Wherein, it is described when in index node assignment bit map of the bit map area for the file system, it is low from the bit map area
Address end is allocated to high address end direction, when the index node distribution index section in the resource-area being the file system
During point list item space, it is allocated from the resource-area low address end to high address end direction, including:
When in index node assignment bit map of the bit map area for the root of the file system, from the bit map area low land
Location end starts distribution to first bitmap in high address end direction;
When in index node allocation space index node list item space of the resource-area for the root of the file system,
Distributed since the low location end in the resource-area to first space in high address end direction;
It is described when the bit map area be the file system data block assignment bit map when, from the bit map area high address end to
Low address extreme direction is allocated, when in data block allocation space of the resource-area for the file system, from the money
Source region high address end is allocated to low address extreme direction, including:
When in data block assignment bit map of the bit map area for the root of the file system, from the bit map area high address
Hold to first bitmap of low address extreme direction and start distribution;
When in data block allocation space of the resource-area for the root of the file system, from the high location end in the resource-area
Start distribution to first space of low address extreme direction.
2. the collocation method of the memory space of file system as claimed in claim 1, it is characterised in that described is the file
System assignment bit map area's memory space and resource-area memory space, including:
The size and number of the data block of the file system created according to user, calculate the size of the bit map area and described
The size of resource-area;
According to the size of the bit map area and the size of the resource-area, phase is distributed in respectively described bit map area and the resource-area
Answer the memory space of size.
3. a kind of collocation method of the memory space of file system, it is characterised in that including:
For the file system assignment bit map area memory space and resource-area memory space;
When in index node assignment bit map of the bit map area for the file system, from the bit map area low address end to height
Address extreme direction is allocated, when the index node distribution index node list item space in the resource-area being the file system
When, it is allocated from the resource-area low address end to high address end direction;
When in data block assignment bit map of the bit map area for the file system, from the bit map area high address end to low land
Location extreme direction is allocated, when in data block allocation space of the resource-area for the file system, from the resource-area
High address end is allocated to low address extreme direction;
Also include:
When deleting index node, the bitmap by the index node in the bit map area is reset, and discharges the index node
Space in the resource-area, and add in index node deletion record table the index node index information of the deletion, institute
Stating the index information of index node is used to indicate the index node of the deletion in the position of the bitmap of the bit map area and instruction
The index node of the deletion is in the position of the index node list item of the resource-area;
When deleting data block, the bitmap by the data block in the bit map area is reset, and discharges the data block described
The space of resource-area, and add in data block deletion record table the index information of the data block of the deletion, the data block
The information of index be used to indicate the data block of the deletion in the position of the bitmap of the bit map area and indicate the deletion
Locus of the data block in the resource-area;
Wherein, it is described when in index node assignment bit map of the bit map area for the file system, it is low from the bit map area
Address end is allocated to high address end direction, when in index node distribution distribution rope of the resource-area for the file system
When drawing node list item space, it is allocated from the resource-area low address end to high address end direction, including:
When in index node assignment bit map of the bit map area for the file of the non-root of the file system, from institute's rheme
Figure area low address end travels through bitmap to high address end direction, until finding a first idle bitmap, by first bitmap
Distribute to the index node of the file of the non-root;
When in index node allocation space index node table of the resource-area for the file of the non-root of the file system
During item space, the first space corresponding with first bitmap is searched from the resource-area low address end to high address end direction,
And first space is distributed to the index node of the file of the non-root;
It is described when the bit map area be the file system data block assignment bit map when, from the bit map area high address end to
Low address extreme direction is allocated, when in data block allocation space of the resource-area for the file system, from the money
Source region high address end is allocated to low address extreme direction, including:
When in data block assignment bit map of the bit map area for the file of the non-root of the file system, from the bitmap
Area's high address end to low address extreme direction travel through bitmap, until finding a second idle bitmap, by it is described find second
Bitmap distributes to the data block of the file of the non-root;
When in the data block allocation space of the resource-area for the file of the non-root of the file system, from described
Resource-area high address end searches corresponding with second bitmap second space to low address extreme direction, and by the second space
Distribute to the data block of the file of the non-root.
4. the collocation method of the memory space of file system as claimed in claim 3, it is characterised in that described is the file
System assignment bit map area's memory space and resource-area memory space, including:
The size and number of the data block of the file system created according to user, calculate the size of the bit map area and described
The size of resource-area;
According to the size of the bit map area and the size of the resource-area, phase is distributed in respectively described bit map area and the resource-area
Answer the memory space of size.
5. a kind of collocation method of the memory space of file system, it is characterised in that including:
For the file system assignment bit map area memory space and resource-area memory space;
When in index node assignment bit map of the bit map area for the file system, from the bit map area low address end to height
Address extreme direction is allocated, when the index node distribution index node list item space in the resource-area being the file system
When, it is allocated from the resource-area low address end to high address end direction;
When in data block assignment bit map of the bit map area for the file system, from the bit map area high address end to low land
Location extreme direction is allocated, when in data block allocation space of the resource-area for the file system, from the resource-area
High address end is allocated to low address extreme direction;
Also include:
When deleting index node, the bitmap by the index node in the bit map area is reset, and discharges the index node
Space in the resource-area, and add in index node deletion record table the index node index information of the deletion, institute
Stating the index information of index node is used to indicate the index node of the deletion in the position of the bitmap of the bit map area and instruction
The index node of the deletion is in the position of the index node list item of the resource-area;
When deleting data block, the bitmap by the data block in the bit map area is reset, and discharges the data block described
The space of resource-area, and add in data block deletion record table the index information of the data block of the deletion, the data block
The information of index be used to indicate the data block of the deletion in the position of the bitmap of the bit map area and indicate the deletion
Locus of the data block in the resource-area;
Wherein, it is described when in index node assignment bit map of the bit map area for the file system, it is low from the bit map area
Address end is allocated to high address end direction, when the index node allocation space rope in the resource-area being the file system
When drawing node list item space, it is allocated from the resource-area low address end to high address end direction, including:
When in index node assignment bit map of the bit map area for the file of the non-root of the file system, by institute's rheme
Distributed to next bitmap of last bitmap for being assigned as index node in high address end direction at figure area low address end
The index node of the file of the non-root;
When in index node allocation space index node list item space of the resource-area for the file system, by the money
Source region low address end is divided to last next space for being assigned as index node list item space in high address end direction
The index node of the file of non-root described in dispensing;
It is described when the bit map area be the file system data block assignment bit map when, from the bit map area high address end to
Low address extreme direction is allocated, and corresponds to the data block when being distributed in the resource-area for the data block of the file system
Bitmap space when, be allocated from the resource-area high address end to low address extreme direction, including:
When in data block assignment bit map of the bit map area for the file of the non-root of the file system, by the bitmap
Area's high address end is distributed to described to next bitmap of last bitmap for being assigned as data block of low address extreme direction
The data block of the file of non-root;
When the resource-area be the file system the data block allocation space when, by the resource-area low address end to
Distribute to the non-root in next space that last of high address end direction has been assigned as the space of data block
The data block of file.
6. the collocation method of the memory space of file system as claimed in claim 5, it is characterised in that described is the file
System assignment bit map area's memory space and resource-area memory space, including:
The size and number of the data block of the file system created according to user, calculate the size of the bit map area and described
The size of resource-area;
According to the size of the bit map area and the size of the resource-area, phase is distributed in respectively described bit map area and the resource-area
Answer the memory space of size.
7. a kind of collocation method of the memory space of file system, it is characterised in that including:
For the file system assignment bit map area memory space and resource-area memory space;
When in index node assignment bit map of the bit map area for the file system, from the bit map area low address end to height
Address extreme direction is allocated, when the index node distribution index node list item space in the resource-area being the file system
When, it is allocated from the resource-area low address end to high address end direction;
When in data block assignment bit map of the bit map area for the file system, from the bit map area high address end to low land
Location extreme direction is allocated, when in data block allocation space of the resource-area for the file system, from the resource-area
High address end is allocated to low address extreme direction;
Also include:
When deleting index node, the bitmap by the index node in the bit map area is reset, and discharges the index node
Space in the resource-area, and add in index node deletion record table the index node index information of the deletion, institute
Stating the index information of index node is used to indicate the index node of the deletion in the position of the bitmap of the bit map area and instruction
The index node of the deletion is in the position of the index node list item of the resource-area;
When deleting data block, the bitmap by the data block in the bit map area is reset, and discharges the data block described
The space of resource-area, and add in data block deletion record table the index information of the data block of the deletion, the data block
The information of index be used to indicate the data block of the deletion in the position of the bitmap of the bit map area and indicate the deletion
Locus of the data block in the resource-area;
Wherein, in addition to:
It is the file system in the bit map area when the index node assignment bit map for being the file system and in the resource-area
During the index node distribution index node list item space of system, whether be empty, if institute if inquiring about the index node deletion record table
Index node deletion record table non-NULL is stated, then the index information in the index node deletion record table will be deleted again
Index node bitmap and space distribute to the index node of the file system;
When the data block assignment bit map in the bit map area being the file system and when in the resource-area being the file system
During the data block allocation space of system, whether be empty, if the data block deletion record if inquiring about the data block deletion record table
Table non-NULL, then the index information in the data block deletion record table is again by the bitmap of deleted data block and space
Distribute to the data block of the file system.
8. the collocation method of the memory space of file system as claimed in claim 7, it is characterised in that described is the file
System assignment bit map area's memory space and resource-area memory space, including:
The size and number of the data block of the file system created according to user, calculate the size of the bit map area and described
The size of resource-area;
According to the size of the bit map area and the size of the resource-area, phase is distributed in respectively described bit map area and the resource-area
Answer the memory space of size.
9. a kind of configuration device of the memory space of file system, it is characterised in that including:
Initial configuration module, for for the file system assignment bit map area memory space and resource-area memory space;
Index node configuration module, for when the bit map area be the file system index node assignment bit map when, from
The bit map area low address end is allocated to high address end direction, when the index section in the resource-area being the file system
During point distribution index node list item space, it is allocated from the resource-area low address end to high address end direction;
Data block configuration module, for when being the data block assignment bit map of the file system in the bit map area, from described
Bit map area high address end is allocated to low address extreme direction, is distributed when in the resource-area for the data block of the file system
During space, it is allocated from the resource-area high address end to low address extreme direction;
Also include:
Index node removing module, for when deleting index node, the bitmap by the index node in the bit map area to be clear
Zero, and space of the index node in the resource-area is discharged, and add the deletion in index node deletion record table
Index node index information, the index information of the index node is used for the index node for indicating the deletion in the bitmap
The position of the bitmap in area and the position for indicating index node list item of the index node of the deletion in the resource-area;
Data block removing module, for when deleting data block, the bitmap by the data block in the bit map area to be reset, and is released
Space of the data block in the resource-area is put, and adds in data block deletion record table the rope of the data block of the deletion
Fuse ceases, and the information of the index of the data block is used to indicating the data block of the deletion in the position of the bitmap of the bit map area
With locus of the data block in the resource-area for indicating the deletion;
Wherein, the index node configuration module, including:
Root index node configuration module, for when in index node of the bit map area for the root of the file system
During assignment bit map, distributed first bitmap since the bit map area low address end to high address end direction;And when in institute
When stating the index node allocation space index node list item space for the root that resource-area is the file system, from the resource
The low location end in area starts distribution to first space in high address end direction;
The data block configuration module, including:
Root data block configuration module, for when in data block distribution of the bit map area for the root of the file system
During bitmap, distributed since the bit map area high address end to first bitmap of low address extreme direction;And, when in the money
When source region is the data block allocation space of the root of the file system, from the high location end in the resource-area to low address extreme direction
First space start distribution.
10. the configuration device of the memory space of file system as claimed in claim 9, it is characterised in that the initial configuration
Module, including:
Computing module, for the size and number of the data block of the file system created according to user, calculates the bitmap
The size in area and the size of the resource-area;
Space partitioning module, for the size according to the bit map area and the size of the resource-area, respectively described bit map area
Correspondingly sized memory space is distributed with the resource-area.
11. a kind of configuration device of the memory space of file system, it is characterised in that including:
Initial configuration module, for for the file system assignment bit map area memory space and resource-area memory space;
Index node configuration module, for when the bit map area be the file system index node assignment bit map when, from
The bit map area low address end is allocated to high address end direction, when the index section in the resource-area being the file system
During point distribution index node list item space, it is allocated from the resource-area low address end to high address end direction;
Data block configuration module, for when being the data block assignment bit map of the file system in the bit map area, from described
Bit map area high address end is allocated to low address extreme direction, is distributed when in the resource-area for the data block of the file system
During space, it is allocated from the resource-area high address end to low address extreme direction;
Also include:
Index node removing module, for when deleting index node, the bitmap by the index node in the bit map area to be clear
Zero, and space of the index node in the resource-area is discharged, and add the deletion in index node deletion record table
Index node index information, the index information of the index node is used for the index node for indicating the deletion in the bitmap
The position of the bitmap in area and the position for indicating index node list item of the index node of the deletion in the resource-area;
Data block removing module, for when deleting data block, the bitmap by the data block in the bit map area to be reset, and is released
Space of the data block in the resource-area is put, and adds in data block deletion record table the rope of the data block of the deletion
Fuse ceases, and the information of the index of the data block is used to indicating the data block of the deletion in the position of the bitmap of the bit map area
With locus of the data block in the resource-area for indicating the deletion;
Wherein, the index node configuration module, including:
Non-root directory inode configuration module, for when in file of the bit map area for the non-root of the file system
Index node assignment bit map when, from the bit map area low address end to high address end direction travel through bitmap, until finding one
The first idle bitmap, first bitmap is distributed to the index node of the file of the non-root;And, when
When the resource-area is the index node allocation space index node list item space of the file of the non-root of the file system,
Search corresponding with first bitmap the first space from the resource-area low address end to high address end direction, and by described the
Distribute to the index node of the file of the non-root in one space;
The data block configuration module, including:
Non-root directory data block configuration module, for when the file for the non-root in the bit map area being the file system
During data block assignment bit map, bitmap is traveled through from the bit map area high address end to low address extreme direction, until finding a free time
The second bitmap, second bitmap found is distributed to the data block of the file of the non-root;And, when
It is high from the resource-area when resource-area is the data block allocation space of the file of the non-root of the file system
Second space corresponding with second bitmap is searched in address end to low address extreme direction, and the second space is distributed into institute
State the data block of the file of non-root.
12. the configuration device of the memory space of file system as claimed in claim 11, it is characterised in that the initial configuration
Module, including:
Computing module, for the size and number of the data block of the file system created according to user, calculates the bitmap
The size in area and the size of the resource-area;
Space partitioning module, for the size according to the bit map area and the size of the resource-area, respectively described bit map area
Correspondingly sized memory space is distributed with the resource-area.
13. a kind of configuration device of the memory space of file system, it is characterised in that including:
Initial configuration module, for for the file system assignment bit map area memory space and resource-area memory space;
Index node configuration module, for when the bit map area be the file system index node assignment bit map when, from
The bit map area low address end is allocated to high address end direction, when the index section in the resource-area being the file system
During point distribution index node list item space, it is allocated from the resource-area low address end to high address end direction;
Data block configuration module, for when being the data block assignment bit map of the file system in the bit map area, from described
Bit map area high address end is allocated to low address extreme direction, is distributed when in the resource-area for the data block of the file system
During space, it is allocated from the resource-area high address end to low address extreme direction;
Also include:
Index node removing module, for when deleting index node, the bitmap by the index node in the bit map area to be clear
Zero, and space of the index node in the resource-area is discharged, and add the deletion in index node deletion record table
Index node index information, the index information of the index node is used for the index node for indicating the deletion in the bitmap
The position of the bitmap in area and the position for indicating index node list item of the index node of the deletion in the resource-area;
Data block removing module, for when deleting data block, the bitmap by the data block in the bit map area to be reset, and is released
Space of the data block in the resource-area is put, and adds in data block deletion record table the rope of the data block of the deletion
Fuse ceases, and the information of the index of the data block is used to indicating the data block of the deletion in the position of the bitmap of the bit map area
With locus of the data block in the resource-area for indicating the deletion;
Wherein, the index node configuration module, including:
Non-root directory inode configuration module, for when in file of the bit map area for the non-root of the file system
Index node assignment bit map when, by the bit map area low address end to high address end direction last be assigned as index
Next bitmap of the bitmap of node distributes to the index node of the file of the non-root;And, when in the money
Source region be the file system index node allocation space index node list item space when, by the resource-area low address end to
Distribute to the non-root mesh in next space that last of high address end direction has been assigned as index node list item space
The index node of the file of record;
The data block configuration module, including:
Non-root directory data block configuration module, for when the file for the non-root in the bit map area being the file system
During data block assignment bit map, the bit map area high address end data block has been assigned as to last of low address extreme direction
Next bitmap of bitmap distributes to the data block of the file of the non-root;And, when being institute in the resource-area
When stating the data block allocation space of file system, by the resource-area low address end to high address end direction last
Be assigned as the space of data block next space distribute to the non-root file the data block.
14. the configuration device of the memory space of file system as claimed in claim 13, it is characterised in that the initial configuration
Module, including:
Computing module, for the size and number of the data block of the file system created according to user, calculates the bitmap
The size in area and the size of the resource-area;
Space partitioning module, for the size according to the bit map area and the size of the resource-area, respectively described bit map area
Correspondingly sized memory space is distributed with the resource-area.
15. a kind of configuration device of the memory space of file system, it is characterised in that including:
Initial configuration module, for for the file system assignment bit map area memory space and resource-area memory space;
Index node configuration module, for when the bit map area be the file system index node assignment bit map when, from
The bit map area low address end is allocated to high address end direction, when the index section in the resource-area being the file system
During point distribution index node list item space, it is allocated from the resource-area low address end to high address end direction;
Data block configuration module, for when being the data block assignment bit map of the file system in the bit map area, from described
Bit map area high address end is allocated to low address extreme direction, is distributed when in the resource-area for the data block of the file system
During space, it is allocated from the resource-area high address end to low address extreme direction;
Also include:
Index node removing module, for when deleting index node, the bitmap by the index node in the bit map area to be clear
Zero, and space of the index node in the resource-area is discharged, and add the deletion in index node deletion record table
Index node index information, the index information of the index node is used for the index node for indicating the deletion in the bitmap
The position of the bitmap in area and the position for indicating index node list item of the index node of the deletion in the resource-area;
Data block removing module, for when deleting data block, the bitmap by the data block in the bit map area to be reset, and is released
Space of the data block in the resource-area is put, and adds in data block deletion record table the rope of the data block of the deletion
Fuse ceases, and the information of the index of the data block is used to indicating the data block of the deletion in the position of the bitmap of the bit map area
With locus of the data block in the resource-area for indicating the deletion;
Wherein, the index node configuration module, is additionally operable to when in index node point of the bit map area for the file system
Coordination contour and when being the index node distribution index node list item space of the file system in the resource-area, inquires about the rope
Whether be empty, if the index node deletion record table non-NULL, is deleted according to the index node if drawing knot removal record sheet
Except the index information in record sheet again distributes to the bitmap of deleted index node and space the institute of the file system
State index node;
The data block configuration module, is additionally operable to when the data block assignment bit map in the bit map area being the file system and works as
When in the resource-area being the data block allocation space of the file system, inquire about the data block deletion record table whether be
Sky, if the data block deletion record table non-NULL, the index information in the data block deletion record table again will
The data block of the file system is distributed in the bitmap of deleted data block and space.
16. the configuration device of the memory space of file system as claimed in claim 15, it is characterised in that the initial configuration
Module, including:
Computing module, for the size and number of the data block of the file system created according to user, calculates the bitmap
The size in area and the size of the resource-area;
Space partitioning module, for the size according to the bit map area and the size of the resource-area, respectively described bit map area
Correspondingly sized memory space is distributed with the resource-area.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310750617.0A CN103714013B (en) | 2013-12-31 | 2013-12-31 | A kind of collocation method and device of the memory space of file system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310750617.0A CN103714013B (en) | 2013-12-31 | 2013-12-31 | A kind of collocation method and device of the memory space of file system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103714013A CN103714013A (en) | 2014-04-09 |
CN103714013B true CN103714013B (en) | 2017-08-25 |
Family
ID=50407010
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310750617.0A Active CN103714013B (en) | 2013-12-31 | 2013-12-31 | A kind of collocation method and device of the memory space of file system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103714013B (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104572828B (en) * | 2014-12-08 | 2018-01-19 | 中国科学院信息工程研究所 | A kind of secondary index method and system based on space bit map model |
CN105893266B (en) * | 2015-01-04 | 2020-04-28 | 伊姆西Ip控股有限责任公司 | Method and apparatus for reusing storage blocks of a file system |
CN104731872B (en) * | 2015-03-05 | 2018-04-03 | 长沙新弘软件有限公司 | Storage space management system and method based on bitmap |
WO2016191964A1 (en) * | 2015-05-29 | 2016-12-08 | 华为技术有限公司 | Management method and device of file system |
CN105138632A (en) * | 2015-08-20 | 2015-12-09 | 浪潮(北京)电子信息产业有限公司 | Organization and management method for file data and file management server |
CN106021127B (en) * | 2016-05-09 | 2020-01-14 | Tcl移动通信科技(宁波)有限公司 | Cache sharing method and system based on mobile terminal |
CN106021466A (en) * | 2016-05-17 | 2016-10-12 | 浙江大华技术股份有限公司 | Data storage method and apparatus |
CN106202350A (en) * | 2016-07-05 | 2016-12-07 | 浪潮(北京)电子信息产业有限公司 | A kind of distributed file system simplifies the method and system of configuration automatically |
CN106445589A (en) * | 2016-09-08 | 2017-02-22 | 百富计算机技术(深圳)有限公司 | Application loading method and apparatus for small embedded system |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5454103A (en) * | 1993-02-01 | 1995-09-26 | Lsc, Inc. | Method and apparatus for file storage allocation for secondary storage using large and small file blocks |
CN1766845A (en) * | 2005-11-30 | 2006-05-03 | 吴晓栋 | Method for realizing high security and recoverable file system |
CN101034399A (en) * | 2006-03-07 | 2007-09-12 | 日立系统服务公司 | Data management and control system in semiconductor flush memory and semiconductor flush memory accommodation apparatus |
CN101375280A (en) * | 2006-01-27 | 2009-02-25 | 艾尔弗莱斯科技术有限公司 | Event structured file system (ESFS) |
CN101382876A (en) * | 2008-10-07 | 2009-03-11 | 北京创毅视讯科技有限公司 | Data storage method |
CN102339318A (en) * | 2011-10-24 | 2012-02-01 | Tcl集团股份有限公司 | File system management method and system |
-
2013
- 2013-12-31 CN CN201310750617.0A patent/CN103714013B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5454103A (en) * | 1993-02-01 | 1995-09-26 | Lsc, Inc. | Method and apparatus for file storage allocation for secondary storage using large and small file blocks |
CN1766845A (en) * | 2005-11-30 | 2006-05-03 | 吴晓栋 | Method for realizing high security and recoverable file system |
CN101375280A (en) * | 2006-01-27 | 2009-02-25 | 艾尔弗莱斯科技术有限公司 | Event structured file system (ESFS) |
CN101034399A (en) * | 2006-03-07 | 2007-09-12 | 日立系统服务公司 | Data management and control system in semiconductor flush memory and semiconductor flush memory accommodation apparatus |
CN101382876A (en) * | 2008-10-07 | 2009-03-11 | 北京创毅视讯科技有限公司 | Data storage method |
CN102339318A (en) * | 2011-10-24 | 2012-02-01 | Tcl集团股份有限公司 | File system management method and system |
Also Published As
Publication number | Publication date |
---|---|
CN103714013A (en) | 2014-04-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103714013B (en) | A kind of collocation method and device of the memory space of file system | |
US9292217B2 (en) | Logical volume space sharing | |
CN105630955B (en) | A kind of data acquisition system member management method of high-efficiency dynamic | |
KR101994021B1 (en) | File manipulation method and apparatus | |
CN108804510A (en) | Key assignments file system | |
CN103229151B (en) | A kind of partition extension method and device | |
CN108491549B (en) | Method and device for creating file directory in distributed storage system | |
JP2015512551A (en) | A consistent ring namespace that facilitates data storage and organization in network infrastructure | |
CN105320775A (en) | Data access method and apparatus | |
CA2560215A1 (en) | Property tree for metadata navigation and assignment | |
WO2010099715A1 (en) | Method, system, client and data server for data operation | |
CN106682110B (en) | Image file storage and management system and method based on Hash grid index | |
CN103914522A (en) | Data block merging method applied to deleting duplicated data in cloud storage | |
CN110347651A (en) | Method of data synchronization, device, equipment and storage medium based on cloud storage | |
CN104750432B (en) | A kind of date storage method and device | |
CN107783988A (en) | The locking method and equipment of a kind of directory tree | |
US8180838B2 (en) | Efficiently managing modular data storage systems | |
CN105468644B (en) | Method and equipment for querying in database | |
CN106021466A (en) | Data storage method and apparatus | |
CN105718319B (en) | A kind of memory pool domain analytic method and memory pool device | |
TWI397060B (en) | Disk layout method for object-based storage device | |
CN106383826A (en) | Database checking method and apparatus | |
CN107368545A (en) | A kind of De-weight method and device based on MerkleTree deformation algorithms | |
CN103530067B (en) | A kind of method and apparatus of data manipulation | |
CN107832455A (en) | A kind of data capture method of storage object, system, equipment and storage medium |
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 |