CN101996228A - Method for sharing file data block and method for de-sharing file data block - Google Patents
Method for sharing file data block and method for de-sharing file data block Download PDFInfo
- Publication number
- CN101996228A CN101996228A CN2009103057462A CN200910305746A CN101996228A CN 101996228 A CN101996228 A CN 101996228A CN 2009103057462 A CN2009103057462 A CN 2009103057462A CN 200910305746 A CN200910305746 A CN 200910305746A CN 101996228 A CN101996228 A CN 101996228A
- Authority
- CN
- China
- Prior art keywords
- file
- metadata
- data piece
- shared data
- shared
- 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.)
- Pending
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to a method for sharing a file data block and a method for de-sharing the file data block. The method for sharing the file data block comprises the following steps of: (a) looking up a store address of a shared data block according to a metadata structure of a source file of the shared data block; and (b) modifying metadata of an object file so as to ensure that the metadata of the object file quotes the store address of the shared data block. By utilizing the invention, data of a certain or some data blocks of a file can be directly converted into the data of a specified position of another file, thereby omitting the process of reading a data block content and writing the data block content into the specified position of another file, enhancing the speed of file copying without a special copying space in the process of copying the data block, and saving a storage space.
Description
Technical field
The present invention relates to computer technology, relate in particular to a kind of method of shared file data block, a kind of method and a kind of device of realizing that file data blocks is shared and releasing is shared of removing the shared file data block.
Background technology
At present, under all computer file systems, file all has independently data block store space.If desired with certain block copy of certain file in another file or when adding the end of another file to, need at first from source file, to read the data of this data block, and then the end that the data of this data block are write in the middle of another file or write another file, the just data of preserving this data block in another file storing space content in other words.
Summary of the invention
Technical matters to be solved by this invention provides a kind of method of shared file data block, improves the speed of xcopy data block, saves copy space.
For solving the problems of the technologies described above, the present invention proposes a kind of method of shared file data block, comprising:
Step (a) finds the memory address of shared data piece according to the metadata structure of shared data piece place source file;
Step (b), the metadata of modify target file makes the metadata of file destination quote the memory address of described shared data piece.
Further, said method also can have following characteristics, also comprise: step (c), on original reference count basis of described shared data piece, add 1, the reference count of described shared data piece equals the current number of times of being quoted by the metadata of file destination of described shared data piece.
Further, said method also can have following characteristics, and described step (b) is specially:
If described shared data piece is added in the file destination, the file size information in the modify target file metadata then, make the actual file length after the length of this file destination after the modification equals supplemental data, make the metadata of this file destination quote the memory address of described shared data piece then; If described shared data piece is replaced the data block of file destination, then discharge earlier, then the memory address of described shared data piece is added to the original address that is replaced data block of pointing in the metadata of this file destination pointing to the address that is replaced data block in the metadata of file destination.
The invention allows for a kind of method of removing the shared file data block, comprising:
Step (a), the metadata of modify target file makes the space content of pointing to the shared data piece in the metadata of this file destination for empty.
Further, said method also can have following characteristics, also comprise: step (b), on original reference count basis of described shared data piece, subtract 1, the reference count of described shared data piece equals the current number of times of being quoted by the metadata of file destination of described shared data piece, when reference count is not 0, can not discharge the space of storage shared data piece.
The invention allows for a kind of device of realizing that file data blocks is shared and releasing is shared, comprising:
Search module, be used for finding the memory address of shared data piece according to the metadata structure of shared data piece place source file;
Quote module, be used for the metadata of modify target file, make the metadata of file destination quote the memory address of described shared data piece;
Remove module, be used for the metadata of modify target file, make in the metadata of file destination and point to the space content of shared data piece for empty.
Further, said apparatus also can have following characteristics, also comprise counting module, be used for after the metadata of file destination is quoted the memory address of described shared data piece, on original reference count basis of described shared data piece, add 1, after the space content of sensing shared data piece is revised as sky in the metadata of file destination, subtract 1 on original reference count basis of described shared data piece, the reference count of described shared data piece equals the current number of times of being quoted by the metadata of file destination of described shared data piece.
Use the present invention and can be directly the data of certain or some data block of a file be directly changed into the data of the assigned address of another file, removed the read block content from and data block contents has been written to the process of another document allocation, improved the speed of xcopy, and in the process of copied chunks, do not need special copy space, thereby saved storage space.
Description of drawings
Fig. 1 is the method flow diagram of shared file data block of the present invention;
Fig. 2 is the method flow diagram that the present invention removes the shared file data block;
Fig. 3 is that the present invention realizes the structure drawing of device that file data blocks is shared and releasing is shared;
Fig. 4 is that the method for shared file data block of the present invention is used synoptic diagram;
Fig. 5 is the method application synoptic diagram that the present invention removes the shared file data block.
Embodiment
Below in conjunction with accompanying drawing principle of the present invention and feature are described, institute gives an actual example and only is used to explain the present invention, is not to be used to limit scope of the present invention.
Fig. 1 is the method flow diagram of shared file data block of the present invention, and as shown in Figure 1, the method flow of shared file data block of the present invention comprises:
Here, the memory address of shared data piece refers to the physical location of shared data piece at physical medium.
Two kinds of situations are generally arranged here, and a kind of is that the shared data piece is added in the file destination, just increases the data of shared data piece on the basis of file destination legacy data again, and another kind is some data block that is substituted into file destination with the shared data piece.If the shared data piece is added in the file destination, the file size information in the modify target file metadata then, make the actual file length after the length of this file destination after the modification equals supplemental data, make the metadata of this file destination quote the memory address of described shared data piece then; If replace the data block of file destination with described shared data piece, then discharge earlier, then the memory address of described shared data piece is added to the original address that is replaced data block of pointing in the metadata of this file destination pointing to the address that is replaced data block in the metadata of file destination.
Here, the reference count initial value of shared data piece is 0, and expression does not have file destination to quote this shared data piece.The reference count of supposing the shared data piece is 5, represents that then the current file destination of quoting this shared data piece has 5.Need to prove that each shared data piece all each has a reference count.Such as two shared data pieces of data block A and data block B are arranged, then data block A and data block B each have a reference count.Certainly, using the purpose of the reference count of shared data piece is to understand the state of quoting of shared data piece for convenience, in other embodiments of the invention, if do not need to understand the state of quoting of shared data piece, then can omit step 103.
The method of shared file data block of the present invention is used synoptic diagram as shown in Figure 4.Among Fig. 4, (a) be the metadata of source file at the place of shared data blocks of data piece 1 and data block 2, (b) be the metadata of the file destination of quoting shared data blocks of data piece 1 and data block 2.
The method of shared file data block of the present invention can be directly be directly changed into the data of the assigned address of another file with the data of certain or some data block of a file, removed the read block content from and data block contents has been written to the process of another document allocation, improved the speed of xcopy, and in the process of copied chunks, do not need special copy space, thereby saved storage space.
The invention allows for a kind of method of removing the shared file data block, Fig. 2 is the method flow diagram that the present invention removes the shared file data block, and as shown in Figure 2, the method that the present invention removes the shared file data block comprises:
Step 201, the metadata of modify target file makes the space content of pointing to the shared data piece in the metadata of this file destination for empty;
Step 202, on original reference count basis of shared data piece, subtract 1, the reference count of shared data piece equals the current number of times of being quoted by the metadata of file destination of this shared data piece, when reference count is not 0, can not discharge the space of storage shared data piece.
If reference count greater than 0 modification finish, reference count cannot be about to this shared data piece from the storage space deletion with the data of shared data piece greater than 0 o'clock and discharge, if reference count equals 0 then this shared data piece can be discharged.
The present invention removes the method for shared file data block and uses synoptic diagram as shown in Figure 5.Among Fig. 5, (a) be the metadata of source file at the place of shared data blocks of data piece 1 and data block 2, (b) be the metadata of the file destination of quoting shared data blocks of data piece 1 and data block 2.Fig. 5 represents to remove source file sharing shared data blocks of data piece 1 and data block 2.
The invention allows for a kind of device of realizing that file data blocks is shared and releasing is shared, Fig. 3 is that the present invention realizes the structure drawing of device that file data blocks is shared and releasing is shared, as shown in Figure 3, the present invention realizes that the device that file data blocks is shared and releasing is shared comprises:
Remove module 33, be used for the metadata of modify target file, make in the metadata of file destination and point to the space content of shared data piece for empty.
Again as shown in Figure 3, the present invention realizes that the device that file data blocks is shared and releasing is shared can also comprise counting module 34, be used for after the metadata of file destination is quoted the memory address of shared data piece, on original reference count basis of this shared data piece, add 1, after the space content of sensing shared data piece is revised as sky in the metadata of file destination, subtract 1 on original reference count basis of this shared data piece, the reference count of shared data piece equals the current number of times of being quoted by the metadata of file destination of shared data piece.
Realization file data blocks of the present invention is shared and is removed the device shared and can be directly the data of certain or some data block of a file be directly changed into the data of the assigned address of another file, removed the read block content from and data block contents has been written to the process of another document allocation, improved the speed of xcopy, and in the process of copied chunks, do not need special copy space, thereby saved storage space.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.
Claims (7)
1. the method for a shared file data block is characterized in that, comprising:
Step (a) finds the memory address of shared data piece according to the metadata structure of shared data piece place source file;
Step (b), the metadata of modify target file makes the metadata of file destination quote the memory address of described shared data piece.
2. the method for shared file data block according to claim 1, it is characterized in that, also comprise: step (c), add 1 on original reference count basis of described shared data piece, the reference count of described shared data piece equals the current number of times of being quoted by the metadata of file destination of described shared data piece.
3. the method for shared file data block according to claim 1 is characterized in that, described step (b) is specially:
If described shared data piece is added in the file destination, the file size information in the modify target file metadata then, make the actual file length after the length of this file destination after the modification equals supplemental data, make the metadata of this file destination quote the memory address of described shared data piece then; If described shared data piece is replaced the data block of file destination, then discharge earlier, then the memory address of described shared data piece is added to the original address that is replaced data block of pointing in the metadata of this file destination pointing to the address that is replaced data block in the metadata of file destination.
4. a method of removing the shared file data block is characterized in that, comprising:
Step (a), the metadata of modify target file makes the space content of pointing to the shared data piece in the metadata of this file destination for empty.
5. the method for releasing shared file data block according to claim 4, it is characterized in that, also comprise: step (b), on original reference count basis of described shared data piece, subtract 1, the reference count of described shared data piece equals the current number of times of being quoted by the metadata of file destination of described shared data piece, when reference count is not 0, can not discharge the space of storage shared data piece.
6. a device of realizing that file data blocks is shared and releasing is shared is characterized in that, comprising:
Search module, be used for finding the memory address of shared data piece according to the metadata structure of shared data piece place source file;
Quote module, be used for the metadata of modify target file, make the metadata of file destination quote the memory address of described shared data piece;
Remove module, be used for the metadata of modify target file, make in the metadata of file destination and point to the space content of shared data piece for empty.
7. the device that realization file data blocks according to claim 6 is shared, it is characterized in that, also comprise counting module, be used for after the metadata of file destination is quoted the memory address of described shared data piece, on original reference count basis of described shared data piece, add 1, after the space content of sensing shared data piece is revised as sky in the metadata of file destination, subtract 1 on original reference count basis of described shared data piece, the reference count of described shared data piece equals the current number of times of being quoted by the metadata of file destination of described shared data piece.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009103057462A CN101996228A (en) | 2009-08-18 | 2009-08-18 | Method for sharing file data block and method for de-sharing file data block |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009103057462A CN101996228A (en) | 2009-08-18 | 2009-08-18 | Method for sharing file data block and method for de-sharing file data block |
Publications (1)
Publication Number | Publication Date |
---|---|
CN101996228A true CN101996228A (en) | 2011-03-30 |
Family
ID=43786387
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2009103057462A Pending CN101996228A (en) | 2009-08-18 | 2009-08-18 | Method for sharing file data block and method for de-sharing file data block |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101996228A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102419770A (en) * | 2011-11-23 | 2012-04-18 | 中兴通讯股份有限公司 | File sharing system, method for realizing file sharing, and file index service equipment |
CN104077409A (en) * | 2014-07-14 | 2014-10-01 | 北京龙存科技有限责任公司 | Method for quickly splitting and merging file on basis of restructured file metadata |
CN104077315A (en) * | 2013-03-29 | 2014-10-01 | 国家计算机网络与信息安全管理中心 | Distributed file system data importing method and distributed file system data importing device |
CN104461780A (en) * | 2014-11-28 | 2015-03-25 | 华为技术有限公司 | Data block release method and device |
CN105306564A (en) * | 2015-10-20 | 2016-02-03 | 浪潮集团有限公司 | Database-based network disk file replication method and server |
CN106575309A (en) * | 2014-08-29 | 2017-04-19 | 微软技术许可有限责任公司 | File system with data block sharing |
CN112035420A (en) * | 2020-09-03 | 2020-12-04 | 西北工业大学 | Data sharing method, sharing device and system |
-
2009
- 2009-08-18 CN CN2009103057462A patent/CN101996228A/en active Pending
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102419770A (en) * | 2011-11-23 | 2012-04-18 | 中兴通讯股份有限公司 | File sharing system, method for realizing file sharing, and file index service equipment |
CN102419770B (en) * | 2011-11-23 | 2014-12-31 | 中兴通讯股份有限公司 | File sharing system, method for realizing file sharing, and file index service equipment |
CN104077315A (en) * | 2013-03-29 | 2014-10-01 | 国家计算机网络与信息安全管理中心 | Distributed file system data importing method and distributed file system data importing device |
CN104077315B (en) * | 2013-03-29 | 2017-08-11 | 国家计算机网络与信息安全管理中心 | Distributed File System Data introduction method and device |
CN104077409A (en) * | 2014-07-14 | 2014-10-01 | 北京龙存科技有限责任公司 | Method for quickly splitting and merging file on basis of restructured file metadata |
CN104077409B (en) * | 2014-07-14 | 2017-12-12 | 北京龙存科技有限责任公司 | A kind of method that rapid file cutting is realized based on restructuring file metadata and merged |
CN106575309A (en) * | 2014-08-29 | 2017-04-19 | 微软技术许可有限责任公司 | File system with data block sharing |
CN106575309B (en) * | 2014-08-29 | 2020-06-12 | 微软技术许可有限责任公司 | File system with data block sharing |
CN104461780A (en) * | 2014-11-28 | 2015-03-25 | 华为技术有限公司 | Data block release method and device |
CN104461780B (en) * | 2014-11-28 | 2017-12-15 | 华为技术有限公司 | A kind of method and device for discharging data block |
CN105306564A (en) * | 2015-10-20 | 2016-02-03 | 浪潮集团有限公司 | Database-based network disk file replication method and server |
CN112035420A (en) * | 2020-09-03 | 2020-12-04 | 西北工业大学 | Data sharing method, sharing device and system |
CN112035420B (en) * | 2020-09-03 | 2023-03-14 | 西北工业大学 | Data sharing method, sharing device and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10031675B1 (en) | Method and system for tiering data | |
US10540106B2 (en) | System and method for copy on write on an SSD | |
US10761977B2 (en) | Memory system and non-transitory computer readable recording medium | |
CN101996228A (en) | Method for sharing file data block and method for de-sharing file data block | |
US8838903B2 (en) | Priority ordered multi-medium solid-state storage system and methods for use | |
US8650379B2 (en) | Data processing method for nonvolatile memory system | |
CN103902669B (en) | A kind of separate type file system based on different storage mediums | |
US9262313B2 (en) | Provisioning in heterogenic volume of multiple tiers | |
US20150186259A1 (en) | Method and apparatus for storing data in non-volatile memory | |
CN106886370B (en) | data safe deletion method and system based on SSD (solid State disk) deduplication technology | |
ES2691484T3 (en) | Driver, flash memory device, method to identify the stability of data blocks and method to store data in a flash memory device | |
US10108342B2 (en) | Method for reducing use of DRAM in SSD and the SSD using the same | |
CN101968795A (en) | Cache method for file system with changeable data block length | |
CN105718530A (en) | File storage system and file storage control method thereof | |
US20190391756A1 (en) | Data storage device and cache-diversion method thereof | |
US11150819B2 (en) | Controller for allocating memory blocks, operation method of the controller, and memory system including the controller | |
US20150169570A1 (en) | Method and device for managing data | |
US10901885B2 (en) | Memory device and non-transitory computer readable recording medium | |
US20220253381A1 (en) | Memory system and non-transitory computer readable recording medium | |
CN105653466A (en) | Data storage device and flash memory control method | |
US20150254133A1 (en) | Memory controller, storage apparatus, information processing system, and control method therefor | |
CN106201326B (en) | Information processing apparatus | |
CN106205708B (en) | Cache memory device | |
US20140281157A1 (en) | Memory system, memory controller and method | |
US10474569B2 (en) | Information processing device including nonvolatile cache memory and processor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C12 | Rejection of a patent application after its publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20110330 |