CN103714013A - Method and device for allocating storage space of file system - Google Patents

Method and device for allocating storage space of file system Download PDF

Info

Publication number
CN103714013A
CN103714013A CN201310750617.0A CN201310750617A CN103714013A CN 103714013 A CN103714013 A CN 103714013A CN 201310750617 A CN201310750617 A CN 201310750617A CN 103714013 A CN103714013 A CN 103714013A
Authority
CN
China
Prior art keywords
area
bit map
data block
index node
file system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201310750617.0A
Other languages
Chinese (zh)
Other versions
CN103714013B (en
Inventor
李挺
王岩松
虞瑞荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310750617.0A priority Critical patent/CN103714013B/en
Publication of CN103714013A publication Critical patent/CN103714013A/en
Application granted granted Critical
Publication of CN103714013B publication Critical patent/CN103714013B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a method and device for allocating storage space of a file system. The method includes the steps of allocating bitmap area storage space and resource area storage space for the file system, when a bitmap is allocated for an inode of the file system through a bitmap area, carrying out allocation from the low-address end of the bitmap area to the high-address end of the bitmap area, when inode table entry space is allocated for the inode of the file system through a resource area, carrying out allocation from the low-address end of the resource area to the high-address end of the resource area, when a bitmap is allocated for a data block of the file system through the bitmap area, carrying out allocation from the high-address end of the bitmap area to the low-address end of the bitmap area, and when space is allocated to the data block of the file system through the resource area, carrying out allocation from the high-address end of the resource area to the low-address end of the resource area. By means of the method and device, the storage space of a storage device can be used to the maximum degree.

Description

A kind of collocation method of storage space of file system and device
Technical field
The present invention relates to digital processing field, relate in particular to a kind of collocation method and device of storage space of file system.
Background technology
Phase transition storage (Phase Change Memory, PCM), reluctance type random access storage device (Magnetoresistive Random Access Memory, MRAM) and variable resistance type storer (Resistive random-access memory, RRAM) be the novel storer occurring at present, they become the hot research object of industry with its unique performance, by industry, be referred to as storage level internal memory (Storage Class Memory, SCM).
SCM is different from traditional hard disk, except high readwrite performance, also has Byte changeability, and each read-write can only change very little data segment, can carry out fine-grained management.These novel storeies can be used for the data of memory file system at present.
File system is mainly used in data and the metadata of management and storage file, and what the distribution of the file of present most file system or the catalogue storage space in storer all adopted is the method for index node+data block.The metadata of storage file or catalogue and the data block number of file in index node, the particular content of storing documents or catalogue in corresponding data block.Each file or catalogue have an index node, according to file size, determine and need how many data blocks.
Current, file system based on SCM is all fixed for the boundary of each subregion, in ext4 file system, (brief note is: bitmap starting block inode), data block bitmap starting block, index node table starting block, data block starting block in superblock, just to have recorded index node.The mode of this fixed limit can be brought a problem.When small documents is too much, understands owing to there is no unnecessary index node, and cause the waste of data block; And when large file is a lot, can be because data block exhausts, unnecessary index node can not get using.Both of these case, all can cause the waste of the storage space of storer.
Summary of the invention
The embodiment of the present invention provides a kind of collocation method and device of storage space of file system, when fully meeting the memory allocation of file system, and can effectively sharp memory-aided storage space.
First aspect present invention provides a kind of collocation method of storage space of file system, and it can comprise:
For described file system assignment bit map district's storage space and resource-area storage space;
When the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node allocation index node list item space that is described file system in described resource-area, from described resource-area low address end, to high address end direction, distribute;
When the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block allocation space that is described file system in described resource-area, from described resource-area high address end, to low address extreme direction, distribute.
In conjunction with first aspect, in the feasible embodiment of the first, described is described file system assignment bit map district's storage space and resource-area storage space, can comprise:
Size and the number of the data block of the described file system creating according to user, calculate the size of described bit map area and the size of described resource-area;
According to the size of the size of described bit map area and described resource-area, be respectively described bit map area and the storage space of corresponding size is distributed in described resource-area.
In conjunction with the feasible embodiment of the first of first aspect or first aspect, in the feasible embodiment of the second, described when the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node allocation index node list item space that is described file system in described resource-area, from described resource-area low address end, to high address end direction, distribute, comprising:
When the index node assignment bit map of the root directory that is described file system in described bit map area, first bitmap from described bit map area low address end to high address end direction starts to distribute;
When the index node allocation space index node list item space of the root directory that is described file system in described resource-area, first space from low location, described resource-area end to high address end direction starts to distribute;
Described when the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block allocation space that is described file system in described resource-area, from described resource-area high address end, to low address extreme direction, distribute, comprising:
When the data block assignment bit map of the root directory that is described file system in described bit map area, first bitmap from described bit map area high address end to low address extreme direction starts to distribute;
When the data block allocation space of the root directory that is described file system in described resource-area, first space from high location, described resource-area end to low address extreme direction starts to distribute.
In conjunction with the feasible embodiment of the first of first aspect or first aspect, in the third feasible embodiment, described when the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node that is described file system in described resource-area distributes allocation index node list item space, from described resource-area low address end, to high address end direction, distribute, comprising:
When the index node assignment bit map of the file of the non-root directory that is described file system in described bit map area, the traversal bitmap from described bit map area low address end to high address end direction, until find a first idle bitmap, described the first bitmap is distributed to the described index node of the file of described non-root directory;
When the index node allocation space index node list item space of the file of the non-root directory that is described file system in described resource-area, from described resource-area low address end to high address end direction, search first space corresponding with described the first bitmap, and described the first allocation of space is given to the described index node of the file of described non-root directory;
Described when the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block allocation space that is described file system in described resource-area, from described resource-area high address end, to low address extreme direction, distribute, comprising:
When the data block assignment bit map of the file of the non-root directory that is described file system in described bit map area, the traversal bitmap from described bit map area high address end to low address extreme direction, until find a second idle bitmap, described the second bitmap finding is distributed to the described data block of the file of described non-root directory;
When the described data block allocation space of the file of the non-root directory that is described file system in described resource-area, from described resource-area high address end to low address extreme direction, search the second space corresponding with described the second bitmap, and described second space is distributed to the described data block of the file of described non-root directory.
In conjunction with the feasible embodiment of the first of first aspect or first aspect, in the 4th kind of feasible embodiment, described when the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node allocation space index node list item space that is described file system in described resource-area, from described resource-area low address end, to high address end direction, distribute, comprising:
When the index node assignment bit map of the file of the non-root directory that is described file system in described bit map area, the next bitmap that described bit map area low address end has been assigned as to the bitmap of index node to last of high address end direction is distributed to the described index node of the file of described non-root directory;
When the index node allocation space index node list item space that is described file system in described resource-area, described resource-area low address end has been assigned as to the next allocation of space in index node list item space to the described index node of the file of described non-root directory to last of high address end direction;
Described when the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block that is described file system in described resource-area is distributed the space corresponding to the bitmap of described data block, from described resource-area high address end, to low address extreme direction, distribute, comprising:
When the data block assignment bit map of the file of the non-root directory that is described file system in described bit map area, the next bitmap that described bit map area high address end has been assigned as to the bitmap of data block to last of low address extreme direction is distributed to the described data block of the file of described non-root directory;
When the described data block allocation space that is described file system in described resource-area, described resource-area low address end has been assigned as to the next allocation of space in space of data block to last of high address end direction to the described data block of the file of described non-root directory.
In conjunction with the feasible embodiment of the first of first aspect or first aspect, in the 5th kind of feasible embodiment, described method also can comprise:
When deleting index node, bitmap zero clearing by described index node in described bit map area, and discharge described index node in the space of described resource-area, and in index node deletion record table, adding the index node index information of described deletion, the index node that the index information of described index node is used to indicate described deletion is the position at the index node list item of described resource-area at the position of the bitmap of described bit map area and the index node of the described deletion of indication;
When deleting data block, bitmap zero clearing by described data block in described bit map area, and discharge described data block in the space of described resource-area, and in data block deletion record table, add the index information of the data block of described deletion, the information of the index of described data block is used to indicate the data block of described deletion in the position and the locus of indicating the data block of described deletion in described resource-area of the bitmap of described bit map area.
In conjunction with the 5th kind of feasible embodiment of first aspect, in the 6th kind of feasible embodiment, described method also can comprise:
When the index node assignment bit map that is described file system in described bit map area and the index node allocation index node list item space that is described file system in described resource-area, whether inquire about described index node deletion record table is empty, if described index node deletion record table non-NULL, gives the described index node of described file system by the bitmap of deleted index node and allocation of space again according to the index information in described index node deletion record table;
During when the data block assignment bit map that is described file system in described bit map area and when the data block allocation space that is described file system in described resource-area, whether inquire about described data block deletion record table is empty, if described data block deletion record table non-NULL, gives the bitmap of deleted data block and allocation of space the described data block of described file system again according to the index information in described data block deletion record table.
Second aspect present invention provides a kind of inking device of storage space of file system, and it can comprise:
Initial configuration module, is used to described file system assignment bit map district's storage space and resource-area storage space;
Index node configuration module, for when the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node allocation index node list item space that is described file system in described resource-area, from described resource-area low address end, to high address end direction, distribute;
Data block configuration module, for when the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block allocation space that is described file system in described resource-area, from described resource-area high address end, to low address extreme direction, distribute.
In conjunction with second aspect, in the feasible embodiment of the first, described initial configuration module, comprising:
Computing module, for according to size and the number of the data block of the described file system of user's establishment, calculates the size of described bit map area and the size of described resource-area;
Spatial division module, for according to the size of the size of described bit map area and described resource-area, is respectively described bit map area and the storage space of corresponding size is distributed in described resource-area.
In conjunction with the feasible embodiment of the first of second aspect or second aspect, in the feasible embodiment of the second, described index node configuration module, comprising:
Root directory index node configuration module, during for the index node assignment bit map of the root directory when being described file system in described bit map area, first bitmap from described bit map area low address end to high address end direction starts to distribute; And when the index node allocation space index node list item space of the root directory that is described file system in described resource-area, first space from low location, described resource-area end to high address end direction starts to distribute;
Described data block configuration module, comprising:
Root directory data block configuration module, during for the data block assignment bit map of the root directory when being described file system in described bit map area, first bitmap from described bit map area high address end to low address extreme direction starts to distribute; And when the data block allocation space of the root directory that is described file system in described resource-area, first space from high location, described resource-area end to low address extreme direction starts to distribute.
In conjunction with the feasible embodiment of the first of second aspect or second aspect, in the third feasible embodiment, described index node configuration module, comprising:
Non-root directory index node configuration module, during for index node assignment bit map when the file of the non-root directory that is described file system in described bit map area, the traversal bitmap from described bit map area low address end to high address end direction, until find a first idle bitmap, described the first bitmap is distributed to the described index node of the file of described non-root directory; And, when the index node allocation space index node list item space of the file of the non-root directory that is described file system in described resource-area, from described resource-area low address end to high address end direction, search first space corresponding with described the first bitmap, and described the first allocation of space is given to the described index node of the file of described non-root directory;
Described data block configuration module, comprising:
Non-root directory data block configuration module, during for data block assignment bit map when the file of the non-root directory that is described file system in described bit map area, the traversal bitmap from described bit map area high address end to low address extreme direction, until find a second idle bitmap, described the second bitmap finding is distributed to the described data block of the file of described non-root directory; And, when the described data block allocation space of the file of the non-root directory that is described file system in described resource-area, from described resource-area high address end to low address extreme direction, search the second space corresponding with described the second bitmap, and described second space is distributed to the described data block of the file of described non-root directory.
In conjunction with the feasible embodiment of the first of second aspect or second aspect, in the 4th kind of feasible embodiment, described index node configuration module, comprising:
Non-root directory index node configuration module, during for index node assignment bit map when the file of the non-root directory that is described file system in described bit map area, the next bitmap that described bit map area low address end has been assigned as to the bitmap of index node to last of high address end direction is distributed to the described index node of the file of described non-root directory; And, when the index node allocation space index node list item space that is described file system in described resource-area, described resource-area low address end has been assigned as to the next allocation of space in index node list item space to the described index node of the file of described non-root directory to last of high address end direction;
Described data block configuration module, comprising:
Non-root directory data block configuration module, during for data block assignment bit map when the file of the non-root directory that is described file system in described bit map area, the next bitmap that described bit map area high address end has been assigned as to the bitmap of data block to last of low address extreme direction is distributed to the described data block of the file of described non-root directory; And, when the described data block allocation space that is described file system in described resource-area, described resource-area low address end has been assigned as to the next allocation of space in space of data block to last of high address end direction to the described data block of the file of described non-root directory.
In conjunction with the feasible embodiment of the first of second aspect or second aspect, in the 5th kind of feasible embodiment, described device also comprises:
Index node removing module, for when deleting index node, bitmap zero clearing by described index node in described bit map area, and discharge described index node in the space of described resource-area, and in index node deletion record table, adding the index node index information of described deletion, the index node that the index information of described index node is used to indicate described deletion is the position at the index node list item of described resource-area at the position of the bitmap of described bit map area and the index node of the described deletion of indication;
Data block removing module, for when deleting data block, bitmap zero clearing by described data block in described bit map area, and discharge described data block in the space of described resource-area, and in data block deletion record table, add the index information of the data block of described deletion, the information of the index of described data block is used to indicate the data block of described deletion in the position and the locus of indicating the data block of described deletion in described resource-area of the bitmap of described bit map area.
The 5th kind of feasible embodiment in conjunction with second aspect, in the 6th kind of feasible embodiment, described index node configuration module, during also for the index node assignment bit map when being described file system in described bit map area and the index node allocation index node list item space that is described file system in described resource-area, whether inquire about described index node deletion record table is empty, if described index node deletion record table non-NULL, according to the index information in described index node deletion record table, again by the bitmap of deleted index node and allocation of space, give the described index node of described file system,
Described data block configuration module, also for the data block assignment bit map when being described file system in described bit map area and when the data block allocation space that is described file system in described resource-area, whether inquire about described data block deletion record table is empty, if described data block deletion record table non-NULL, gives the bitmap of deleted data block and allocation of space the described data block of described file system again according to the index information in described data block deletion record table.
Therefore, in feasible embodiments more of the present invention, be described file system assignment bit map district's storage space and resource-area storage space; When the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node allocation index node list item space that is described file system in described resource-area, from described resource-area low address end, to high address end direction, distribute; When the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block allocation space that is described file system in described resource-area, from described resource-area high address end, to low address extreme direction, distribute.Thus, the boundary in the space in bit map area and resource-area of the embodiment of the present invention not obvious restriction index node and data block, but flexibly the space of the space of bit map area and resource-area is shared to index node and data block, can maximally utilise the storage space of storer.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of an embodiment of collocation method of storage space of the file system of the embodiment of the present invention;
Fig. 2 is the storage space Configuration Framework schematic diagram of the file system of the embodiment of the present invention;
Fig. 3 is that the structure of an embodiment of inking device of storage space of the file system of the embodiment of the present invention forms schematic diagram;
Fig. 4 is that the structure of an embodiment of the initial configuration module 31 of the embodiment of the present invention forms schematic diagram;
Fig. 5 is that the structure of another embodiment of inking device of storage space of the file system of the embodiment of the present invention forms schematic diagram;
Fig. 6 is that the structure of another embodiment of inking device of storage space of the file system of the embodiment of the present invention forms schematic diagram;
Fig. 7 is that the structure of another embodiment of inking device of storage space of the file system of the embodiment of the present invention forms schematic diagram;
Fig. 8 is that the structure of another embodiment of inking device of storage space of the file system of the embodiment of the present invention forms schematic diagram.
Embodiment
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing, the present invention is described in further detail.
Fig. 1 is the schematic flow sheet of an embodiment of collocation method of storage space of the file system of the embodiment of the present invention.As shown in Figure 1, the method for the embodiment of the present invention can comprise:
Step S110 is described file system assignment bit map district's storage space and resource-area storage space.
In specific implementation, step S110 can carry out in the file system initialization stage.
As a kind of feasible embodiment, size and the number of the data block of the described file system that can create according to user at step S110, calculate the size of described bit map area and the size of described resource-area; Then, according to the size of the size of described bit map area and described resource-area, be respectively described bit map area and the storage space of corresponding size is distributed in described resource-area.
In specific implementation, at step S110, after being described file system assignment bit map district's storage space and resource-area storage space, the superblock of file system described in also can initialization, concrete, initialization superblock can be done following operation: the bitmap number that the start address of the start address of described bit map area, described resource-area, described bit map area are comprised, the information such as the space number that described resource-area comprises write described superblock.
Fig. 2 shows the building-block of logic that a kind of embodiment of the present invention is the file system after described file system assignment bit map district's storage space and resource-area storage space.As shown in Figure 2, the storage space of the file system of the embodiment of the present invention mainly comprises superblock, bit map area and resource-area three bulks, wherein, bit map area inner also indefinite division index node bit map area and data block bit map area, resource-area inner also indefinite division index node table district and data block district, therefore, in embodiment of the present invention bit map area, have living space and can share for index node and data block, in resource-area, have living space and can share for index node and data block.
Step S111, when the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node allocation index node list item space that is described file system in described resource-area, from described resource-area low address end, to high address end direction, distribute.
Step S112, when the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block allocation space that is described file system in described resource-area, from described resource-area high address end, to low address extreme direction, distribute.
In specific implementation, step S111 and step S112 be order in no particular order.
In specific implementation, in the embodiment of the present invention herein and the comprising of follow-up mentioned assignment bit map: by described bitmap set, occupied to represent described bitmap.The value of described set can be any one pre-set numeral or alphabetical.Such as, can set when bitmap is set to " 1 ", represent that corresponding bitmap is assigned with.
In some feasible embodiments, at step S111, when the index node assignment bit map of the root directory that is described file system in described bit map area, first bitmap from described bit map area low address end to high address end direction starts to distribute; When the index node allocation space index node list item space of the root directory that is described file system in described resource-area, first space from low location, described resource-area end to high address end direction starts to distribute.And at step S112, when the data block assignment bit map of the root directory that is described file system in described bit map area, first bitmap from described bit map area high address end to low address extreme direction starts to distribute; And when the data block allocation space of the root directory that is described file system in described resource-area, first space from high location, described resource-area end to low address extreme direction starts to distribute.
In some feasible embodiments, at step S111, when the index node assignment bit map of the file of the non-root directory that is described file system in described bit map area, the traversal bitmap from described bit map area low address end to high address end direction, until find a first idle bitmap, described the first bitmap is distributed to the described index node of the file of described non-root directory; When the index node allocation space index node list item space of the file of the non-root directory that is described file system in described resource-area, from described resource-area low address end to high address end direction, search first space corresponding with described the first bitmap, and described the first allocation of space is given to the described index node of the file of described non-root directory.In specific implementation, this mode can be used in the situation of index node release.In specific implementation, in this scheme, from described bit map area low address end to high address end direction, before traversal bitmap, whether the number that can first inquire about the deleted index node recording in superblock is zero, if non-zero, traversal.
In some feasible embodiments, at step S112, when the data block assignment bit map of the file of the non-root directory that is described file system in described bit map area, the traversal bitmap from described bit map area high address end to low address extreme direction, until find a second idle bitmap, described the second bitmap finding is distributed to the described data block of the file of described non-root directory; And, when the described data block allocation space of the file of the non-root directory that is described file system in described resource-area, from described resource-area high address end to low address extreme direction, search the second space corresponding with described the second bitmap, and described second space is distributed to the described data block of the file of described non-root directory.In specific implementation, this mode can be used in the situation of data block release.In specific implementation, in this scheme, from described bit map area high address end to low address extreme direction, before traversal bitmap, whether the number that can first inquire about the deleted data block recording in superblock is zero, if non-zero, traversal.
In some feasible embodiments, at step S111, when the index node assignment bit map of the file of the non-root directory that is described file system in described bit map area, the next bitmap that described bit map area low address end has been assigned as to the bitmap of index node to last of high address end direction is distributed to the described index node of the file of described non-root directory; When the index node allocation space index node list item space that is described file system in described resource-area, described resource-area low address end has been assigned as to the next allocation of space in index node list item space to the described index node of the file of described non-root directory to last of high address end direction.In specific implementation, this mode can be used in the situation that index node discharges or in situation about discharging without index node.
In some feasible embodiments, at step S112, when the data block assignment bit map of the file of the non-root directory that is described file system in described bit map area, the next bitmap that described bit map area high address end has been assigned as to the bitmap of data block to last of low address extreme direction is distributed to the described data block of the file of described non-root directory; When the described data block allocation space that is described file system in described resource-area, described resource-area low address end has been assigned as to the next allocation of space in space of data block to last of high address end direction to the described data block of the file of described non-root directory.In specific implementation, this mode can be used in the situation that data block discharges or in situation about discharging without data block.
In some feasible embodiments, the method for the embodiment of the present invention, also can comprise (not shown):
When deleting index node, bitmap zero clearing by described index node in described bit map area, and discharge described index node in the space of described resource-area, and in index node deletion record table, adding the index node index information of described deletion, the index node that the index information of described index node is used to indicate described deletion is the position at the index node list item of described resource-area at the position of the bitmap of described bit map area and the index node of the described deletion of indication;
When deleting data block, bitmap zero clearing by described data block in described bit map area, and discharge described data block in the space of described resource-area, and in data block deletion record table, add the index information of the data block of described deletion, the information of the index of described data block is used to indicate the data block of described deletion in the position and the locus of indicating the data block of described deletion in described resource-area of the bitmap of described bit map area.
Like this, the embodiment of the present invention is at step S111, when the index node assignment bit map that is described file system in described bit map area and the index node allocation index node list item space that is described file system in described resource-area, whether inquire about described index node deletion record table is empty, if described index node deletion record table non-NULL, gives the described index node of described file system by the bitmap of deleted index node and allocation of space again according to the index information in described index node deletion record table.And, the embodiment of the present invention, at step S112, during when the data block assignment bit map that is described file system in described bit map area and when the data block allocation space that is described file system in described resource-area, whether inquire about described data block deletion record table is empty, if described data block deletion record table non-NULL, gives the bitmap of deleted data block and allocation of space the described data block of described file system again according to the index information in described data block deletion record table.
In conjunction with Fig. 2, suppose, arrow 1 be oriented to bit map area low address end to high address end direction, arrow 2 be oriented to bit map area high address end to low address extreme direction, arrow 3 be 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, in conjunction with Fig. 2, just can know, the bitmap of the index node of the embodiment of the present invention is to start assignment bit map from the reference position of arrow 1 (from low address end to high address end direction), and the bitmap of data block to be reference position (from high address end to low address extreme direction) from arrow 2 start to distribute, like this, the bitmap of index node and the bitmap of data block are drawn close to centre from both sides, have avoided the defect of the space waste of obvious boundary.Equally, in conjunction with Fig. 2, just can know, the index node list item of the index node of the embodiment of the present invention is that the reference position (from low address end to high address end direction) from arrow 3 starts allocation space, data block is to start allocation space from the reference position of arrow 4 (from high address end to low address extreme direction), like this, index node list item and the data block of index node are drawn close to centre from both sides, resource-area, have avoided the defect of the space waste of obvious boundary.
Therefore, in feasible embodiments more of the present invention, be described file system assignment bit map district's storage space and resource-area storage space; When the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node allocation index node list item space that is described file system in described resource-area, from described resource-area low address end, to high address end direction, distribute; When the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block allocation space that is described file system in described resource-area, from described resource-area high address end, to low address extreme direction, distribute.Thus, the boundary in the space in bit map area and resource-area of the embodiment of the present invention not obvious restriction index node and data block, but flexibly the space of the space of bit map area and resource-area is shared to index node and data block, can maximally utilise the storage space of storer.
Accordingly, the embodiment of the present invention also provides the device of the collocation method of the storage space that can be used for implementing file system of the present invention, below device embodiment is illustrated.
Fig. 3 is that the structure of an embodiment of inking device of storage space of the file system of the embodiment of the present invention forms schematic diagram.As shown in Figure 3, the inking device of the storage space of the file system of the embodiment of the present invention can comprise: initial configuration module 31, index node configuration module 32 and data block configuration module 33, wherein:
Initial configuration module 31, is used to described file system assignment bit map district's storage space and resource-area storage space.
Index node configuration module 32, for when the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node allocation index node list item space that is described file system in described resource-area, from described resource-area low address end, to high address end direction, distribute;
Data block configuration module 33, for when the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block allocation space that is described file system in described resource-area, from described resource-area high address end, to low address extreme direction, distribute.
In specific implementation, initial configuration module 31 can be described file system assignment bit map district's storage space and resource-area storage space in the file system initialization stage.
In some feasible embodiments, as shown in Figure 4, the initial configuration module 31 of the embodiment of the present invention can further comprise:
Computing module 311, for according to size and the number of the data block of the described file system of user's establishment, calculates the size of described bit map area and the size of described resource-area;
Spatial division module 312, for according to the size of the size of described bit map area and described resource-area, is respectively described bit map area and the storage space of corresponding size is distributed in described resource-area.
In specific implementation, the initial configuration module 31 of the embodiment of the present invention is also used in as after described file system assignment bit map district's storage space and resource-area storage space, the superblock of file system described in initialization, concrete, initialization superblock can be done following operation: the bitmap number that the start address of the start address of described bit map area, described resource-area, described bit map area are comprised, the information such as the space number that described resource-area comprises write described superblock.
As shown in Figure 5, in some feasible embodiments, described index node configuration module 32, can comprise:
Root directory index node configuration module 321, during for the index node assignment bit map of the root directory when being described file system in described bit map area, first bitmap from described bit map area low address end to high address end direction starts to distribute; And when the index node allocation space index node list item space of the root directory that is described file system in described resource-area, first space from low location, described resource-area end to high address end direction starts to distribute;
Non-root directory index node configuration module 322, during for index node assignment bit map when the file of the non-root directory that is described file system in described bit map area, the traversal bitmap from described bit map area low address end to high address end direction, until find a first idle bitmap, described the first bitmap is distributed to the described index node of the file of described non-root directory; And, when the index node allocation space index node list item space of the file of the non-root directory that is described file system in described resource-area, from described resource-area low address end to high address end direction, search first space corresponding with described the first bitmap, and described the first allocation of space is given to the described index node of the file of described non-root directory;
Described data block configuration module 33, comprising:
Root directory data block configuration module 331, during for the data block assignment bit map of the root directory when being described file system in described bit map area, first bitmap from described bit map area high address end to low address extreme direction starts to distribute; And when the data block allocation space of the root directory that is described file system in described resource-area, first space from high location, described resource-area end to low address extreme direction starts to distribute.
Non-root directory data block configuration module 332, during for data block assignment bit map when the file of the non-root directory that is described file system in described bit map area, the traversal bitmap from described bit map area high address end to low address extreme direction, until find a second idle bitmap, described the second bitmap finding is distributed to the described data block of the file of described non-root directory; And, when the described data block allocation space of the file of the non-root directory that is described file system in described resource-area, from described resource-area high address end to low address extreme direction, search the second space corresponding with described the second bitmap, and described second space is distributed to the described data block of the file of described non-root directory.
As shown in Figure 6, in some feasible embodiments, described index node configuration module 32, can comprise:
Root directory index node configuration module 321, during for the index node assignment bit map of the root directory when being described file system in described bit map area, first bitmap from described bit map area low address end to high address end direction starts to distribute; And when the index node allocation space index node list item space of the root directory that is described file system in described resource-area, first space from low location, described resource-area end to high address end direction starts to distribute;
Non-root directory index node configuration module 323, during for index node assignment bit map when the file of the non-root directory that is described file system in described bit map area, the next bitmap that described bit map area low address end has been assigned as to the bitmap of index node to last of high address end direction is distributed to the described index node of the file of described non-root directory; And, when the index node allocation space index node list item space that is described file system in described resource-area, described resource-area low address end has been assigned as to the next allocation of space in index node list item space to the described index node of the file of described non-root directory to last of high address end direction;
Described data block configuration module 33, comprising:
Root directory data block configuration module 331, during for the data block assignment bit map of the root directory when being described file system in described bit map area, first bitmap from described bit map area high address end to low address extreme direction starts to distribute; And when the data block allocation space of the root directory that is described file system in described resource-area, first space from high location, described resource-area end to low address extreme direction starts to distribute.
Non-root directory data block configuration module 333, during for data block assignment bit map when the file of the non-root directory that is described file system in described bit map area, the next bitmap that described bit map area high address end has been assigned as to the bitmap of data block to last of low address extreme direction is distributed to the described data block of the file of described non-root directory; And, when the described data block allocation space that is described file system in described resource-area, described resource-area low address end has been assigned as to the next allocation of space in space of data block to last of high address end direction to the described data block of the file of described non-root directory.
As shown in Figure 7, in some feasible embodiments, the device of the embodiment of the present invention also can comprise:
Index node removing module 34, for when deleting index node, bitmap zero clearing by described index node in described bit map area, and discharge described index node in the space of described resource-area, and in index node deletion record table, adding the index node index information of described deletion, the index node that the index information of described index node is used to indicate described deletion is the position at the index node list item of described resource-area at the position of the bitmap of described bit map area and the index node of the described deletion of indication;
Data block removing module 35, for when deleting data block, bitmap zero clearing by described data block in described bit map area, and discharge described data block in the space of described resource-area, and in data block deletion record table, add the index information of the data block of described deletion, the information of the index of described data block is used to indicate the data block of described deletion in the position and the locus of indicating the data block of described deletion in described resource-area of the bitmap of described bit map area.
Described index node configuration module 32, during also for the index node assignment bit map when being described file system in described bit map area and the index node allocation index node list item space that is described file system in described resource-area, whether inquire about described index node deletion record table is empty, if described index node deletion record table non-NULL, gives the described index node of described file system by the bitmap of deleted index node and allocation of space again according to the index information in described index node deletion record table;
Described data block configuration module 33, also for the data block assignment bit map when being described file system in described bit map area and when the data block allocation space that is described file system in described resource-area, whether inquire about described data block deletion record table is empty, if described data block deletion record table non-NULL, gives the bitmap of deleted data block and allocation of space the described data block of described file system again according to the index information in described data block deletion record table.
Above embodiment, is from the included functional module of inking device of the storage space of file system, its composition to be given an example, and the hardware configuration of the inking device of the storage space of the file system that Fig. 8 is the embodiment of the present invention forms schematic diagram.As shown in Figure 8, the inking device of the storage space of the file system of the embodiment of the present invention can comprise on hardware forms: storer 81 and processor 82, and described processor 82 can call the relative program of storage in described storer 81, and carries out following steps:
For described file system assignment bit map district's storage space and resource-area storage space;
When the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node allocation index node list item space that is described file system in described resource-area, from described resource-area low address end, to high address end direction, distribute;
When the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block allocation space that is described file system in described resource-area, from described resource-area high address end, to low address extreme direction, distribute.
In some feasible embodiments, described processor 82 is described file system assignment bit map district's storage space and resource-area storage space, specifically comprises:
Size and the number of the data block of the described file system creating according to user, calculate the size of described bit map area and the size of described resource-area;
According to the size of the size of described bit map area and described resource-area, be respectively described bit map area and the storage space of corresponding size is distributed in described resource-area.
In some feasible embodiments, described processor 82 is carried out when the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node allocation index node list item space that is described file system in described resource-area, the step of distributing to high address end direction from described resource-area low address end, specifically comprises:
When the index node assignment bit map of the root directory that is described file system in described bit map area, first bitmap from described bit map area low address end to high address end direction starts to distribute;
When the index node allocation space index node list item space of the root directory that is described file system in described resource-area, first space from low location, described resource-area end to high address end direction starts to distribute;
Described processor 82 is carried out when the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block allocation space that is described file system in described resource-area, the step of distributing to low address extreme direction from described resource-area high address end, specifically comprises:
When the data block assignment bit map of the root directory that is described file system in described bit map area, first bitmap from described bit map area high address end to low address extreme direction starts to distribute;
When the data block allocation space of the root directory that is described file system in described resource-area, first space from high location, described resource-area end to low address extreme direction starts to distribute.
In some feasible embodiments, described processor 82 is carried out described when the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node that is described file system in described resource-area distributes allocation index node list item space, the step of distributing to high address end direction from described resource-area low address end, specifically comprises:
When the index node assignment bit map of the file of the non-root directory that is described file system in described bit map area, the traversal bitmap from described bit map area low address end to high address end direction, until find a first idle bitmap, described the first bitmap is distributed to the described index node of the file of described non-root directory;
When the index node allocation space index node list item space of the file of the non-root directory that is described file system in described resource-area, from described resource-area low address end to high address end direction, search first space corresponding with described the first bitmap, and described the first allocation of space is given to the described index node of the file of described non-root directory;
Described processor 82 is carried out when the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block allocation space that is described file system in described resource-area, the step of distributing to low address extreme direction from described resource-area high address end, specifically comprises:
When the data block assignment bit map of the file of the non-root directory that is described file system in described bit map area, the traversal bitmap from described bit map area high address end to low address extreme direction, until find a second idle bitmap, described the second bitmap finding is distributed to the described data block of the file of described non-root directory;
When the described data block allocation space of the file of the non-root directory that is described file system in described resource-area, from described resource-area high address end to low address extreme direction, search the second space corresponding with described the second bitmap, and described second space is distributed to the described data block of the file of described non-root directory.
In some feasible embodiments, described processor 82 is carried out described when the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node allocation space index node list item space that is described file system in described resource-area, the step of distributing to high address end direction from described resource-area low address end, specifically comprises:
When the index node assignment bit map of the file of the non-root directory that is described file system in described bit map area, the next bitmap that described bit map area low address end has been assigned as to the bitmap of index node to last of high address end direction is distributed to the described index node of the file of described non-root directory;
When the index node allocation space index node list item space that is described file system in described resource-area, described resource-area low address end has been assigned as to the next allocation of space in index node list item space to the described index node of the file of described non-root directory to last of high address end direction;
Described processor 82 is carried out when the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block that is described file system in described resource-area is distributed the space corresponding to the bitmap of described data block, the step of distributing to low address extreme direction from described resource-area high address end, specifically comprises:
When the data block assignment bit map of the file of the non-root directory that is described file system in described bit map area, the next bitmap that described bit map area high address end has been assigned as to the bitmap of data block to last of low address extreme direction is distributed to the described data block of the file of described non-root directory;
When the described data block allocation space that is described file system in described resource-area, described resource-area low address end has been assigned as to the next allocation of space in space of data block to last of high address end direction to the described data block of the file of described non-root directory.
In some feasible embodiments, described processor 82 is also carried out following steps:
When deleting index node, bitmap zero clearing by described index node in described bit map area, and discharge described index node in the space of described resource-area, and in index node deletion record table, adding the index node index information of described deletion, the index node that the index information of described index node is used to indicate described deletion is the position at the index node list item of described resource-area at the position of the bitmap of described bit map area and the index node of the described deletion of indication;
When deleting data block, bitmap zero clearing by described data block in described bit map area, and discharge described data block in the space of described resource-area, and in data block deletion record table, add the index information of the data block of described deletion, the information of the index of described data block is used to indicate the data block of described deletion in the position and the locus of indicating the data block of described deletion in described resource-area of the bitmap of described bit map area.
Described processor 82, when the index node assignment bit map that is described file system in described bit map area and the index node allocation index node list item space that is described file system in described resource-area, is specifically carried out following steps:
Whether inquire about described index node deletion record table is empty, if described index node deletion record table non-NULL, gives the described index node of described file system by the bitmap of deleted index node and allocation of space again according to the index information in described index node deletion record table;
And described processor 82 is during when the data block assignment bit map that is described file system in described bit map area and when the data block allocation space that is described file system in described resource-area, specifically carries out following steps:
Whether inquire about described data block deletion record table is empty, if described data block deletion record table non-NULL, gives the bitmap of deleted data block and allocation of space the described data block of described file system again according to the index information in described data block deletion record table.
The module of the embodiment of the present invention, available universal integrated circuit (as central processor CPU), the controller based on FPGA or realize with special IC (ASIC).One of ordinary skill in the art will appreciate that all or part of step in the whole bag of tricks of above-described embodiment is to carry out relevant the completing of instruction by program, this program can be stored in a computer-readable recording medium, storage medium can comprise: flash disk, ROM (read-only memory) (Read-Only Memory, ROM), random access device (Random Access Memory, RAM), disk or CD etc.
Cited is only preferred embodiment of the present invention above, certainly can not limit with this interest field of the present invention, and the equivalent variations of therefore doing according to the claims in the present invention, still belongs to the scope that the present invention is contained.

Claims (14)

1. a collocation method for the storage space of file system, is characterized in that, comprising:
For described file system assignment bit map district's storage space and resource-area storage space;
When the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node allocation index node list item space that is described file system in described resource-area, from described resource-area low address end, to high address end direction, distribute;
When the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block allocation space that is described file system in described resource-area, from described resource-area high address end, to low address extreme direction, distribute.
2. the collocation method of the storage space of file system as claimed in claim 1, is characterized in that, described is described file system assignment bit map district's storage space and resource-area storage space, comprising:
Size and the number of the data block of the described file system creating according to user, calculate the size of described bit map area and the size of described resource-area;
According to the size of the size of described bit map area and described resource-area, be respectively described bit map area and the storage space of corresponding size is distributed in described resource-area.
3. the collocation method of the storage space of file system as claimed in claim 1 or 2, is characterized in that,
Described when the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node allocation index node list item space that is described file system in described resource-area, from described resource-area low address end, to high address end direction, distribute, comprising:
When the index node assignment bit map of the root directory that is described file system in described bit map area, first bitmap from described bit map area low address end to high address end direction starts to distribute;
When the index node allocation space index node list item space of the root directory that is described file system in described resource-area, first space from low location, described resource-area end to high address end direction starts to distribute;
Described when the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block allocation space that is described file system in described resource-area, from described resource-area high address end, to low address extreme direction, distribute, comprising:
When the data block assignment bit map of the root directory that is described file system in described bit map area, first bitmap from described bit map area high address end to low address extreme direction starts to distribute;
When the data block allocation space of the root directory that is described file system in described resource-area, first space from high location, described resource-area end to low address extreme direction starts to distribute.
4. the collocation method of the storage space of file system as claimed in claim 1 or 2, is characterized in that,
Described when the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node that is described file system in described resource-area distributes allocation index node list item space, from described resource-area low address end, to high address end direction, distribute, comprising:
When the index node assignment bit map of the file of the non-root directory that is described file system in described bit map area, the traversal bitmap from described bit map area low address end to high address end direction, until find a first idle bitmap, described the first bitmap is distributed to the described index node of the file of described non-root directory;
When the index node allocation space index node list item space of the file of the non-root directory that is described file system in described resource-area, from described resource-area low address end to high address end direction, search first space corresponding with described the first bitmap, and described the first allocation of space is given to the described index node of the file of described non-root directory;
Described when the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block allocation space that is described file system in described resource-area, from described resource-area high address end, to low address extreme direction, distribute, comprising:
When the data block assignment bit map of the file of the non-root directory that is described file system in described bit map area, the traversal bitmap from described bit map area high address end to low address extreme direction, until find a second idle bitmap, described the second bitmap finding is distributed to the described data block of the file of described non-root directory;
When the described data block allocation space of the file of the non-root directory that is described file system in described resource-area, from described resource-area high address end to low address extreme direction, search the second space corresponding with described the second bitmap, and described second space is distributed to the described data block of the file of described non-root directory.
5. the collocation method of the storage space of file system as claimed in claim 1 or 2, is characterized in that,
Described when the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node allocation space index node list item space that is described file system in described resource-area, from described resource-area low address end, to high address end direction, distribute, comprising:
When the index node assignment bit map of the file of the non-root directory that is described file system in described bit map area, the next bitmap that described bit map area low address end has been assigned as to the bitmap of index node to last of high address end direction is distributed to the described index node of the file of described non-root directory;
When the index node allocation space index node list item space that is described file system in described resource-area, described resource-area low address end has been assigned as to the next allocation of space in index node list item space to the described index node of the file of described non-root directory to last of high address end direction;
Described when the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block that is described file system in described resource-area is distributed the space corresponding to the bitmap of described data block, from described resource-area high address end, to low address extreme direction, distribute, comprising:
When the data block assignment bit map of the file of the non-root directory that is described file system in described bit map area, the next bitmap that described bit map area high address end has been assigned as to the bitmap of data block to last of low address extreme direction is distributed to the described data block of the file of described non-root directory;
When the described data block allocation space that is described file system in described resource-area, described resource-area low address end has been assigned as to the next allocation of space in space of data block to last of high address end direction to the described data block of the file of described non-root directory.
6. the collocation method of the storage space of file system as claimed in claim 1 or 2, is characterized in that, also comprises:
When deleting index node, bitmap zero clearing by described index node in described bit map area, and discharge described index node in the space of described resource-area, and in index node deletion record table, adding the index node index information of described deletion, the index node that the index information of described index node is used to indicate described deletion is the position at the index node list item of described resource-area at the position of the bitmap of described bit map area and the index node of the described deletion of indication;
When deleting data block, bitmap zero clearing by described data block in described bit map area, and discharge described data block in the space of described resource-area, and in data block deletion record table, add the index information of the data block of described deletion, the information of the index of described data block is used to indicate the data block of described deletion in the position and the locus of indicating the data block of described deletion in described resource-area of the bitmap of described bit map area.
7. the collocation method of the storage space of file system as claimed in claim 6, is characterized in that, also comprises:
When the index node assignment bit map that is described file system in described bit map area and the index node allocation index node list item space that is described file system in described resource-area, whether inquire about described index node deletion record table is empty, if described index node deletion record table non-NULL, gives the described index node of described file system by the bitmap of deleted index node and allocation of space again according to the index information in described index node deletion record table;
During when the data block assignment bit map that is described file system in described bit map area and when the data block allocation space that is described file system in described resource-area, whether inquire about described data block deletion record table is empty, if described data block deletion record table non-NULL, gives the bitmap of deleted data block and allocation of space the described data block of described file system again according to the index information in described data block deletion record table.
8. an inking device for the storage space of file system, is characterized in that, comprising:
Initial configuration module, is used to described file system assignment bit map district's storage space and resource-area storage space;
Index node configuration module, for when the index node assignment bit map that is described file system in described bit map area, from described bit map area low address end, to high address end direction, distribute, when the index node allocation index node list item space that is described file system in described resource-area, from described resource-area low address end, to high address end direction, distribute;
Data block configuration module, for when the data block assignment bit map that is described file system in described bit map area, from described bit map area high address end, to low address extreme direction, distribute, when the data block allocation space that is described file system in described resource-area, from described resource-area high address end, to low address extreme direction, distribute.
9. the inking device of the storage space of file system as claimed in claim 8, is characterized in that, described initial configuration module, comprising:
Computing module, for according to size and the number of the data block of the described file system of user's establishment, calculates the size of described bit map area and the size of described resource-area;
Spatial division module, for according to the size of the size of described bit map area and described resource-area, is respectively described bit map area and the storage space of corresponding size is distributed in described resource-area.
10. the inking device of the storage space of file system as claimed in claim 8 or 9, is characterized in that, described index node configuration module, comprising:
Root directory index node configuration module, during for the index node assignment bit map of the root directory when being described file system in described bit map area, first bitmap from described bit map area low address end to high address end direction starts to distribute; And when the index node allocation space index node list item space of the root directory that is described file system in described resource-area, first space from low location, described resource-area end to high address end direction starts to distribute;
Described data block configuration module, comprising:
Root directory data block configuration module, during for the data block assignment bit map of the root directory when being described file system in described bit map area, first bitmap from described bit map area high address end to low address extreme direction starts to distribute; And when the data block allocation space of the root directory that is described file system in described resource-area, first space from high location, described resource-area end to low address extreme direction starts to distribute.
11. inking devices of the storage space of file system as claimed in claim 8 or 9, is characterized in that, described index node configuration module, comprising:
Non-root directory index node configuration module, during for index node assignment bit map when the file of the non-root directory that is described file system in described bit map area, the traversal bitmap from described bit map area low address end to high address end direction, until find a first idle bitmap, described the first bitmap is distributed to the described index node of the file of described non-root directory; And, when the index node allocation space index node list item space of the file of the non-root directory that is described file system in described resource-area, from described resource-area low address end to high address end direction, search first space corresponding with described the first bitmap, and described the first allocation of space is given to the described index node of the file of described non-root directory;
Described data block configuration module, comprising:
Non-root directory data block configuration module, during for data block assignment bit map when the file of the non-root directory that is described file system in described bit map area, the traversal bitmap from described bit map area high address end to low address extreme direction, until find a second idle bitmap, described the second bitmap finding is distributed to the described data block of the file of described non-root directory; And, when the described data block allocation space of the file of the non-root directory that is described file system in described resource-area, from described resource-area high address end to low address extreme direction, search the second space corresponding with described the second bitmap, and described second space is distributed to the described data block of the file of described non-root directory.
12. inking devices of the storage space of file system as claimed in claim 8 or 9, is characterized in that, described index node configuration module, comprising:
Non-root directory index node configuration module, during for index node assignment bit map when the file of the non-root directory that is described file system in described bit map area, the next bitmap that described bit map area low address end has been assigned as to the bitmap of index node to last of high address end direction is distributed to the described index node of the file of described non-root directory; And, when the index node allocation space index node list item space that is described file system in described resource-area, described resource-area low address end has been assigned as to the next allocation of space in index node list item space to the described index node of the file of described non-root directory to last of high address end direction;
Described data block configuration module, comprising:
Non-root directory data block configuration module, during for data block assignment bit map when the file of the non-root directory that is described file system in described bit map area, the next bitmap that described bit map area high address end has been assigned as to the bitmap of data block to last of low address extreme direction is distributed to the described data block of the file of described non-root directory; And, when the described data block allocation space that is described file system in described resource-area, described resource-area low address end has been assigned as to the next allocation of space in space of data block to last of high address end direction to the described data block of the file of described non-root directory.
13. inking devices of the storage space of file system as claimed in claim 8 or 9, is characterized in that, also comprise:
Index node removing module, for when deleting index node, bitmap zero clearing by described index node in described bit map area, and discharge described index node in the space of described resource-area, and in index node deletion record table, adding the index node index information of described deletion, the index node that the index information of described index node is used to indicate described deletion is the position at the index node list item of described resource-area at the position of the bitmap of described bit map area and the index node of the described deletion of indication;
Data block removing module, for when deleting data block, bitmap zero clearing by described data block in described bit map area, and discharge described data block in the space of described resource-area, and in data block deletion record table, add the index information of the data block of described deletion, the information of the index of described data block is used to indicate the data block of described deletion in the position and the locus of indicating the data block of described deletion in described resource-area of the bitmap of described bit map area.
The inking device of the storage space of 14. file system as claimed in claim 13, it is characterized in that, described index node configuration module, during also for the index node assignment bit map when being described file system in described bit map area and the index node allocation index node list item space that is described file system in described resource-area, whether inquire about described index node deletion record table is empty, if described index node deletion record table non-NULL, according to the index information in described index node deletion record table, again by the bitmap of deleted index node and allocation of space, give the described index node of described file system,
Described data block configuration module, also for the data block assignment bit map when being described file system in described bit map area and when the data block allocation space that is described file system in described resource-area, whether inquire about described data block deletion record table is empty, if described data block deletion record table non-NULL, gives the bitmap of deleted data block and allocation of space the described data block of described file system again according to the index information in described data block deletion record table.
CN201310750617.0A 2013-12-31 2013-12-31 A kind of collocation method and device of the memory space of file system Active CN103714013B (en)

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 true CN103714013A (en) 2014-04-09
CN103714013B 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)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572828A (en) * 2014-12-08 2015-04-29 中国科学院信息工程研究所 Auxiliary indexing method and auxiliary indexing system based on space bitmap model
CN105138632A (en) * 2015-08-20 2015-12-09 浪潮(北京)电子信息产业有限公司 Organization and management method for file data and file management server
CN105893266A (en) * 2015-01-04 2016-08-24 伊姆西公司 Method and device for reusing storage block of file system
WO2016138839A1 (en) * 2015-03-05 2016-09-09 长沙新弘软件有限公司 Bitmap-based storage space management system and method thereof
CN106021466A (en) * 2016-05-17 2016-10-12 浙江大华技术股份有限公司 Data storage method and apparatus
CN106021127A (en) * 2016-05-09 2016-10-12 Tcl移动通信科技(宁波)有限公司 A mobile terminal-based cache sharing method and system
CN106202350A (en) * 2016-07-05 2016-12-07 浪潮(北京)电子信息产业有限公司 A kind of distributed file system simplifies the method and system of configuration automatically
WO2016191964A1 (en) * 2015-05-29 2016-12-08 华为技术有限公司 Management method and device of file system
WO2018045634A1 (en) * 2016-09-08 2018-03-15 百富计算机技术(深圳)有限公司 Method and device for loading application of small embedded system

Citations (6)

* Cited by examiner, † Cited by third party
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

Patent Citations (6)

* Cited by examiner, † Cited by third party
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

Cited By (14)

* Cited by examiner, † Cited by third party
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
CN104572828A (en) * 2014-12-08 2015-04-29 中国科学院信息工程研究所 Auxiliary indexing method and auxiliary indexing system based on space bitmap model
CN105893266B (en) * 2015-01-04 2020-04-28 伊姆西Ip控股有限责任公司 Method and apparatus for reusing storage blocks of a file system
CN105893266A (en) * 2015-01-04 2016-08-24 伊姆西公司 Method and device for reusing storage block of file system
WO2016138839A1 (en) * 2015-03-05 2016-09-09 长沙新弘软件有限公司 Bitmap-based storage space management system and method thereof
WO2016191964A1 (en) * 2015-05-29 2016-12-08 华为技术有限公司 Management method and device of file system
CN107111549A (en) * 2015-05-29 2017-08-29 华为技术有限公司 The management method and device of a kind of file system
CN107111549B (en) * 2015-05-29 2020-09-08 华为技术有限公司 File system management method and device
CN105138632A (en) * 2015-08-20 2015-12-09 浪潮(北京)电子信息产业有限公司 Organization and management method for file data and file management server
CN106021127A (en) * 2016-05-09 2016-10-12 Tcl移动通信科技(宁波)有限公司 A mobile terminal-based cache sharing method and system
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
WO2018045634A1 (en) * 2016-09-08 2018-03-15 百富计算机技术(深圳)有限公司 Method and device for loading application of small embedded system

Also Published As

Publication number Publication date
CN103714013B (en) 2017-08-25

Similar Documents

Publication Publication Date Title
CN103714013A (en) Method and device for allocating storage space of file system
KR101994021B1 (en) File manipulation method and apparatus
US9134908B2 (en) Logical volume space sharing
CN103440208B (en) A kind of method that data store and device
CN108628753B (en) Memory space management method and device
WO2016086819A1 (en) Method and apparatus for writing data into shingled magnetic record smr hard disk
CN105468642A (en) Data storage method and apparatus
CN107016100A (en) A kind of metadata management method based on Nonvolatile memory file system
CN104008111A (en) Data storage management method and device
CN103425435B (en) Disk storage method and disk storage system
CN111143285A (en) Small file storage file system and small file processing method
CN103744875B (en) Data quick migration method and system based on file system
CN105138282A (en) Storage space recycling method and storage system
CN102541969B (en) File protection method and system based on file allocation table (FAT) file system, and memory
CN110597762A (en) File processing method, device, equipment and storage medium
CN102253985B (en) File system data management method and system
CN103577553A (en) Data storage method
CN101727503A (en) Method for establishing disk file system
CN107807989B (en) Small file processing method and device
CN105867836A (en) Storage management method and apparatus as well as stream media system
CN102542041A (en) Method and system for processing raster data
CN105493080A (en) Method and apparatus for context aware based data de-duplication
CN109491927B (en) Data storage method, data reading method, data storage device, data reading device and electronic equipment
CN107423425A (en) A kind of data quick storage and querying method to K/V forms
CN107148612A (en) A kind of method and apparatus of extending user subregion

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